очень большое кол-во процессов Apache2 (сервак уходит в дайун...)

Kubuntu, Xubuntu и другие

Модератор: Модераторы разделов

CasperKZ
Сообщения: 2

очень большое кол-во процессов Apache2

Сообщение CasperKZ »

Стоит Ubuntu
Apache2 + php + mysql + perl
После старта Апача если сделать:
ps -ax | grep apache2

Показывает очень много процессов, посетителей на сайте не много макс. 100
Конфиг апача:

Код:

ServerRoot "/etc/apache2" #<IfModule !mpm_winnt.c> #<IfModule !mpm_netware.c> LockFile /var/lock/apache2/accept.lock #</IfModule> #</IfModule> PidFile ${APACHE_PID_FILE} Timeout 300 KeepAlive On MaxKeepAliveRequests 200 KeepAliveTimeout 15 ServerLimit 1024 <IfModule mpm_prefork_module> StartServers 15 MinSpareServers 15 MaxSpareServers 20 MaxClients 1024 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_worker_module> StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <IfModule mpm_event_module> StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> # These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} AccessFileName .htaccess <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> DefaultType text/plain HostnameLookups Off # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog /var/log/apache2/error.log # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn # Include module configuration: Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf Include /etc/apache2/httpd.conf Include /etc/apache2/ports.conf LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined Include /etc/apache2/conf.d/ Include /etc/apache2/sites-enabled/ ServerName 127.0.0.1


Apache собрат на mpm_prefork_module

top показывает:

Код: Выделить всё

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
18940 nick      20   0  3000 1816  884 R    2  0.1   0:00.26 top
   33 root      15  -5     0    0    0 S    0  0.0   2:41.20 kswapd0
17325 www-data  20   0 35504 8184 3072 S    0  0.3   0:00.28 apache2
17377 www-data  20   0 35504 7856 3044 S    0  0.3   0:00.01 apache2
17380 www-data  20   0 37552 9840 3032 S    0  0.3   0:01.58 apache2
17383 www-data  20   0 35504 8604 3172 S    0  0.3   0:00.56 apache2
17414 www-data  20   0 36528 8936 3032 S    0  0.3   0:00.95 apache2
17423 www-data  20   0 36528 8908 3072 S    0  0.3   0:00.88 apache2
17479 www-data  20   0 35504 8188 3084 S    0  0.3   0:00.30 apache2
17484 www-data  20   0 36528 9988 3344 S    0  0.3   0:01.55 apache2
17814 www-data  20   0 35504 8164 3248 S    0  0.3   0:00.20 apache2
18193 www-data  20   0 36528 9008 3196 S    0  0.3   0:00.89 apache2
18551 www-data  20   0 35504 8756 3232 S    0  0.3   0:00.33 apache2
    1 root      20   0  2532  676  440 S    0  0.0   0:00.90 init
    2 root      15  -5     0    0    0 S    0  0.0   0:00.00 kthreadd
    3 root      RT  -5     0    0    0 S    0  0.0   0:00.00 migration/0
    4 root      15  -5     0    0    0 S    0  0.0   0:00.04 ksoftirqd/0


Кусок лога, когда апачь повис:

Код:

[Wed Feb 17 23:39:13 2010] [error] could not make child process 16801 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16632 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16633 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16802 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16803 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16636 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16678 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16804 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16827 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16681 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16828 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16856 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16830 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16843 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16686 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16857 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16688 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16833 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16690 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16834 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16693 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16838 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16839 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16696 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16697 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16698 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16840 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16846 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16842 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16702 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16847 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16989 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16849 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16850 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16851 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16858 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16861 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17094 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16863 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16892 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16865 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16866 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16867 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16868 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16869 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16870 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16871 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16872 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16873 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16874 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16875 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16904 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16877 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16990 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16941 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16991 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16882 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16883 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16884 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16992 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16905 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16887 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16906 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16889 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16893 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16894 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16993 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16896 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16994 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17059 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16942 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16911 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17074 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16913 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16914 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16916 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16917 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16918 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16961 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16944 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16921 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16945 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16923 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16997 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16925 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16926 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16927 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16929 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16930 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16931 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16932 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16933 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16934 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16998 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16947 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16938 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16948 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16949 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16950 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17075 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16999 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16953 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16954 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17000 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16956 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17019 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16963 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17020 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16965 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16966 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16967 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16968 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17002 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16983 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17055 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16972 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16973 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16974 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16975 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16976 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17003 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16978 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16979 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16980 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16981 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16984 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 16985 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17022 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17011 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17012 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17015 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17023 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17017 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17061 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17028 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17032 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17091 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17034 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17053 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17036 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17037 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17038 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17039 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17041 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17042 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17043 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17044 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17046 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17047 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17048 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17049 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17051 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17064 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17066 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17101 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17070 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17071 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [error] could not make child process 17077 exit, attempting to continue anyway [Wed Feb 17 23:39:13 2010] [notice] caught SIGTERM, shutting down [Wed Feb 17 23:39:19 2010] [notice] Apache/2.2.12 (Ubuntu) PHP/5.2.10-2ubuntu6.4 with Suhosin-Patch mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations [Thu Feb 18 00:01:19 2010] [error] server reached MaxClients setting, consider raising the MaxClients setting


читал много про это, но чё-то не помогло... на серваке стоит файловый обменник
Спасибо сказали:
Аватара пользователя
broom
Бывший модератор
Сообщения: 1629
Статус: мизантроп.ка
ОС: Gentoo

Re: очень большое кол-во процессов Apache2

Сообщение broom »

Код: Выделить всё

ServerLimit - Upper limit on configurable number of processes

Код: Выделить всё

ServerLimit 1024

Поставьте поменьше. Например, 10.
but in the darkness, behind your smile, you scream... © Dio
Спасибо сказали:
neol
Сообщения: 600
ОС: Debian Stable

Re: очень большое кол-во процессов Apache2

Сообщение neol »

Мне кажется вам пора почитать про защиту от DDoS. Посмотрите server-status или логи, думаю там очень много подключений к /

broom писал(а):
17.02.2010 21:12

Код: Выделить всё

ServerLimit - Upper limit on configurable number of processes

Код: Выделить всё

ServerLimit 1024

Поставьте поменьше. Например, 10.

Прочитайте описание директивы полностью, а не только первую строчку.
Спасибо сказали:
CasperKZ
Сообщения: 2

Re: очень большое кол-во процессов Apache2

Сообщение CasperKZ »

broom писал(а):
17.02.2010 21:12

Код: Выделить всё

ServerLimit - Upper limit on configurable number of processes

Код: Выделить всё

ServerLimit 1024

Поставьте поменьше. Например, 10.

раньше стаяло 150 по умолчанию, и сервак всё равно вис...
Если эти данные кому-нить помогут в решении моей проблемы:

ps auxw |grep www-data |wc -l
177


ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 20
file size (blocks, -f) unlimited
pending signals (-i) 16382
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


top
top - 06:58:13 up 1 day, 11:06, 1 user, load average: 0.01, 0.02, 0.00
Tasks: 277 total, 2 running, 275 sleeping, 0 stopped, 0 zombie
Cpu0 : 3.6%us, 0.3%sy, 0.0%ni, 94.0%id, 1.0%wa, 0.7%hi, 0.3%si, 0.0%st
Cpu1 : 4.2%us, 0.6%sy, 0.0%ni, 93.5%id, 0.0%wa, 1.3%hi, 0.3%si, 0.0%st
Mem: 3062084k total, 2660380k used, 401704k free, 20124k buffers
Swap: 5935976k total, 42360k used, 5893616k free, 1970148k cached


/proc/sys/fs/file-nr
1696 0 302424
Спасибо сказали: