Apache Server configuration support - max_clients with 1 GB ram ???

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > July 2006 > max_clients with 1 GB ram ???





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author max_clients with 1 GB ram ???
drgonzo120

2006-07-12, 7:30 am

Hello,


I have a pentium2.4 GHZ / 1gb RAM / 80GB hd with fedora on it, and I
have this since the beginning of may, i needed to reboot it twice,
twice it was "running slower and slower", probably because of the
memory was exhausted and it was using hard disk as swap memory ??? So
maybe the max_clients in apache is wrong configured ????


If i have 1 GB ram ... on fedora with apache & mysql & php, what is the
max number of clients i may use ... ???


Any other suggestions why it might have been slowing down up to crash
???


thanks !

Sebastian Axmann

2006-07-12, 7:21 pm

What makes you think,that apache consumed all the memory?
What Versions do you use and what was the behaviour after a clean apache
restart?Is anything in the log-files,that's uncommon?

Sebastian

drgonzo120 schrieb am Mittwoch 12 Juli 2006 14:04:

> Hello,
>
>
> I have a pentium2.4 GHZ / 1gb RAM / 80GB hd with fedora on it, and I
> have this since the beginning of may, i needed to reboot it twice,
> twice it was "running slower and slower", probably because of the
> memory was exhausted and it was using hard disk as swap memory ??? So
> maybe the max_clients in apache is wrong configured ????
>
>
> If i have 1 GB ram ... on fedora with apache & mysql & php, what is the
> max number of clients i may use ... ???
>
>
> Any other suggestions why it might have been slowing down up to crash
> ???
>
>
> thanks !


drgonzo120

2006-07-13, 7:32 am


Sebastian Axmann schreef:

> What makes you think,that apache consumed all the memory?
> What Versions do you use and what was the behaviour after a clean apache
> restart?Is anything in the log-files,that's uncommon?
>

nothing, actually, hehe, can something else be the problem also ???

this wouldn't be a hardware problem, would it ?

how can i check the versions ???


thanks

Sebastian Axmann

2006-07-13, 7:32 am

Well,i think a hardware problem would show up as something like sudden
systems locks,spurious crashes or corrupted program runs.Something like
that,which is really not predictable.
How is the disk usage("df -h")?
What about the memory usage("free")?
What is top saying about the running processes?("top")?
I don't know exactly how is apache called on feudora,maybe it's
apache2,apachectl or httpd in a directory like /usr/bin,/sbin or so.You
could call it with the -v option or just use your browser and have a look
at http://[your-server]/server-status.
For mysql it should be very similar.

drgonzo120 schrieb am Donnerstag 13 Juli 2006 09:48:

>
> Sebastian Axmann schreef:
>
> nothing, actually, hehe, can something else be the problem also ???
>
> this wouldn't be a hardware problem, would it ?
>
> how can i check the versions ???
>
>
> thanks


drgonzo120

2006-07-13, 1:25 pm

hello,

the server crashed around monday 18.34-18.50
this is the apache log:


[Sun Jul 09 16:13:29 2006] [error] [client 195.242.215.22] File does
not exist: /var/www/vhosts/default/htdocs/myadmin
[client 85.184.11.26] script '/var/www/vhosts/default/htdocs/index.php'
not found or unable to stat
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpmyadmin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/PMA
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/mysql
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/admin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/db
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/dbadmin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/web
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/admin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/admin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/admin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/mysql-admin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpmyadmin2
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/mysqladmin
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/mysql-admin
[client 81.169.176.15] script '/var/www/vhosts/default/htdocs/main.php'
not found or unable to stat
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.6
[Mon Jul 10 18:34:25 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.4
[Mon Jul 10 18:34:26 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.5.1
[Mon Jul 10 18:34:26 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.2.3
[Mon Jul 10 18:34:26 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/phpMyAdmin-2.2.6
[Mon Jul 10 18:34:26 2006] [error] [client 81.169.176.15] File does not
exist: /var/www/vhosts/default/htdocs/myadmin
====>>>[Mon Jul 10 19:54:46 2006] [notice] child pid 30511 exit signal
Segmentation fault (11)<<<===
[Thu Jul 13 14:05:52 2006] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)
[Thu Jul 13 14:05:53 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Thu Jul 13 14:05:53 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Thu Jul 13 14:05:53 2006] [warn] RSA server certificate CommonName
(CN) `plesk' does NOT match server name!?
[Thu Jul 13 14:05:53 2006] [notice] Digest: generating secret for
digest authentication ...
[Thu Jul 13 14:05:53 2006] [notice] Digest: done
[Thu Jul 13 14:05:53 2006] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Thu Jul 13 14:05:53 2006] [notice] LDAP: SSL support unavailable

then it jumps to thursday ....


wait a minute, 81.169.176.15 was trying to get into my website !!!
check out the addresses he's trying, could i have been hacked ???

IP Address 81.169.176.15
Host Name selmer-rob.de

it seems to be a fixed ip?

the FREE command:

[root@flexid-2275 logs]# free
total used free shared
buffers cached
Mem: 767312 759348 7964 0 18116
439432
-/+ buffers/cache: 301800 465512
Swap: 1052248 192 1052056

does this say anything?

TOP:

[root@flexid-2275 logs]# top
top - 17:30:29 up 3:26, 1 user, load average: 0.68, 0.53, 0.45
Tasks: 114 total, 1 running, 113 sleeping, 0 stopped, 0 zombie
Cpu(s): 29.3% us, 3.0% sy, 0.0% ni, 67.7% id, 0.0% wa, 0.0% hi,
0.0% si
Mem: 767312k total, 753220k used, 14092k free, 18040k
buffers
Swap: 1052248k total, 192k used, 1052056k free, 432000k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
28837 apache 15 0 24648 16m 7604 S 9.3 2.2 0:03.71 httpd
23797 apache 15 0 29684 19m 7812 S 7.0 2.5 0:35.41 httpd
3255 mysql 15 0 120m 34m 3232 S 3.0 4.6 6:33.51 mysqld
3510 apache 15 0 29680 19m 7828 S 1.7 2.5 1:20.34 httpd
23053 apache 16 0 29144 18m 7824 S 1.7 2.5 0:52.86 httpd
24276 apache 15 0 29620 19m 7764 S 1.7 2.5 0:38.08 httpd
17395 apache 15 0 29104 18m 7764 S 1.3 2.5 1:24.54 httpd
23021 apache 15 0 29136 18m 7836 S 1.3 2.5 0:53.24 httpd
23792 apache 15 0 29128 18m 7812 S 1.3 2.5 0:33.72 httpd
23798 apache 15 0 28132 17m 7752 S 1.3 2.3 0:45.85 httpd
24292 apache 15 0 28192 17m 7756 S 1.3 2.3 0:36.08 httpd
23096 apache 15 0 29764 19m 7764 S 1.0 2.6 0:52.36 httpd
24321 apache 15 0 29724 19m 7816 S 1.0 2.5 0:39.77 httpd
29536 root 16 0 1956 984 756 R 0.3 0.1 0:00.03 top
1 root 16 0 1692 552 476 S 0.0 0.1 0:00.97 init
2 root 34 19 0 0 0 S 0.0 0.0 0:00.00
ksoftirqd/0
3 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0
4 root 11 -5 0 0 0 S 0.0 0.0 0:00.02 khelper
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
7 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid


how many max_clients should i have ???

df -h:

[root@flexid-2275 logs]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda3 75G 22G 50G 31% /
/dev/hda1 99M 11M 83M 12% /boot
none 375M 0 375M 0% /dev/shm

does this help you or anybody anything ?? any help is very welcome

there isn't much mem free is there ???


thanks a thousand times for any reply !!!!

drgonzo120

2006-07-13, 1:25 pm

something more very interesting:

my dying server:

i noticed this: Out of Memory: Killed process 3146 (mysqld).



Jul 10 18:29:51 flexid-2275 crond(pam_unix)[26788]: session closed for
user drweb
Jul 10 18:30:02 flexid-2275 crond(pam_unix)[27073]: session opened for
user root by (uid=0)
Jul 10 18:30:02 flexid-2275 crond(pam_unix)[27073]: session closed for
user root
Jul 10 18:45:41 flexid-2275 crond(pam_unix)[30428]: session opened for
user root by (uid=0)
Jul 10 18:48:03 flexid-2275 crond(pam_unix)[30428]: session closed for
user root
Jul 10 19:49:26 flexid-2275 kernel: oom-killer: gfp_mask=0x1d2
Jul 10 19:49:55 flexid-2275 kernel: Mem-info:
Jul 10 19:49:55 flexid-2275 kernel: DMA per-cpu:
Jul 10 19:49:55 flexid-2275 kernel: cpu 0 hot: low 2, high 6, batch 1
Jul 10 19:49:55 flexid-2275 kernel: cpu 0 cold: low 0, high 2, batch 1
Jul 10 19:49:55 flexid-2275 kernel: Normal per-cpu:
Jul 10 19:49:55 flexid-2275 kernel: cpu 0 hot: low 62, high 186, batch
31
Jul 10 19:49:55 flexid-2275 kernel: cpu 0 cold: low 0, high 62, batch
31
Jul 10 19:49:55 flexid-2275 kernel: HighMem per-cpu: empty
Jul 10 19:49:55 flexid-2275 kernel:
Jul 10 19:49:55 flexid-2275 kernel: Free pages: 6476kB (0kB
HighMem)
Jul 10 19:49:55 flexid-2275 kernel: Active:90362 inactive:88019 dirty:0
writeback:0 unstable:0 free:1619 slab:4054 mapped:181116
pagetables:2532
Jul 10 19:49:55 flexid-2275 kernel: DMA free:3044kB min:72kB low:88kB
high:108kB active:4388kB inactive:4000kB present:16384kB
pages_scanned:44339 all_unreclaimable? yes
Jul 10 19:50:20 flexid-2275 kernel: lowmem_reserve[]: 0 743 743
Jul 10 19:52:32 flexid-2275 kernel: Normal free:3432kB min:3452kB
low:4312kB high:5176kB active:357060kB inactive:348076kB
present:761792kB pages_scanned:3444869 all_unreclaimable? yes
Jul 10 19:53:16 flexid-2275 kernel: lowmem_reserve[]: 0 0 0
Jul 10 19:53:18 flexid-2275 kernel: HighMem free:0kB min:128kB
low:160kB high:192kB active:0kB inactive:0kB present:0kB
pages_scanned:0 all_unreclaimable? no
Jul 10 19:53:18 flexid-2275 kernel: lowmem_reserve[]: 0 0 0
Jul 10 19:53:18 flexid-2275 kernel: Normal: 28*4kB 3*8kB 8*16kB 1*32kB
1*64kB 0*128kB 0*256kB 2*512kB 0*1024kB 1*2048kB 0*4096kB = 3432kB
Jul 10 19:53:18 flexid-2275 kernel: HighMem: empty
Jul 10 19:53:30 flexid-2275 kernel: Swap cache: add 845560, delete
845559, find 239591/289987, race 0+5
Jul 10 19:53:35 flexid-2275 kernel: Free swap = 0kB
Jul 10 19:53:50 flexid-2275 kernel: Total swap = 1052248kB
Jul 10 19:53:55 flexid-2275 kernel: Free swap: 0kB
Jul 10 19:53:55 flexid-2275 kernel: 194544 pages of RAM
Jul 10 19:53:56 flexid-2275 kernel: 0 pages of HIGHMEM
Jul 10 19:53:56 flexid-2275 kernel: 2844 reserved pages
Jul 10 19:53:57 flexid-2275 kernel: 28196 pages shared
Jul 10 19:54:05 flexid-2275 kernel: 1 pages swap cached
Jul 10 19:54:05 flexid-2275 kernel: Out of Memory: Killed process 3146
(mysqld).
Jul 10 19:54:18 flexid-2275 kernel: oom-killer: gfp_mask=0x1d2
Jul 10 19:54:19 flexid-2275 kernel: Mem-info:
Jul 10 19:54:19 flexid-2275 kernel: DMA per-cpu:
Jul 10 19:54:35 flexid-2275 kernel: cpu 0 hot: low 2, high 6, batch 1
Jul 10 19:54:45 flexid-2275 kernel: cpu 0 cold: low 0, high 2, batch 1
Jul 10 19:54:59 flexid-2275 kernel: Normal per-cpu:
Jul 10 19:55:15 flexid-2275 kernel: cpu 0 hot: low 62, high 186, batch
31
Jul 10 19:55:51 flexid-2275 kernel: cpu 0 cold: low 0, high 62, batch
31
Jul 10 19:56:04 flexid-2275 kernel: HighMem per-cpu: empty
Jul 10 19:56:16 flexid-2275 kernel:
Jul 10 19:56:31 flexid-2275 kernel: Free pages: 6476kB (0kB
HighMem)
Jul 10 19:56:52 flexid-2275 kernel: Active:88759 inactive:89533 dirty:0
writeback:0 unstable:0 free:1619 slab:3939 mapped:181096
pagetables:2532
Jul 10 19:57:12 flexid-2275 kernel: DMA free:3044kB min:72kB low:88kB
high:108kB active:4944kB inactive:3316kB present:16384kB
pages_scanned:24139 all_unreclaimable? yes
Jul 10 19:57:23 flexid-2275 kernel: lowmem_reserve[]: 0 743 743
Jul 13 14:05:28 flexid-2275 syslogd 1.4.1: restart.
Jul 13 14:05:28 flexid-2275 syslog: syslogd startup succeeded

drgonzo120

2006-07-13, 1:25 pm

immediately after a fresh reboot "free" gives this:



[root@flexid-2275 ~]# free
total used free shared
buffers cached
Mem: 767312 143636 623676 0 10116
45956
-/+ buffers/cache: 87564 679748
Swap: 1052248 0 1052248


this time 623 is free?

drgonzo120

2006-07-13, 1:25 pm

on the same minutes the server was going down, my vbulletin forum soft
spawned thse emails:


Database error in vBulletin :

mysql_connect(): Too many connections
/var/www/vhosts/psychedelic.be/httpdocs/forum/includes/class_core.php
on line 279


i smell a plot here ....

drgonzo120

2006-07-13, 1:25 pm

on the same minutes the server was going down, my vbulletin forum soft
spawned thse emails:


Database error in vBulletin :

mysql_connect(): Too many connections
/var/www/vhosts/psychedelic.be/httpdocs/forum/includes/class_core.php
on line 279


i smell a plot here ....

Piotr Wadas :: DT

2006-07-13, 1:25 pm


drgonzo120 napisal(a):
> on the same minutes the server was going down, my vbulletin forum soft
> spawned thse emails:
>
>
> Database error in vBulletin :
>
> mysql_connect(): Too many connections
> /var/www/vhosts/psychedelic.be/httpdocs/forum/includes/class_core.php
> on line 279
>
>
> i smell a plot here ....


I've had similar problem recently - playing with ipcs and ipcrm
commands,
and removing apache things from the list did the trick
However, I'm not sure what caused this issue, after replacing apache
with newer version, it didn't appear - so far.

DT.

drgonzo120

2006-07-19, 8:09 am

anybody ???? :-(

Sebastian Axmann

2006-07-20, 7:27 pm

Try to limit the Apache and MySql-Server more.
Try something like:
MaxThreads 512
MaxSpareThreads 5
StartServers 3
StartThreads 5
MaxClients 25

And mysql offer's also some directives to limit the use of RAM and CPU Load.
Finally you could just generate some load to "see" if the memory is freed
cleanly.
Try the Apache Benchmark Tool,ab2 with:
ab2 -n 15000 -c 100 -t 40 127.0.0.1:80/index.html
You may even increase the number of requests,if,after thousands of request
the memory is still available,then there's no problem with apache but with
something else.

Sebastian
drgonzo120

2006-07-21, 1:35 am

when i do the test, it uses 30 MB, but when i shut down the service
after thrre hours (8MB ram left) httpd frees up 130 MB ... so in some
way it uses memory but not actively ... any one any idea?


this is my setup now ( i noticed it uses the prefork, not the worker):

StartServers 3
MinSpareServers 5
MaxSpareServers 20
ServerLimit 10
MaxClients 10
MaxRequestsPerChild 3000




[root@flexid-2275 conf]# ab -n 15000 -c 100 -t 40
127.0.0.1:80/index.html
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation,
http://www.apache.org/

Benchmarking 127.0.0.1 (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Finished 37256 requests


Server Software: Apache/2.0.53
Server Hostname: 127.0.0.1
Server Port: 80

Document Path: /index.html
Document Length: 283 bytes

Concurrency Level: 100
Time taken for tests: 40.5967 seconds
Complete requests: 37256
Failed requests: 0
Write errors: 0
Non-2xx responses: 37256
Total transferred: 17249528 bytes
HTML transferred: 10543448 bytes
Requests per second: 931.26 [#/sec] (mean)
Time per request: 107.381 [ms] (mean)
Time per request: 1.074 [ms] (mean, across all concurrent
requests)
Transfer rate: 421.06 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 4 4.2 4 218
Processing: 13 101 19.7 99 423
Waiting: 10 96 19.8 93 422
Total: 23 105 19.6 103 424

Percentage of the requests served within a certain time (ms)
50% 103
66% 103
75% 103
80% 104
90% 110
95% 111
98% 134
99% 173
100% 424 (longest request)


greetings

Sebastian Axmann

2006-07-21, 1:35 am

This is no real problem,because Apache is allowed to allocate as much memory
as it wants to,as long as no other(!) program needs some.So,it is possible
that 30MB or even 60MB are used "actively" by Apache,but 130MB are finally
freed,because they we're cached before,so this should be ok.
Where were the Values for StartServers and so on before?
You could just try to run Apache some hours or just with a more exhausive
test and afterwords,when free tells yiou,that no memory(or a low number of)
is still available,start a new programm,which consumes definitively more
than the free amount.Apache should then give back the RAM and everthing
should be fine.
Have you looked up the values for MySql?

drgonzo120 schrieb am Freitag 21 Juli 2006 05:35:
> when i do the test, it uses 30 MB, but when i shut down the service
> after thrre hours (8MB ram left) httpd frees up 130 MB ... so in some
> way it uses memory but not actively ... any one any idea?
> this is my setup now ( i noticed it uses the prefork, not the worker):
> StartServers 3
> MinSpareServers 5
> MaxSpareServers 20
> ServerLimit 10
> MaxClients 10
> MaxRequestsPerChild 3000


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com