PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Speicherprobleme auf vserver



problembehaftet
23.06.08, 11:34
Hallo,

welche Möglichkeit habe ich, um den Socket- und RAM-Bedarf zu senken, und was sind die Ursachen?

Das Paket ist ein älterer vserver bei vanager, scheinbar haben sie den Festplattenplatz noch nicht auf aktuelles Paketniveau angehoben:
Aktuell:

Webspace 10 GB
Traffic pro Monat 300 GB
Arbeitsspeicher (RAM) 256 MB
Garantierte CPU-Leistung 100 %
VPSadmin info:
Speicherplatz enthalten 1.536 MB
Speicherplatz belegt 931 MB ( 61 % )

Mir als Linux-Laie fällt auf, dass es anscheinend keinen Swap gibt. Weiterhin gibt es eine handvoll Child-Prozesse, die ich bei meiner minimalen Serverauslastung wahrscheinlich genausogut reduzieren könnte.
Leider weiß ich nicht genau, welche Schlüssel in den einzelnen Konfigurationen diese Zahl festlegen, und wie die Zusammenhänge/Auswirkungen sind.

Aus meinen bisherigen Recherchen habe ich folgende Info-Befehle zusammengetragen und ausgeführt, in der Hoffnung, dass Euch das mehr sagt, als mir:


# uname -r
2.6.9-023stab046.3-enterprise



# df -h
Filesystem Size Used Avail Use% Mounted on
vzfs 1.5G 1.3G 213M 87% /
tmpfs 3.0G 0 3.0G 0% /dev/shm



#top
Tasks: 51 total, 1 running, 50 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.2% sy, 0.0% ni, 99.8% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 308148k total, 295644k used, 12504k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15820 postfix 16 0 7860 3916 3108 S 1 1.3 0:00.42 smtpd
3392 root 16 0 2296 1116 872 R 0 0.4 0:00.26 top
1 root 16 0 1612 524 488 S 0 0.2 0:00.33 init
28454 root 16 0 1672 564 500 S 0 0.2 0:00.72 syslogd
28464 root 18 0 1616 332 320 S 0 0.1 0:00.00 klogd
30008 amavis 16 0 48296 17m 2224 S 0 5.7 0:01.21 amavisd-new
30050 root 19 0 1604 384 328 S 0 0.1 0:00.00 inetd
30146 root 17 0 2672 1248 1048 S 0 0.4 0:00.01 mysqld_safe
30208 mysql 16 0 25872 8176 3328 S 0 2.7 0:03.68 mysqld
30209 root 16 0 1596 492 464 S 0 0.2 0:00.00 logger
30257 amavis 15 0 50084 25m 2836 S 0 8.4 0:01.78 amavisd-new
8050 root 18 0 6392 688 552 S 0 0.2 0:00.00 saslauthd
9710 root 16 0 3660 872 700 S 0 0.3 0:00.00 sshd
11273 root 16 0 1968 652 504 S 0 0.2 0:04.16 dovecot
11654 nobody 16 0 4212 1184 564 S 0 0.4 0:00.16 proftpd
11720 daemon 16 0 1872 424 308 S 0 0.1 0:00.00 atd
11764 root 16 0 8712 1772 1220 S 0 0.6 0:03.41 dovecot-auth
11782 dovecot 16 0 3372 1220 976 S 0 0.4 0:03.78 imap-login
11788 dovecot 16 0 3372 1220 976 S 0 0.4 0:03.81 imap-login
11796 dovecot 16 0 3372 1220 976 S 0 0.4 0:03.79 imap-login
11840 root 16 0 2256 888 716 S 0 0.3 0:00.06 cron
13791 root 15 0 20708 6192 3476 S 0 2.0 0:01.21 apache2
15834 www-data 16 0 21352 6548 3328 S 0 2.1 0:00.55 apache2
16252 www-data 16 0 21352 6328 3204 S 0 2.1 0:00.52 apache2
10022 clamav 16 0 98636 53m 640 S 0 17.7 0:12.45 clamd
27756 www-data 18 0 14756 2580 2064 S 0 0.8 0:00.03 php4-cgi
29964 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29967 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29969 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29970 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
14113 root 15 0 4900 1388 1064 S 0 0.5 0:01.57 master
17680 postfix 17 0 4960 1236 1136 S 0 0.4 0:00.09 tlsmgr
3604 amavis 18 0 49064 17m 1584 S 0 5.7 0:00.01 amavisd-new
26501 postfix 16 0 4908 1604 1276 S 0 0.5 0:00.03 anvil
26303 root 16 0 8728 2536 1984 S 0 0.8 0:00.17 dovecot-auth
12052 dovecot 16 0 3364 1528 1284 S 0 0.5 0:00.24 pop3-login

9614 postfix 16 0 4908 1540 1240 S 0 0.5 0:00.00 pickup
21544 postfix 16 0 7404 2468 1892 S 0 0.8 0:00.05 trivial-rewrite
16293 dovecot 16 0 3364 1528 1284 S 0 0.5 0:00.05 pop3-login
3265 postfix 16 0 4948 1680 1348 S 0 0.5 0:00.01 qmgr
20192 www-data 16 0 21072 5032 2192 S 0 1.6 0:00.00 apache2
20205 www-data 16 0 21336 5192 2276 S 0 1.7 0:00.01 apache2
20313 root 15 0 17240 2000 1604 S 0 0.6 0:00.02 sshd
20328 root 15 0 3252 1120 832 S 0 0.4 0:00.04 sftp-server
24061 root 15 0 17072 1964 1596 S 0 0.6 0:00.03 sshd
24343 root 16 0 2636 1240 1032 S 0 0.4 0:00.01 bash
3192 root 16 0 17240 2016 1628 S 0 0.7 0:00.06 sshd
3253 root 15 0 2768 1504 1156 S 0 0.5 0:00.01 bash
17985 postfix 16 0 7460 2524 1980 S 0 0.8 0:00.02 cleanup
18058 postfix 17 0 4912 1612 1288 S 0 0.5 0:00.00 pipe
22207 dovecot 16 0 3364 1528 1284 S 0 0.5 0:00.00 pop3-login



# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
xxxx: kmemsize 5472822 5501188 6173130 6790443 85
lockedpages 0 0 79 79 0
privvmpages 74089 74149 77037 84741 0
shmpages 2062 2062 25600 25600 0
dummy 0 0 0 0 0
numproc 63 63 164 164 0
physpages 30178 30236 0 2147483647 0
vmguarpages 0 0 28247 2147483647 0
oomguarpages 44976 45034 28247 2147483647 0
numtcpsock 37 38 164 164 0
numflock 9 9 262 288 0
numpty 1 1 16 16 0
numsiginfo 0 1 512 512 0
tcpsndbuf 133032 146260 1137635 1809379 0
tcprcvbuf 125304 141688 1137635 1809379 0
othersockbuf 275728 276616 568817 1240561 0
dgramrcvbuf 0 0 568817 568817 0
numothersock 163 164 164 164 4814
dcachesize 0 0 1209139 1245413 0
numfile 2432 2464 3840 3840 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 14 14 35 35 0



free -m
total used free shared buffers cached
Mem: 300 289 11 0 0 0
-/+ buffers/cache: 289 11
Swap: 0 0 0



# vzfree
VPS Speichernutzung:
Momentan genutzt: 290.051 MB
Zugesichert: 110.34 MB
Maximal nutzbar: 331.02 MB



# tail /var/log/mail.err
Jun 23 09:45:34 xxx dovecot: pop3-login: socketpair() failed: Cannot allocate memory
Jun 23 09:45:39 vxxxx dovecot: socketpair() failed: Cannot allocate memory
Jun 23 09:45:39 vxxxx dovecot: Temporary failure in creating login processes, slowing down for now
Jun 23 10:13:52 vxxxx postfix/smtpd[25751]: fatal: socket: Cannot allocate memory
Jun 23 10:15:05 vxxxx postfix/qmgr[14139]: fatal: socket: Cannot allocate memory
Jun 23 10:15:29 vxxxx dovecot: socketpair() failed: Cannot allocate memory
Jun 23 10:15:29 vxxxx dovecot: Temporary failure in creating login processes, slowing down for now
Jun 23 10:28:58 vxxxx postfix/pipe[13659]: fatal: inet_addr_local[socket]: socket: No buffer space available
Jun 23 10:29:59 vxxxx postfix/pipe[32009]: fatal: inet_addr_local[socket]: socket: No buffer space available
Jun 23 10:34:15 vxxxx postfix/pipe[23932]: fatal: inet_addr_local[socket]: socket: No buffer space available




# ps -aux
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 1612 524 ? Ss Jun22 0:00 init [2]
root 28454 0.0 0.1 1672 564 ? Ss Jun22 0:00 /sbin/syslogd
root 28464 0.0 0.1 1616 332 ? Ss Jun22 0:00 /sbin/klogd -x
amavis 30008 0.0 5.6 48296 17464 ? Ss Jun22 0:01 amavisd (master)
root 30050 0.0 0.1 1604 384 ? Ss Jun22 0:00 /usr/sbin/inetd
root 30146 0.0 0.4 2672 1248 ? S Jun22 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 30208 0.0 2.6 25872 8268 ? Sl Jun22 0:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --
root 30209 0.0 0.1 1596 492 ? S Jun22 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
amavis 30257 0.0 8.3 50084 25740 ? S Jun22 0:01 amavisd (ch9-avail)
root 8050 0.0 0.2 6392 688 ? Ss Jun22 0:00 /usr/sbin/saslauthd -a pam shadow -n 0
root 9710 0.0 0.2 3660 872 ? Ss Jun22 0:00 /usr/sbin/sshd
root 11273 0.0 0.2 1968 652 ? Ss Jun22 0:04 /usr/sbin/dovecot
nobody 11654 0.0 0.3 4212 1184 ? Ss Jun22 0:00 proftpd: (accepting connections)
daemon 11720 0.0 0.1 1872 424 ? Ss Jun22 0:00 /usr/sbin/atd
root 11764 0.0 0.5 8712 1772 ? S Jun22 0:03 dovecot-auth
dovecot 11782 0.0 0.3 3372 1220 ? S Jun22 0:03 imap-login
dovecot 11788 0.0 0.3 3372 1220 ? S Jun22 0:03 imap-login
dovecot 11796 0.0 0.3 3372 1220 ? S Jun22 0:03 imap-login
root 11840 0.0 0.2 2256 888 ? Ss Jun22 0:00 /usr/sbin/cron
root 13791 0.0 2.0 20708 6192 ? Ss Jun22 0:01 /usr/sbin/apache2 -k start
www-data 15834 0.0 2.1 21352 6548 ? S Jun22 0:00 /usr/sbin/apache2 -k start
www-data 16252 0.0 2.0 21352 6328 ? S Jun22 0:00 /usr/sbin/apache2 -k start
clamav 10022 0.0 17.7 98636 54628 ? Ss Jun22 0:12 /usr/sbin/clamd
www-data 27756 0.0 0.8 14756 2580 ? Ss 00:05 0:00 /usr/bin/php4-cgi
www-data 29964 0.0 0.2 14756 860 ? S 00:05 0:00 /usr/bin/php4-cgi
www-data 29967 0.0 0.2 14756 860 ? S 00:05 0:00 /usr/bin/php4-cgi
www-data 29969 0.0 0.2 14756 860 ? S 00:05 0:00 /usr/bin/php4-cgi
www-data 29970 0.0 0.2 14756 860 ? S 00:05 0:00 /usr/bin/php4-cgi
root 14113 0.0 0.4 4900 1416 ? Ss 00:13 0:01 /usr/lib/postfix/master
postfix 17680 0.0 0.4 4960 1236 ? S 00:13 0:00 tlsmgr -l -t unix -u
amavis 3604 0.0 5.6 49064 17484 ? S 01:20 0:00 amavisd (virgin child)
postfix 26501 0.0 0.5 4908 1604 ? S 09:35 0:00 anvil -l -t unix -u
root 26303 0.0 0.8 8728 2536 ? S 09:45 0:00 dovecot-auth -w
dovecot 12052 0.0 0.4 3364 1528 ? S 09:46 0:00 pop3-login
postfix 9614 0.0 0.4 4908 1540 ? S 10:07 0:00 pickup -l -t fifo -u -c
postfix 15820 0.0 1.2 7860 3948 ? S 10:15 0:00 smtpd -n smtp -t inet -u
postfix 3265 0.0 0.5 4948 1680 ? S 10:17 0:00 qmgr -l -t fifo -u -c
www-data 20192 0.0 2.0 21352 6420 ? S 10:18 0:00 /usr/sbin/apache2 -k start
www-data 20205 0.0 2.1 21352 6576 ? S 10:18 0:00 /usr/sbin/apache2 -k start
root 20313 0.0 0.6 17240 2000 ? Ss 10:18 0:00 sshd: root@notty
root 20328 0.0 0.3 3252 1120 ? Ss 10:18 0:00 /usr/lib/sftp-server
root 24061 0.0 0.6 17072 1964 ? Ss 10:19 0:00 sshd: root@notty
root 24343 0.0 0.4 2636 1240 ? Ss 10:19 0:00 -bash
root 3192 0.0 0.6 17240 2016 ? Ss 10:24 0:00 sshd: root@pts/1
root 3253 0.0 0.4 2768 1508 pts/1 Ss 10:24 0:00 -bash
dovecot 22207 0.0 0.4 3364 1528 ? S 10:25 0:00 pop3-login
postfix 32464 0.0 0.7 7404 2456 ? S 10:28 0:00 trivial-rewrite -n rewrite -t unix -u -c
postfix 9467 0.0 1.2 7892 3936 ? S 10:33 0:00 smtpd -n smtp -t inet -u
dovecot 14287 0.0 0.4 3364 1528 ? S 10:35 0:00 pop3-login
root 3200 0.0 0.2 2272 912 pts/1 R+ 10:38 0:00 ps -aux



# tail /var/log/syslog -n100
Jun 23 10:40:27 vxxxx postfix/master[14113]: warning: process /usr/lib/postfix/pipe pid 13384 exit status 1
Jun 23 10:40:27 vxxxx postfix/master[14113]: warning: /usr/lib/postfix/pipe: bad command startup -- throttling

...

Jun 23 10:40:44 vxxxx postfix/smtpd[12282]: warning: connect #1 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:40:54 vxxxx postfix/smtpd[12282]: warning: connect #2 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:41:04 vxxxx postfix/smtpd[12282]: warning: connect #3 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:41:14 vxxxx postfix/smtpd[12282]: warning: connect #4 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:41:24 vxxxx postfix/smtpd[12282]: warning: connect #5 to subsystem public/cleanup: Cannot allocate memory

...

Jun 23 10:41:27 vxxxx postfix/pipe[30451]: fatal: inet_addr_local[socket]: socket: No buffer space available

...

Jun 23 10:41:28 vxxxx postfix/master[14113]: warning: process /usr/lib/postfix/pipe pid 30451 exit status 1
Jun 23 10:41:28 vxxxx postfix/master[14113]: warning: /usr/lib/postfix/pipe: bad command startup -- throttling
Jun 23 10:41:28 vxxxx postfix/smtpd[30464]: fatal: inet_addr_local[socket]: socket: No buffer space available

...

Jun 23 10:41:29 vxxxx postfix/master[14113]: warning: process /usr/lib/postfix/smtpd pid 30464 exit status 1
Jun 23 10:41:29 vxxxx postfix/master[14113]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

...

Jun 23 10:41:34 vxxxx postfix/smtpd[12282]: warning: connect #6 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:41:44 vxxxx postfix/smtpd[12282]: warning: connect #7 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:41:54 vxxxx postfix/smtpd[12282]: warning: connect #8 to subsystem public/cleanup: Cannot allocate memory
Jun 23 10:42:04 vxxxx postfix/smtpd[12282]: warning: connect #9 to subsystem public/cleanup: Cannot allocate memory



# netstat -lp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:pop3 *:* LISTEN -
tcp 0 0 *:imap2 *:* LISTEN -
tcp 0 0 *:www *:* LISTEN -
tcp 0 0 *:ftp *:* LISTEN -
tcp 0 0 *:ssh *:* LISTEN -
tcp 0 0 *:smtp *:* LISTEN -
tcp 0 0 *:imaps *:* LISTEN -
tcp 0 0 *:pop3s *:* LISTEN -
tcp 0 0 xxx.xxx.de:10024 *:* LISTEN -
tcp 0 0 xxx.xxx.de:10025 *:* LISTEN -
tcp 0 0 xxx.xxx.de:mysql *:* LISTEN -
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 3006317095 - /tmp/php.socket-0
unix 2 [ ACC ] STREAM LISTENING 3002802108 - /var/run/dovecot/dict-server
unix 2 [ ACC ] STREAM LISTENING 3002802891 - /var/run/dovecot/auth-worker.11764
unix 2 [ ACC ] STREAM LISTENING 3002803081 - /var/run/dovecot/auth-master
unix 2 [ ACC ] STREAM LISTENING 3002788623 - /var/run/mysqld/mysqld.sock
unix 2 [ ACC ] STREAM LISTENING 3002802883 - /var/run/dovecot/login/default
unix 2 [ ACC ] STREAM LISTENING 3003414814 - /var/run/clamav/clamd.ctl
unix 2 [ ACC ] STREAM LISTENING 3006673600 - private/tlsmgr
unix 2 [ ACC ] STREAM LISTENING 3006673626 - private/rewrite
unix 2 [ ACC ] STREAM LISTENING 3006673630 - private/bounce
unix 2 [ ACC ] STREAM LISTENING 3006673636 - private/defer
unix 2 [ ACC ] STREAM LISTENING 3006673640 - private/trace
unix 2 [ ACC ] STREAM LISTENING 3006673645 - private/verify
unix 2 [ ACC ] STREAM LISTENING 3006673649 - public/flush
unix 2 [ ACC ] STREAM LISTENING 3006673653 - private/proxymap
unix 2 [ ACC ] STREAM LISTENING 3002787207 - /var/run/amavis/amavisd.sock
unix 2 [ ACC ] STREAM LISTENING 3006673657 - private/smtp
unix 2 [ ACC ] STREAM LISTENING 3006673661 - private/relay
unix 2 [ ACC ] STREAM LISTENING 3006673665 - public/showq
unix 2 [ ACC ] STREAM LISTENING 3006673669 - private/error
unix 2 [ ACC ] STREAM LISTENING 3006673673 - private/local
unix 2 [ ACC ] STREAM LISTENING 3006673677 - private/virtual
unix 2 [ ACC ] STREAM LISTENING 3006673681 - private/lmtp
unix 2 [ ACC ] STREAM LISTENING 3006673685 - private/anvil
unix 2 [ ACC ] STREAM LISTENING 3006673689 - private/maildrop
unix 2 [ ACC ] STREAM LISTENING 3006673693 - private/uucp
unix 2 [ ACC ] STREAM LISTENING 3006673697 - private/ifmail
unix 2 [ ACC ] STREAM LISTENING 3006673701 - private/bsmtp
unix 2 [ ACC ] STREAM LISTENING 3006673705 - private/scalemail-backend
unix 2 [ ACC ] STREAM LISTENING 3006673709 - private/dovecot
unix 2 [ ACC ] STREAM LISTENING 3006673714 - private/smtp-amavis
unix 2 [ ACC ] STREAM LISTENING 3006673596 - public/cleanup
unix 2 [ ACC ] STREAM LISTENING 3002803070 - /var/spool/postfix/private/auth
unix 2 [ ACC ] STREAM LISTENING 3002800171 - /var/run/saslauthd/mux


Ich liefere gerne mehr Infos. Ich bedanke mich.

.matthias
23.06.08, 11:52
welche Möglichkeit habe ich, um den Socket- und RAM-Bedarf zu senken, und was sind die Ursachen?

Wo liegt ueberhaupt dein Problem? Performance?

cane
23.06.08, 12:14
Wo liegt ueberhaupt dein Problem? Performance?

Steht doch oben - lies den Post nochmal ;)

mfg
cane

problembehaftet
23.06.08, 14:04
Hallo, es stimmt schon, ich habe es nicht auf den Punkt gebracht..

Das Problem:
postfix und andere Prozesse stürzen ab / Fehlermeldungen sehen nicht gut aus

Meine Vermutung:
weil nicht genug RAM und sockets zur Verfügung stehen.

Die Fragen sind:
Stimmt meine Vermutung?
Welche Lösungen gibt es?
Wenn schlankere Konfiguration möglich - was sollte ich versuchen zu erreichen, welche Einstellungen muss ich bei den jeweiligen Diensten vornehmen?

.matthias
23.06.08, 15:15
Steht doch oben - lies den Post nochmal ;)

mfg
cane

Arg, ja, in der Flut von Logfiles hab ich den relevanten Teil uebersehen - sorry. Mein Fehler.
Aber wenigstens kann man dem TE hier keinen Vorwurf machen, zu sparsam mit Infos zu sein. ;)

problembehaftet
23.06.08, 15:19
Also ich habe erstmal die email Umleitung auf amavis abgeschaltet und ein paar Seiten und Stichworte gefunden:

Ein paar Einstellungen, aber nicht ganz aktuell:
http://www.huschi.net/17_137_de.html

Dafür hier u.A. ein paar Worte zu apache2:
http://2bits.com/articles/installing-a-dedicated-server-or-a-vps-with-ubuntu-server-804-lts-hardy-heron-drupal-6x.html

Eher generell:
http://blog.eukhost.com/webhosting/optimizing-vps-performance/

Anscheinend ist ein Mailserver auf einem VPS nicht die beste Idee - komisch, ist doch nur ein bisschen Text... :-(

honkstar
23.06.08, 17:15
Nur so als Info:

Auf meinem vserver älterer Bauart mit vergleichbaren Werten schaffe ich es auch nicht, Apache sauber ans Rennen zu kriegen. Der stürzt immer wegen zu wenig RAM ab.
Nebenbei laufen auf dem Server aber noch ein VPN, Mailserver sowie lighttpd.
Da gibt es dann keine Probleme...

cane
23.06.08, 17:54
Miete halt einen vernünftigen Server an oder upgrade den Vserver so das er mehr RAM zugewiesen bekommt.

mfg
cane

problembehaftet
23.06.08, 20:08
Hallo, das ist ja kein besonders produktiver Beitrag.

Ich habe apache2 deinstalliert und dafür wieder eine frühere lighttpd-installation aktiviert (update-rc.d lighttpd defaults ), ich glaube, es sieht schon besser aus (so auf den ersten Blick kann ich das nicht erkennen).

Zumindest hoffe ich, dass es erstmal keine Abstürze mehr gibt und der E-Mail Verkehr sichegestellt ist.


# vzfree
VPS Speichernutzung:
Momentan genutzt: 80 MB
Zugesichert: 110.34 MB
Maximal nutzbar: 331.02 MB


# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
xxxx: kmemsize 3091365 3109260 6173130 6790443 213
lockedpages 0 0 79 79 0
privvmpages 19746 19778 77037 84741 121
shmpages 1920 1920 25600 25600 0
dummy 0 0 0 0 0
numproc 36 36 164 164 0
physpages 5830 5830 0 2147483647 0
vmguarpages 0 0 28247 2147483647 0
oomguarpages 5830 5830 28247 2147483647 0
numtcpsock 15 15 164 164 0
numflock 5 5 262 288 0
numpty 1 1 16 16 0
numsiginfo 0 0 512 512 0
tcpsndbuf 145340 145340 1137635 1809379 0
tcprcvbuf 140152 140152 1137635 1809379 0
othersockbuf 207948 207948 568817 1240561 0
dgramrcvbuf 0 0 568817 568817 0
numothersock 124 124 164 164 5662
dcachesize 0 0 1209139 1245413 0
numfile 1677 1677 3840 3840 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
dummy 0 0 0 0 0
numiptent 14 14 35 35 0

problembehaftet
23.06.08, 20:59
Hier wird eine Alternative zu lighttpd beschrieben:
http://hostingfu.com/article/nginx-vs-lighttpd-for-a-small-vps

cane
23.06.08, 21:19
Hallo, das ist ja kein besonders produktiver Beitrag.


Wenn das ganze ein Hobbyserver ist kann man sicherlich auch halbgare Lösungen umsetzen, wenn der Emailverkehr oder die Verfügbarkeit der Website wichtig ist ist mein Lösungsweg der einzigst sinnvolle.

Optimierungen dienen nun mal fast immer nur dazu die Zeit bis zu vertikaler oder horizontaler Skalierung mit mehr hardware zu verlängern...

mfg
cane

marce
23.06.08, 21:32
Oftmals hilft es auch, aus der Konfig sämtlicher Dienste alles nichtbenötigte herauszuschmeißen. Gerade Apache, php und oftmals auch Mailserver sind in der default-Einstellung (per Paketmanagement installieren und starten) oftmals "rundum-glücklich-Lösungen" und mit Modulen vollgepackt, die man nicht braucht.

Alex_K
24.06.08, 08:27
Nach meiner Erfahrung kann man gerade bei MySQL sehr viel speicher sparen, wenn man nicht benötigte Features abschaltet.
Die gibt es 2 Artikel welche sich speziell mit der Speicher-Optimierung von Apache und MySQL beschäftigen:

http://emergent.urbanpug.com/?p=60
http://emergent.urbanpug.com/?p=61

marce
24.06.08, 08:30
wobei man bei MySql vorsichtig sein sollte - zu viel beschränken oder deaktivieren und dier Performance wird unterirdisch.

(Wobei man dann mit einem solch ausgestatteten Server meist eh' falsch bedient ist)

Alex_K
04.07.08, 20:45
Mal einen alten Thread aufwärmen ;)

Nachdem ich gerade dabei bin meinen vServer neu zu installieren, und gerade MySQL einrichte, ist mir dieser Thread wieder eingefallen.

Speicherverbrauch mit Default Debian my.cnf:

Momentan genutzt: 258,68 MB
Maximal genutzt: 258,68 MB
Zugesichert: 507,812 MB
Maximal nutzbar: 768 MB

Das selbe mit der Option skip-innodb:

Momentan genutzt: 184 MB
Maximal genutzt: 184,039 MB
Zugesichert: 507,812 MB
Maximal nutzbar: 768 MB

... und schon hat man 74MB gespart.

Wobei die skip-innodb bei einem vServer keine Nachteile bringen solle. Performance Probleme sollten nur auftreten wenn man sehr viele Schreibvorgänge in der DB hat. Was ich bei einem vServer aber für sehr unwahrscheinlich halte. Denn sollte der Server wirklich derart ausgelastet werden, entstehen Engstellen sowieso auch an anderen Orten (wie z.B. einem zumüllen mit Apache Prozessen).
Meiner Meinung ist diese Option bei vServern ein muss.

Roger Wilco
05.07.08, 10:06
Webspace 10 GB
Traffic pro Monat 300 GB
Arbeitsspeicher (RAM) 256 MB
Garantierte CPU-Leistung 100 %
VPSadmin info:
Speicherplatz enthalten 1.536 MB
Speicherplatz belegt 931 MB ( 61 % )
Das passt nicht wirklich. Ich würde mich mal an den Provider wenden, so dass er dir den zugesicherten Speicherplatz auch gibt.



#top
# ...
27756 www-data 18 0 14756 2580 2064 S 0 0.8 0:00.03 php4-cgi
29964 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29967 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29969 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
29970 www-data 18 0 14756 860 296 S 0 0.3 0:00.00 php4-cgi
Du benutzt PHP über die CGI-Schnittstelle. An deiner Stelle würde ich entweder mod_php nutzen oder PHP über FastCGI einbinden und die PHP-Prozesse dynamisch je nach Auslastung forken lassen.


Wobei die skip-innodb bei einem vServer keine Nachteile bringen solle.
...außer man will die InnoDB-Engine benutzen, z. B. wegen Transaktionen, Referentieller Integrität, Stored Procedures, ... MyISAM ist ja eher eine Spielzeug-Engine.

Alex_K
05.07.08, 19:11
...außer man will die InnoDB-Engine benutzen, z. B. wegen Transaktionen, Referentieller Integrität, Stored Procedures, ... MyISAM ist ja eher eine Spielzeug-Engine.

Natürlich, darum sage ich ja auch "bei vServern ein muss".
Ein vServer is ja auch eher ein Spielzeugserver. Die von dir Aufgezählten Features sollten würde die wenigsten PHP-Skripte essentiell sein, und das ist wohl der Hauptanwendungszweck von vServern.

unsen
07.01.09, 21:00
hallo.. endlich ein informativer und verständlicher thread zur Thematik VServer und Speicher!

ich habe mittlerweile auch die anzahl der Apache Spare-Server auf meinem VServer mit 128M :o garantiertem RAM reduziert - mit erfolg! keine fehler mehr, in der art: "fork: could not allocate memory" etc.. das hat auch eine sichtbare verbesserung in kmemsize:held gebracht. der wert ist jetzt deutlich unter dem barrier-wert.

/etc/apache2/apache2.config:

<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 1
MaxSpareServers 1
MaxClients 10
MaxRequestsPerChild 50
</IfModule>

die option "skip-innodb" in der my.cnf hat eher für den Speicher allgemein was gebracht. in der kmemsize:held war eher keine signifikante änderung zu sehen.



ein problem zu kmemsize Speicher und Prozessen i.a. habe ich noch:

kann ich in erfahrung bringen, wieviel Kernel-Speicher ein Prozess tatsächlich belegt?
meistens heisst es ja, ein Prozess belegt im duchschnitt 60kb - einige Prozesse aber um ein vielfaches mehr....
in wie hängen die ausgabewerte von "ps aux" zum Beispiel mit dem verwendeten (Kernel-) speicher zusammen? ich kann da zwar einiges zusammenaddieren - komm aber auf ergebnisse, die allesamt widersprüchlich sind..


# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
55196002: kmemsize 2566832 2578887 4608000 5068800 1886
lockedpages 0 0 128 128 0
privvmpages 14920 14959 65536 72090 0

kmemsize ist doch in bytes angegeben,soweit ich weiss. eine barrier-wert von 4608000 heisst doch dann, dass ich ca. 4.5 MB kernelspeicher zur verfügung habe?
(igg zu *pages, die die anzahl von 4kb pages angeben.. also x*4kb)


ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 1872 664 ? Ss Jan06 0:02 init [2]
www-data 3306 0.0 1.4 19204 3828 ? S 18:41 0:00 /usr/sbin/apache2 -k start
postfix 3994 0.0 0.7 4804 1992 ? S Jan06 0:00 tlsmgr -l -t unix -u -c
postfix 11438 0.0 0.5 4752 1556 ? S 17:41 0:00 pickup -l -t fifo -u -c
root 12191 0.0 0.3 3356 992 pts/0 R+ 19:10 0:00 ps aux
root 16338 0.0 0.2 1564 568 ? Ss Jan06 0:00 /sbin/syslogd
root 17579 0.0 0.6 4740 1612 ? Ss Jan06 0:00 /usr/lib/postfix/master
postfix 17589 0.0 0.6 4788 1596 ? S Jan06 0:00 qmgr -l -t fifo -u
root 17595 0.0 0.4 4860 1100 ? Ss Jan06 0:00 /usr/sbin/sshd
root 17610 0.0 0.3 2136 888 ? Ss Jan06 0:00 /usr/sbin/cron
root 19830 0.0 2.4 19204 6328 ? Ss 15:09 0:00 /usr/sbin/apache2 -k start
www-data 22439 0.0 2.6 20680 7008 ? S 18:15 0:00 /usr/sbin/apache2 -k start
root 26328 0.0 0.4 3596 1296 ? S Jan06 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 26370 0.0 3.2 44208 8496 ? Sl Jan06 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-
root 26371 0.0 0.2 2668 568 ? S Jan06 0:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
root 30244 0.0 0.9 7800 2400 ? Rs 14:26 0:00 sshd: root@pts/0
root 30263 0.0 0.6 3924 1736 pts/0 Ss 14:27 0:00 -bash


in der spalte RSS, was soweit ich weiss der belegte physikalische Speicher in #Pages ist, wenn ich alles zusammenzähle komm ich auf 42k *4kb macht alleine 166Mb belegter physikalischer Speicher..

top sagt mir aber nur ca 60MB used.. wo mach ich da nen fehler??

Tasks: 17 total, 1 running, 16 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 262144k total, 60056k used, 202088k free, 0k buffers


der wert VSZ - wieder in kb?? - oder bei ps -Al der wert SZ - hier aber wieder aufgerundet und in Pages (herrgott - da wirst langsam aber sowas von deppert...)
also der VSZ von ps aux: Summe 150MB!? kommt auch nicht hin.. ist sogar weniger wie der genutzte physikalische Speicher..??
VSZ heisst ja "virtueller Prozesspeicher" ist VSZ+RSS dann der gesamte belegte Speicher - also das was dann bei ps aux unter MEM steht? (nur da dann wieder in % !!? - wer hat sich das ausgedacht!?!)

ein trost, dass sich die 60MB used von top wenigstens ungefähr mit privvmpages:held von beancounters decken.

kann mir da jemand helfen, dieses chaos zu entwirren und mir noch sagen, wie ich an den belegten Kernelspeicher eines Prozesses komme? (steht ja alles so klar und deutlich in den man-pages ;) )