Bekijk Volledige Versie : Server wil niet swappen
StarInternet
11/09/07, 10:28
Beste,
We hebben verschillende servers met SuSE 9.2 en hoger staan.
Ze werken allemaal na behoren maar zins 2 twee weken is een van de servers super traag.
De server draaid alleen apache2 en mysql op, mysql load is extreem laag en apache load is vrij hoog maar niet abnormaal. alleen wat mijn op viel dat deze server maar 8k swap gebruikt.
Weet iemand een reden waarom de machine niet swapt?
HP DL360 2x3Ghz Xeon 1GB Mem.
Er draaien op deze server 50 websites op.
geef eens de output van free
GlennMatthys
11/09/07, 11:15
Waarom zou de server moeten swappen?
StarInternet
11/09/07, 15:20
KOP: total used free shared buffers cached
Mem: 2075532 2021904 53628 0 105292 1587308
Swap: 1052216 0 1052216
Server is niet vooruit te branden en andere oorzaak kan ik nu niet vinden, alleen dat apache2 veel load trekt maar dat gebeurt vakker en is de server even goed normaal benaderbaar!
Zo te zien ben je wel door je swap heen. Dit zou de vertraging kunnen verklaren...
StarInternet
11/09/07, 15:41
Nee, sorry free output was door de war, net goed gezet!
top - 16:02:47 up 74 days, 4:40, 2 users, load average: 8.59, 7.95, 8.38
Tasks: 69 total, 4 running, 65 sleeping, 0 stopped, 0 zombie
Cpu(s): 95.1% us, 4.6% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.3% si
Mem: 2075532k total, 2007264k used, 68268k free, 105744k buffers
Swap: 1052216k total, 0k used, 1052216k free, 1591536k cached
Reden om te swappen is er volgens bovenstaande niet... Er is nog 68 MB geheugen daadwerkelijk vrij en er staat voor 1,5 GB aan cache in je geheugen.
Ik zou toch nog maar eens gaan kijken wat er aan processen draait. Je cpu's worden namelijk voor 95% gebruikt door gebruikersprocessen.
us -- User CPU time
The time the CPU has spent running users’ processes that are not
niced.
Bekijk even het commando vmstat, dat zou je wat meer info moeten geven. Best eerst even de manpage doornemen, zodat je weet wat je te zien krijgt.
Doe bv ook eens een "cat /proc/meminfo" en kijk naar de items:
MemTotal: xx kB
MemFree: xx kB
Buffers: xx kB
Cached: xx kB
Als je bv ook redelijk wat kB's in cached + buffered mem heb, dan is er verder ook geen reden om te gaan swappen.
StarInternet
12/09/07, 11:25
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 588 244 ? S 08:48 0:05 init [3]
root 2 0.0 0.0 0 0 ? S 08:48 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN 08:48 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S< 08:48 0:00 [events/0]
root 5 0.0 0.0 0 0 ? S< 08:48 0:00 [kblockd/0]
root 7 0.0 0.0 0 0 ? S< 08:48 0:00 [khelper]
root 8 0.0 0.0 0 0 ? S 08:48 0:00 [pdflush]
root 9 0.0 0.0 0 0 ? S 08:48 0:01 [pdflush]
root 11 0.0 0.0 0 0 ? S< 08:48 0:00 [aio/0]
root 10 0.0 0.0 0 0 ? S 08:48 0:00 [kswapd0]
root 159 0.0 0.0 0 0 ? S 08:48 0:00 [kseriod]
root 209 0.0 0.0 0 0 ? S< 08:48 0:00 [reiserfs/0]
root 652 0.0 0.0 0 0 ? S< 08:48 0:00 [kcopyd]
ftp 971 0.0 0.0 1916 908 ? Ss 08:48 0:00 proftpd (accepting connections)
root 1913 0.0 0.0 0 0 ? S 08:48 0:00 [khubd]
root 2842 0.0 0.0 1456 456 ? S 08:48 0:00 [hwscand]
root 2977 0.0 0.0 1416 472 ? Ss 08:48 0:00 /sbin/dhcpcd -D -R -N -t 999999 -h e2eserver eth0
root 5413 0.0 0.0 1460 628 ? Ss 08:48 0:00 /sbin/syslogd -a /var/lib/named/dev/log -a /var/lib/ntp/dev/log
root 5416 0.0 0.0 1524 596 ? Ss 08:48 0:00 /sbin/klogd -c 1 -2 -x
root 5484 0.0 0.0 1420 484 ? Ss 08:48 0:00 /sbin/resmgrd
bin 5486 0.0 0.0 1428 476 ? Ss 08:48 0:00 /sbin/portmap
root 5487 0.0 0.2 9112 5600 ? Ss 08:48 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
daemon 5623 0.0 0.0 4412 1468 ? Ss 08:48 0:00 /usr/sbin/slpd
root 6112 0.0 0.0 5360 1992 ? Ss 08:48 0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
root 6319 0.0 0.1 7180 3400 ? Ss 08:49 0:00 sendmail: accepting connections
mail 6327 0.0 0.1 6772 2996 ? Ss 08:49 0:00 sendmail: Queue control
mail 6328 0.0 0.1 6772 3276 ? S 08:49 0:00 sendmail: running queue: /var/spool/clientmqueue
root 6419 0.0 0.0 4148 1296 ? Ss 08:49 0:00 /usr/sbin/cron
root 6421 0.0 0.0 42520 644 ? Ss 08:49 0:00 /usr/sbin/nscd
root 7295 0.0 0.0 4356 1316 tty1 Ss+ 08:49 0:00 /sbin/mingetty --noclear tty1
root 7296 0.0 0.0 4356 1316 tty2 Ss+ 08:49 0:00 /sbin/mingetty tty2
root 7297 0.0 0.0 4356 1316 tty3 Ss+ 08:49 0:00 /sbin/mingetty tty3
root 7298 0.0 0.0 4356 1316 tty4 Ss+ 08:49 0:00 /sbin/mingetty tty4
root 7299 0.0 0.0 4356 1316 tty5 Ss+ 08:49 0:00 /sbin/mingetty tty5
root 7300 0.0 0.0 4356 1316 tty6 Ss+ 08:49 0:00 /sbin/mingetty tty6
root 7351 0.0 0.1 9896 3232 ? Ss 08:49 0:00 sshd: root@pts/0
root 7355 0.0 0.1 6828 3072 pts/0 Ss 08:49 0:00 -bash
root 11138 0.0 0.0 5048 1812 ? S 09:44 0:00 /bin/sh /usr/bin/mysqld_safe --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --socket=/var/lib/mysql/mysql.sock --datadir=/var/lib/mysql
mysql 11171 0.0 1.4 67572 31100 ? S 09:44 0:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
root 26926 0.0 0.3 13880 7228 ? Rs 11:03 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 26930 5.1 0.5 18340 11668 ? S 11:03 0:21 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 26959 0.6 0.5 18280 11440 ? S 11:03 0:02 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 26960 0.7 0.5 18088 11200 ? S 11:03 0:03 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 26971 5.1 0.5 18180 11300 ? S 11:03 0:21 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27007 0.7 0.5 18468 11628 ? S 11:03 0:03 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27012 0.6 0.5 18104 11256 ? S 11:03 0:02 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27303 1.3 0.5 17924 11216 ? S 11:05 0:04 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27374 5.4 0.5 18468 11576 ? S 11:05 0:16 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27535 1.0 0.5 17988 11144 ? S 11:06 0:02 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27542 1.8 0.6 19340 12488 ? S 11:06 0:04 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27547 8.4 0.5 18748 11832 ? S 11:06 0:21 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 27554 3.9 0.5 17944 10972 ? S 11:06 0:09 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 27651 0.0 0.2 9112 5608 ? S 11:06 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
root 27652 0.0 0.2 9112 5608 ? S 11:06 0:00 /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
wwwrun 27969 0.9 0.4 17100 10348 ? S 11:08 0:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28111 1.2 0.5 18252 11480 ? S 11:09 0:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28121 1.3 0.5 17900 11016 ? S 11:09 0:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28155 0.5 0.5 17260 10460 ? S 11:09 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28159 0.7 0.5 17464 10632 ? S 11:09 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28170 10.7 0.5 17980 11028 ? S 11:09 0:06 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28175 9.3 0.5 17980 11028 ? S 11:09 0:05 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 28209 0.0 0.1 9892 3248 ? Ss 11:09 0:00 sshd: root@pts/1
root 28226 0.0 0.1 5544 2364 pts/1 Ss 11:09 0:00 -bash
wwwrun 28334 0.9 0.5 17372 10512 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28347 0.9 0.5 17504 10620 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28354 1.2 0.5 17196 10400 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28390 4.2 0.5 17260 10436 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28395 0.0 0.3 15120 7880 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28396 0.0 0.3 15120 7880 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 28402 0.0 0.0 4508 1624 pts/0 S+ 11:10 0:00 top
wwwrun 28403 0.0 0.3 15120 7880 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 28404 0.0 0.3 15120 7880 ? S 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 28405 0.0 0.3 14700 7580 ? R 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 28406 0.0 0.3 13880 7236 ? R 11:10 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root 28417 0.0 0.0 4912 1412 pts/1 R+ 11:10 0:00 ps aux
Van ps aux, ziet er ook goed uit? of zie ik wat over het hoofd?
cat /proc/meminfo
MemTotal: 2075532 kB
MemFree: 1460416 kB
Buffers: 75180 kB
Cached: 348360 kB
SwapCached: 0 kB
Active: 431516 kB
Inactive: 123956 kB
HighTotal: 1179596 kB
HighFree: 692224 kB
LowTotal: 895936 kB
LowFree: 768192 kB
SwapTotal: 1052216 kB
SwapFree: 1052216 kB
Dirty: 4468 kB
Writeback: 0 kB
Mapped: 141992 kB
Slab: 44668 kB
Committed_AS: 316636 kB
PageTables: 1248 kB
VmallocTotal: 114680 kB
VmallocUsed: 14188 kB
VmallocChunk: 97740 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB