PHP und APACHE auf schwachem vServer tunen

belinea

Registered User
An welchen PHP und APACHE Einstellungen könnte ich drehen um einen vServer (der ja bekanntlich sehr wenig Hauptspeicher besitzt) ein klein wenig zu tunen?
 
Hallo belinea,

hier helfen nur weitere Informationen, wie z.B.:

Was für PHP-Skripte laufen denn da? Brauchen diese viel Hauptspeicher oder eher Prozessor-Zeit?
Liegt die Auslastung des Apaches an vielen Anfragen eines Clients oder an Anfragen mehrerer Clients?
Wird mySQL verwendet? Wenn ja, sind ordentliche Indizes angelegt?

tim
 
Es läuft eine Bildergallery:

http://gallery.menalto.com/modules.php?op=modload&name=News&file=index

Ich dachte zuerst es liegt vielleicht an einer lahmenden Festplatte. Allerdings habe ich dann auch mal die noch im Alphastadium basierende Gallery v2 probiert. Auch hier dauert der Aufbau der Gallery EWIG. Manche Vorschaubilder werden oft erst gar nicht angezeigt.

Ich vermute daher das es am Apache, und da speziell an folgende Einstellungen liegt.

Hier mal ein Auszug aus meiner httpd.conf:


PHP:
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
#
MinSpareServers 5
MaxSpareServers 10

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 5

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients    150

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 100

Ich habe sehr wenige Nutzer die den Apache beanspruchen. Meist nur 1-3 Leute gleichzeitig.
 
Also, bei Bilder-Galerie denke ich automatisch an den maximal zulässigen Speicher für php-Scripte (da wird wohl einiges benötigt, wenn Vorschau-Bilder automatisch erzeugt werden), und auch an die maximal zulässige Dauer, die ein Script laufen darf. => beides hochschrauben.
Siehe: http://de3.php.net/manual/de/ini.sect.resource-limits.php

Dass es an apache-Einstellungen oder der Festplatte liegt, glaube ich eher weniger. Und die Spare/Start-Server-Anzahl ist ja schon reduziert (im Vergleich zur Apache-Standard-Installation).

Such' auch mal hier im Board unter der php-Rubrik :cool:
 
Back
Top