Performance Probleme

Status
Für weitere Antworten geschlossen.

Cloppy

New Member
Hi,
ich habe einen rootserver (für mich allein, also nix virtual oder so) mit 1GB RAM und einem AMD Athlon 64 3700+ mit Apache2.

So, nun kommt es in letzter Zeit häufiger vor, dass der Load Average auf 10 und mehr ansteigt und die Seiten sich praktisch nicht mehr aufbauen.
Ein Blick in top zeigt folgendes:
Code:
top - 23:06:23 up 3 days, 11:31,  1 user,  load average: 9.62, 14.67, 14.52
Tasks: 103 total,   4 running,  99 sleeping,   0 stopped,   0 zombie
Cpu(s): 53.3% us,  7.0% sy, 39.7% ni,  0.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:   1027420k total,   959660k used,    67760k free,    68044k buffers
Swap:  2096440k total,       88k used,  2096352k free,   533288k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
13729 mysql     16   0  157m  36m 4476 S 50.9  3.6   1910:16 mysqld
 3497 root      39  15 11016 7824  396 R 39.9  0.8   5:29.10 bzip2
14183 root      15   0  132m  10m 5972 S  8.7  1.0 151:52.68 php5
    1 root      16   0   776  304  252 S  0.0  0.0   0:00.91 init
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      10  -5     0    0    0 S  0.0  0.0   0:00.15 events/0
    5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
    6 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
    9 root      10  -5     0    0    0 S  0.0  0.0   0:00.01 kblockd/0
   10 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
  122 root      15   0     0    0    0 S  0.0  0.0   0:20.98 pdflush
  123 root      15   0     0    0    0 S  0.0  0.0   0:10.62 pdflush
  125 root      14  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
  124 root      15   0     0    0    0 S  0.0  0.0   0:00.91 kswapd0
  331 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0
  332 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
Mir fallen grundsätzlich 2 Sachen auf. Der RAM ist voll (lässt sich ja leicht ändern, aber wirklich der Grund der Laggs?) und der MySQL Prozess verbraucht unnormal viel Ressourcen. Auf dem Server läuft ein Browsergame. Die MySQL Querys wurden alle optimiert.
Aber ich dachte, vllt. kann man bei Apache noch etwas an Leistung rausholen. Meine server-tuning.conf sieht so aus:
Code:
##
## Server-Pool Size Regulation (MPM specific)
## 

# the MPM (multiprocessing module) is not a dynamically loadable module in the
# sense of other modules. It is a compile time decision which one is used. We
# provide different apache2 MPM packages, containing different httpd2 binaries
# compiled with the available MPMs. See APACHE_MPM in /etc/sysconfig/apache2.

# prefork MPM
<IfModule prefork.c>
	# number of server processes to start
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#startservers
       StartServers 3
	# minimum number of server processes which are kept spare
	# http://httpd.apache.org/docs/2.2/mod/prefork.html#minspareservers
       MinSpareServers 3
	# maximum number of server processes which are kept spare
	# http://httpd.apache.org/docs/2.2/mod/prefork.html#maxspareservers
       MaxSpareServers 8
	# highest possible MaxClients setting for the lifetime of the Apache process.
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#serverlimit
	ServerLimit        150
	# maximum number of server processes allowed to start
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients
	MaxClients         150
	# maximum number of requests a server process serves
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild
       MaxRequestsPerChild 0
</IfModule>

# worker MPM
<IfModule worker.c>
	# initial number of server processes to start
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#startservers
	StartServers         2
	# minimum number of worker threads which are kept spare
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#minsparethreads
	MinSpareThreads     25
	# maximum number of worker threads which are kept spare
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxsparethreads
	MaxSpareThreads     75 
	# upper limit on the configurable number of threads per child process
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadlimit
	ThreadLimit         60
	# maximum number of simultaneous client connections
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients
	MaxClients         250
	# number of worker threads created by each child process
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#threadsperchild
	ThreadsPerChild     60
	# maximum number of requests a server process serves
	# http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequestsperchild
	MaxRequestsPerChild  100
</IfModule>


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

#
# 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

#
# EnableMMAP: Control whether memory-mapping is used to deliver
# files (assuming that the underlying OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  On some systems, turning it off (regardless of
# filesystem) can improve performance; for details, please see
# http://httpd.apache.org/docs-2.2/mod/core.html#enablemmap
#
#EnableMMAP off

#
# EnableSendfile: Control whether the sendfile kernel support is
# used  to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  Please see
# http://httpd.apache.org/docs-2.2/mod/core.html#enablesendfile
#
#EnableSendfile off


#
# The following directives modify normal HTTP response behavior to
# handle known problems with browser implementations.
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

#
# The following directive disables redirects on non-GET requests for
# a directory that does not include the trailing slash.  This fixes a 
# problem with Microsoft WebFolders which does not appropriately handle 
# redirects for folders with DAV methods.
# Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
Da wollte ich auch gleich am nächsten anknüpfen.
Mein Apache verwendet von prefork, aber ich hätte das gerne auf worker umgestellt. Bekommt man das ohne einer Neuinstallation hin? Und was muss man da wo umschreiben?

Über Hilfe, Tipps und Anregungen (vor allem mit dem MySQL-Prozess) wäre ich sehr danke.

Gut Nacht.
 
Status
Für weitere Antworten geschlossen.
Oben