apache stürzt immer ab

Apache, Lighttpd, nginx, Cherokee
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

apache stürzt immer ab

Post by conym18 »

Hallo zusammen,

Ich habe bei vserver.de einen vServer, welcher immer aller paar 2 Tage abstürzt.
Dann muß ich den Server rebooten und dann geht es wieder für 2 Tage.

In der error_log ist folgendes zu erkennen:

Code: Select all

[Tue Sep 16 10:09:54 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:09:58 2008] [error] (12)Cannot allocate memory: apr_poll: (listen)
[Tue Sep 16 10:10:03 2008] [error] (12)Cannot allocate memory: apr_accept: (client socket)
[Tue Sep 16 10:10:04 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:12:34 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:13:30 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:13:40 2008] [error] (12)Cannot allocate memory: apr_accept: (client socket)
[Tue Sep 16 10:14:16 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:14:54 2008] [error] (12)Cannot allocate memory: fork: Unable to fork new process
[Tue Sep 16 10:15:04 2008] [error] (12)Cannot allocate memory: apr_accept: (client socket)
[Tue Sep 16 10:15:19 2008] [error] [client 91.17.141.78] File does not exist: /srv/www/web8/html/favicon.ico
[Tue Sep 16 10:15:44 2008] [warn] child process 1533 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 23980 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 28616 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 20354 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 21859 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 15389 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 19515 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 15393 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 15395 still did not exit, sending a SIGTERM
[Tue Sep 16 10:15:44 2008] [warn] child process 3420 still did not exit, sending a SIGTERM

die server_tuning.conf sieht folgendermaßen aus:

Code: Select all

<IfModule prefork.c>
        # number of server processes to start = 1
        StartServers            1
        # minimum number of server processes which are kept spare = 1
        MinSpareServers         1
        # maximum number of server processes which are kept spare = 2
        MaxSpareServers         2
        # highest possible MaxClients setting for the lifetime of the Apache process. = 25
        ServerLimit            25
        # maximum number of server processes allowed to start = 25
        MaxClients             25
        # maximum number of requests a server process serves = 1000
        MaxRequestsPerChild  1000
</IfModule>

# worker MPM
<IfModule worker.c>
        # initial number of server processes to start = 1
        StartServers            1
        # minimum number of worker threads which are kept spare = 10
        MinSpareThreads        10
        # maximum number of worker threads which are kept spare = 20
        MaxSpareThreads        20
        # maximum number of simultaneous client connections = 15
        MaxClients             15
        # constant number of worker threads in each server process = 15
        ThreadsPerChild        15
        # maximum number of requests a server process serves = 1000
        MaxRequestsPerChild  1000
</IfModule>

# leader MPM
<IfModule leader.c>
        # initial number of server processes to start = 1
        StartServers            1
        # minimum number of worker threads which are kept spare =10
        MinSpareThreads        10
        # maximum number of worker threads which are kept spare = 20
        MaxSpareThreads        20
        # maximum number of simultaneous client connections = 15
        MaxClients             15
        # constant number of worker threads in each server process = 15
        ThreadsPerChild        15
        # maximum number of requests a server process serves = 1000
        MaxRequestsPerChild  1000
</IfModule>

# perchild MPM
<IfModule perchild.c>
        # constant number of server processes =1
        NumServers              1
        # initial number of worker threads in each server process = 1
        StartThreads            1
        # minimum number of worker threads which are kept spare = 10
        MinSpareThreads        10
        # maximum number of worker threads which are kept spare = 20
        MaxSpareThreads        20
        # maximum number of worker threads in each server process = 10
        MaxThreadsPerChild     10
        # maximum number of connections per server process = 1000
        MaxRequestsPerChild  1000

        AcceptMutex fcntl
</IfModule>

# metux MPM
<IfModule metuxmpm.c>
        # initial number of worker threads in each server process = 1
        StartThreads            1
        # minimum number of worker threads which are kept spare = 10
        MinSpareThreads        10
        # maximum number of worker threads which are kept spare = 20
        MaxSpareThreads        20
        # maximum number of connections per server process
        MaxRequestsPerChild  1000

        Multiplexer     "wwwrun"        "www"

</IfModule>

KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
mir ist noch aufgefallen, dass wenn ich TOP ausführe, der mysqld immer ganz gut im CPU verbrauch ist:
er liegt so zw. 0-50 %

hier die my.cnf:

Code: Select all

port            = 3306
socket          = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
# 16M
key_buffer = 8M
max_allowed_packet = 1M
table_cache = 64
#512
sort_buffer_size = 256K
net_buffer_length = 8K
#256
read_buffer_size = 128K
# 512
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
# log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
skip-innodb

# The safe_mysqld script
[safe_mysqld]
err-log=/var/lib/mysql/mysqld.log

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Auf dem Server läuft ein Community Portal mit PHP, mysql und sendmail.
Am Tag weden ca. 600 Emails verschickt.

Kann mir einer einen Tipp bzw. eine Lösung geben?

Vielen Dank.

Achso, kann mir auch einer sagen, wieviele user gleichzeitig auf den Server zugriefen können und ob es für einen vServer so ok ist?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11183
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: apache stürzt immer ab

Post by Joe User »

Dein vserver hat zu wenig RAM.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

Nachtrag.
Da ich auf einer Anderen Seite Werbung für meine Seite einblende, kommen noch Banneraufrufe dazu.
Das sind Pro Minute ca. 40 Stück.

Das Script sieht wie folgt aus:

Code: Select all

<?
header("Content-type: image/gif");
@include("inc.connect.php");

$from = explode(".",$HTTP_REFERER);
$fromwo = $from['1'];
$ask_inhalte = mysql_query("SELECT * FROM bannerroation WHERE (referral='".$fromwo."' AND was='".$u."')");
$res_inhalte = mysql_num_rows($ask_inhalte);

if($res_inhalte == 0)
{
    $sqlQuerythis = @mysql_query("INSERT INTO bannerroation (id,referral,was) VALUES('','".$fromwo."','".$u."')");
}
else
{
	$update = @mysql_query("UPDATE bannerroation SET klicks=klicks+1 WHERE referral='".$fromwo."' AND was='".$u."'");
}

if($u == "mann")
{
	$pfad = "http://www.domain.de/shared/img/ad/extern/mann/";
	$random = rand(11,18); //1,17 - 11

	$bannerthis = "".$random.".gif";
	$fullpath = "".$pfad."".$bannerthis."";
	@readfile($fullpath);

}
elseif($u == "frau")
{
	$pfad = "http://www.domain.de/shared/img/ad/extern/frau/";
	$random = rand(11,33); //1,26

	$bannerthis = "".$random.".gif";
	$fullpath = "".$pfad."".$bannerthis."";
	@readfile($fullpath);

}

?>
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

Joe User wrote:Dein vserver hat zu wenig RAM.

Danke schonmal.
Wie kann ich nun aber das beste aus dem Server rausholen?

Ist ein Root Server bei ein Paar Anfragen wirklich gut?
Ich hatte gestern lt. google analytics folgende zugriffe (plus die Bannereinblendungen, siehe oben)

287 Besuche
1.314 Seitenzugriffe
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

ich habe mal nach einem reboot cat meminfo ausgegeben:

Code: Select all

MemTotal:       524288 kB
MemFree:        397188 kB
Buffers:             0 kB
Cached:              0 kB
SwapCached:          0 kB
Active:              0 kB
Inactive:            0 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       524288 kB
LowFree:        397188 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:               0 kB
Writeback:           0 kB
Mapped:              0 kB
Slab:                0 kB
CommitLimit:         0 kB
Committed_AS:        0 kB
PageTables:          0 kB
VmallocTotal:        0 kB
VmallocUsed:         0 kB
VmallocChunk:        0 kB
hier sind doch noch 397 MB RAM frei und das sollte doch eigentlich ausreichen, oder?
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

es läuft confix und mysql.

es muß aber von meinem community portal kommen.
was meinst du mit, "was es sonst noch alles gibt"?

ich habe keine zusätzliche programme wie chatserver etc. installiert.


vielleicht noch was:
die user können bei mir auf der seite bilder hochladen, welche ich dann bestätigen muß.
da die bilder mitunter bis 5 MB gehen, werden diese durch ein PHP script konvertiert, sprich in eine standardgröße (höhe x breite) umgewandelt.
dies geschiet immer dynamisch.

gibt es evtl. noch einen PHP buffer, den ich ändern sollte oder allgemein alle X minuten leeren sollte?
flip89
Posts: 10
Joined: 2008-09-08 11:26
 

Re: apache stürzt immer ab

Post by flip89 »

werden diese durch ein PHP script konvertiert, sprich in eine standardgröße (höhe x breite) umgewandelt.
Was ja bei vielen Bildern durchaus lastintensiv sein kann.

Versuch doch mal den Bilderdienst irgendwohin auszulagern...weg vom Hauptserver.
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: apache stürzt immer ab

Post by daemotron »

Der Übeltäter ist Dein Apache. Du verwendest mpm_prefork, und hast wahrscheinlich viel zu viele überflüssige Module eingebunden, was die einzelnen Prozesse fett macht. Deine server-tuning.conf ist suboptimal (MaxRequestsPerChild ist viel zu niedrig, mach da mal 10.000 draus). Unter'm Strich bleibt folgendes zu sagen: Früher hatten Rootserver weniger RAM als Dein VServer (256MB waren üblich), und auch auf denen funktionierte LAMP. Entschlacke Deinen Apache (und damit auch mod_php!), begrenze die Anzahl maximal zu forkender Prozesse (oder besser steig auf mpm_worker um) oder migriere gleich zu einem Webserver, der weniger Ressourcen frisst (Lighttpd, Cherokee).
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

hab den request jetzt auf 10000 gesetzt.

jetzt vielleicht eine dumme frage von mir.
warum soll ich mod_php ausschalten?

ist dann mein php nicht weg?

sorry !!!! :)


was meinst du mit "begrenze die Anzahl maximal zu forkender Prozesse ". kannst du mir das erklären?
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: apache stürzt immer ab

Post by daemotron »

Du sollst mod_php nicht ausschalten, sondern entschlacken. Also alle nicht benötigten Module rauswerfen, weil die Deine Apache-Prozesse unnötig weiter aufblähen.
conym18 wrote:was meinst du mit "begrenze die Anzahl maximal zu forkender Prozesse ". kannst du mir das erklären?
Begrenze MaxCients auf 10 - bei Deinen Zugriffszahlen sollten sogar 5 genügen, so hast Du ein bisschen Reserve.
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

danke dir.

hab ich das prinzip nicht verstanden von MaxCients?

ich dachte ich muß ihn hoch einstellen.

was passiert aber, wenn ich jetzt sprunghaft mehr user mit einmal bekomme?
sollte dann nicht die maxclients wieder hoch?
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

wo kann ich das file finden, wo die module eingebunden sind?

ich hab einmal

/etc/sysconfig/apache2

Code: Select all

APACHE_MODULES="access actions alias auth auth_dbm autoindex cgi dir env expires include log_config mime negotiation setenvif ssl suexec userdir php4 php5 rewrite"

und dann noch /etc/apache2/sysconfig.d/loadmodule.conf

Code: Select all

#
# Files in this directory are created at apache start time by /usr/sbin/rcapache2.
# Do not edit them!
#

# as listed in APACHE_MODULES (/etc/sysconfig/apache2)

LoadModule access_module                  /usr/lib/apache2-prefork/mod_access.so
LoadModule actions_module                 /usr/lib/apache2-prefork/mod_actions.so
LoadModule alias_module                   /usr/lib/apache2-prefork/mod_alias.so
LoadModule auth_module                    /usr/lib/apache2-prefork/mod_auth.so
LoadModule auth_dbm_module                /usr/lib/apache2-prefork/mod_auth_dbm.so
LoadModule autoindex_module               /usr/lib/apache2-prefork/mod_autoindex.so
LoadModule cgi_module                     /usr/lib/apache2-prefork/mod_cgi.so
LoadModule dir_module                     /usr/lib/apache2-prefork/mod_dir.so
LoadModule env_module                     /usr/lib/apache2-prefork/mod_env.so
LoadModule expires_module                 /usr/lib/apache2-prefork/mod_expires.so
LoadModule include_module                 /usr/lib/apache2-prefork/mod_include.so
LoadModule log_config_module              /usr/lib/apache2-prefork/mod_log_config.so
LoadModule mime_module                    /usr/lib/apache2-prefork/mod_mime.so
LoadModule negotiation_module             /usr/lib/apache2-prefork/mod_negotiation.so
LoadModule setenvif_module                /usr/lib/apache2-prefork/mod_setenvif.so
LoadModule ssl_module                     /usr/lib/apache2-prefork/mod_ssl.so
LoadModule suexec_module                  /usr/lib/apache2-prefork/mod_suexec.so
LoadModule userdir_module                 /usr/lib/apache2-prefork/mod_userdir.so
LoadModule php4_module                    /usr/lib/apache2-prefork/libphp4.so
LoadModule rewrite_module                 /usr/lib/apache2-prefork/mod_rewrite.so

Was deiner meinung nach soll ich rauskommentieren bzw. welche von den zwei konfigs soll ich ändern?
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: apache stürzt immer ab

Post by Roger Wilco »

Die /etc/apache2/sysconfig.d/loadmodule.conf lässt du in Ruhe, da diese automatisch aus der /etc/sysconfig/apache2 generiert wird.

An Modulen kannst du im Prinzip alles rauswerfen, was du nicht explizit benötigst, z. B. mod_userdir, mod_suexec, mod_cgi usw.
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: apache stürzt immer ab

Post by daemotron »

Schau Dir bitte mal die Erklärung von MaxClients an:

Code: Select all

# maximum number of server processes allowed to start
Jetzt schau mal nach, wie groß die Resident Set Size (RSS, permanente "echte" RAM-Belegung) Deiner Apache-Prozesse ist (ps aux hilft da weiter). Und jetzt multipliziere diese RSS (ich schätze mal mit mod_php irgendwas um die 60+ MB) mit MaxClients - das ist der RAM, den Apache im Zweifel für sich alleine beansprucht. Vergleiche diese Zahl einmal mit dem tatsächlich verfügbaren Arbeitsspeicher und sage uns, wie viel jetzt noch für MySQL und die anderen Dienste übrig bleibt.

Bei der mageren RAM-Ausstattung kannst Du nur eines tun - die maximale Anzahl an Apache-Prozessen im Zaum halten, die RSS pro Prozess so weit wie möglich drücken und in Spitzenzeiten eben in Kauf nehmen, dass die Auslieferung von Seiten mal etwas länger dauert (aber nicht ganz zusammenbricht). Dafür erkaufst Du Dir einen stabilen Betriebszustand und sorgst dafür, dass Arbeitsspeicher, der eigentlich von MySQL für diverse Caches benötigt wird, nicht auf die Swap-Partition ausgelagert wird.
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

Code: Select all

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0    604   248 ?        Ss   19:36   0:00 init [3]
root     26520  0.0  0.1   1456   612 ?        Ss   19:36   0:00 /sbin/syslogd -a /var/lib/named/dev/log -a /var/lib/ntp/dev/log
root     26524  0.0  0.0   1396   372 ?        Ss   19:36   0:00 /sbin/klogd -c 1 -x -x
root     26537  0.0  0.1   3984   784 ?        Ss   19:36   0:00 /usr/sbin/saslauthd -a pam -n 1
root     26560  0.0  0.2   2376  1132 ?        S    19:36   0:00 /bin/sh /usr/bin/mysqld_safe --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --socket=/var/
mysql    26620  7.5  1.2  21284  6516 ?        Sl   19:36   1:29 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mys
root     27710  0.0  0.2   4524  1220 ?        Ss   19:36   0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
root     27723  0.0  0.1   2076   876 ?        Ss   19:36   0:00 /usr/sbin/xinetd
root     28086  0.0  0.2   4308  1508 ?        Ss   19:36   0:00 /usr/lib/postfix/master
postfix  28103  0.0  0.2   4352  1480 ?        S    19:36   0:00 pickup -l -t fifo -u
postfix  28109  0.0  0.3   4388  1588 ?        S    19:36   0:00 qmgr -l -t fifo -u
postfix  28119  0.0  0.3   4492  1888 ?        S    19:36   0:00 trivial-rewrite -n rewrite -t unix -u
postfix  28139  0.0  0.2   4352  1548 ?        S    19:36   0:00 tlsmgr -l -t unix -u
root     28242  0.1  1.5  23060  8360 ?        Ss   19:36   0:01 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root     28243  0.0  0.2   3200  1452 ?        S    19:36   0:00 /usr/bin/perl /usr/local/confixx/pipelog.pl
vscan    28436  0.4  4.4  25280 23072 ?        S    19:36   0:05 /usr/sbin/clamd
root     28461  0.0  0.1   1668   696 ?        Ss   19:36   0:00 /usr/sbin/cron
vscan    28482  0.0  0.2   3764  1284 ?        Ss   19:36   0:00 /usr/bin/freshclam -d
postfix  28582  0.0  0.5   5160  2980 ?        S    19:36   0:00 smtpd -n smtp -t inet -u -o content_filter smtp:[127.0.0.1]:10024
postfix  28599  0.0  0.2   4348  1476 ?        S    19:36   0:00 anvil -l -t unix -u
vscan    31754  0.0  6.4  38032 33968 ?        Ss   19:36   0:00 amavisd (master)
vscan    32103  0.0  6.1  38032 32352 ?        S    19:36   0:00 amavisd (virgin child)
root      7186  0.0  0.4   7732  2480 ?        Rs   19:37   0:00 sshd: root@pts/0
root     12052  0.0  0.3   2844  1816 pts/0    Ss   19:37   0:00 -bash
postfix  27911  0.0  0.5   5160  3028 ?        S    19:46   0:00 smtpd -n smtp -t inet -u -o content_filter smtp:[127.0.0.1]:10024
wwwrun    3445  0.2  1.8  25764  9856 ?        S    19:51   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   14193  0.1  1.8  25652  9620 ?        S    19:52   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   19828  0.0  1.3  23348  7316 ?        S    19:52   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
postfix  26295  0.0  0.3   4532  1944 ?        S    19:53   0:00 cleanup -z -t unix -u
postfix  26300  0.0  0.3   4460  2088 ?        S    19:53   0:00 smtp -t unix -u
wwwrun   30426  0.0  1.3  23216  7016 ?        S    19:53   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   31832  0.0  1.3  23216  6948 ?        S    19:53   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun    3122  0.5  1.9  25888 10028 ?        S    19:54   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
postfix  10174  0.0  0.3   4460  2080 ?        S    19:54   0:00 smtp -t unix -u
postfix  15720  0.0  0.3   4412  1844 ?        S    19:55   0:00 local -t unix
wwwrun   24563  0.2  1.3  23224  7056 ?        S    19:55   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   24564  2.2  1.6  24212  8440 ?        S    19:55   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   28090  5.2  1.8  25664  9576 ?        R    19:55   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun   28308  1.0  1.3  23324  7116 ?        S    19:56   0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
root     28446  0.0  0.1   2380   856 pts/0    R+   19:56   0:00 ps aux

wie soll ich nun anpassen?
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

Also ich komme auf 98896 KB? also ca. 97 MB

lt. top hab ich noch über 390 frei.

also sollte es doch stimmen.
ich weiß nicht weiter.
Roger Wilco
Posts: 5923
Joined: 2004-05-23 12:53
 

Re: apache stürzt immer ab

Post by Roger Wilco »

conym18 wrote:lt. top hab ich noch über 390 frei.
Und was steht in /proc/user_beancounters?
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

Code: Select all

       uid  resource                     held              maxheld              barrier                limit              failcnt
    XXXXX: kmemsize                  4913074              8320712              8467453              9314198                    0
            lockedpages                     0                    5                  344                  344                    0
            privvmpages                 35631                47315               131072               139264                    0
            shmpages                      642                  658                19567                19567                    0
            dummy                           0                    0                    0                    0                    0
            numproc                        37                   73                  128                  128                    0
            physpages                   25790                29029                    0  9223372036854775807                    0
            vmguarpages                     0                    0                65536  9223372036854775807                    0
            oomguarpages                25790                29029                65536  9223372036854775807                    0
            numtcpsock                     35                  169                  172                  172                    0
            numflock                        7                   24                  224                  246                    0
            numpty                          1                    2                   16                   16                    0
            numsiginfo                      0                   12                  512                  512                    0
            tcpsndbuf                  253152               537912              1416560              2768240                    0
            tcprcvbuf                  217864              1014776              1416560              2768240                    0
            othersockbuf               200776               464392               655717              1153621                    0
            dgramrcvbuf                     0                26400               655717               655717                    0
            numothersock                  126                  200                  228                  228                    0
            dcachesize                 968031              1082916              1503190              1548286                    0
            numfile                      2022                 2925                 3008                 3008                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      27                   27                   64                   64                    0
ich hoffe, man kann es erkennen.
(hatte den server grad neu gestartet)
User avatar
daemotron
Administrator
Administrator
Posts: 2641
Joined: 2004-01-21 17:44
 

Re: apache stürzt immer ab

Post by daemotron »

OK, jetzt wird das Bild etwas runder. Allein Dein amavisd-new + clamav ziehen schon mal locker gute 100 MB weg. Dein Apache nach dem Neustart auch ca. 100 MB (bei 10 laufenden Prozessen). Schau Dir dasselbe Bild noch mal an, wenn der Server unter Dampf steht - dann wächst die RSS der Apache-Prozesse in Richtung der VSZ, und die Anzahl der Apache-Prozesse nimmt zu, bis MaxClients erreicht ist. Das wären dann ~20MB x 25 Prozesse = 500MB (bei Deiner alten Einstellung). Auch amavisd-new kann weitere Child-Prozesse forken, wenn viele Mails in die Queue laufen, wovon jeder mit gut 30 MB zu Buche schlägt. Irgendwann schlägt eben die Limitierung zu und Du kannst keine weiteren Prozesse forken.

Um es kurz zu machen: Dein vServer ist überfordert mit Apache + MySQL + Postfix + amavisd-new + ClamAV. Mit Tuning und Fingerspitzengefühl bekommst Du vielleicht Deine Webanwendung einigermaßen performant und stabil ans laufen (den Flaschenhals MySQL müsste man sich ebenfalls mal ansehen, bei einer VSZ von ca. 20 MB scheinen die Caches sehr sparsam ausgelegt) - Luft für die anderen Ressourcenkiller bleibt dann aber nicht.
conym18
Posts: 137
Joined: 2003-01-21 12:41
 

Re: apache stürzt immer ab

Post by conym18 »

vielen dank.

wie kann ich mysql noch weiter optimieren?


kann ich amavisd-new + ClamAV irgendwie abschalten?

sind das beides viren checker oder auch spam?
ist es sinnvoll diese drauf zu haben?
User avatar
Joe User
Project Manager
Project Manager
Posts: 11183
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: apache stürzt immer ab

Post by Joe User »

conym18 wrote:wie kann ich mysql noch weiter optimieren?
Doku lesen und umsetzen...
conym18 wrote:kann ich amavisd-new + ClamAV irgendwie abschalten?
Ja, steht ebenfalls in den jeweiligen Dokus...
conym18 wrote:sind das beides viren checker oder auch spam?
Bist Du root? Kennst Du Google?
conym18 wrote:ist es sinnvoll diese drauf zu haben?
Nein.

BTW: Nach fünf Jahren RootForum solltest Du wissen, dass hier Eigeninitiative vorausgesetzt wird.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.