Web Hosting Talk







View Full Version : using all RAM


Lem0nHead
04-04-2004, 11:05 AM
Hello

When I had a Celeron 1.3 GHz with 512 MBs RAM on ev1, it used around 500 MBs RAM and on peaks it needed around 200 MBs from swap

Now I'm on a p4 2.8 GHz with 1024 MBs RAM and it's almost always using 900~1000 MBs RAM

I'm running exactly the same sites (moved them) and I have this config on httpd.conf (the same too):

Timeout 20
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 10
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 250

when I got this server, I setted:
MinSpareServers 8
MaxSpareServers 16
StartServers 8

(I really think that's a better config for p4 2.8 GHz with 1024 MBs RAM)

Then when I saw the memory usage, I reduced it to the values showed above and still the same thing.


root@server01 [/]# free
total used free shared buffers cached
Mem: 1027996 1004044 23952 0 352276 385816
-/+ buffers/cache: 265952 762044
Swap: 2040212 189680 1850532


thanks

piramida
04-04-2004, 11:20 AM
i doubt some few extra apache processes will have that much impact on your RAM; most probably it adds 20-30 extra MBs. the real reason your memory shows as all used are the OS caches and buffers (300+Mb), which reduce disk accesses and such. Your OS will automatically reduce buffer sizes when your server will need more memory, nothing to worry about.

Also, most of the other memory is probably used by mySQL, not Apache.

Imago
04-04-2004, 12:24 PM
Your settings are good, but I don't see your MaxRequestsPerChild value.

Set them to 50 and your RAM will never go over 30%

also Timeout 20 > 5

This is what solved all my Celeron 2.4 overload and overuse issues.
Not sure what will happen on your 2.8 GHz

Lem0nHead
04-04-2004, 04:00 PM
Originally posted by piramida
i doubt some few extra apache processes will have that much impact on your RAM; most probably it adds 20-30 extra MBs. the real reason your memory shows as all used are the OS caches and buffers (300+Mb), which reduce disk accesses and such. Your OS will automatically reduce buffer sizes when your server will need more memory, nothing to worry about.

Also, most of the other memory is probably used by mySQL, not Apache.

but if it's to reduce disk access, it's shouldn't get so big in order to use swap... or am I missing something?

piramida
04-04-2004, 05:15 PM
no, it should not be using swap, correct. *some* swap may be used to unload stuff that's sitting in memory but is never really being used. that's my guess - you should check if you have such things. is server swapping? what's your usual load figures?

BaddaBing
04-04-2004, 06:55 PM
Originally posted by Imago
Your settings are good, but I don't see your MaxRequestsPerChild value.

Set them to 50 and your RAM will never go over 30%

also Timeout 20 > 5

This is what solved all my Celeron 2.4 overload and overuse issues.
Not sure what will happen on your 2.8 GHz


Hey thanks for that, that solved most if not all our apache woes in the last week or so :rolleyes:

Imago
04-05-2004, 05:59 AM
You are welcome! :-)))
It was really big pain in the arsch

Boost
04-05-2004, 06:22 AM
what OS? if linux which one and what kernel?
is it on HT enable or not?

wheimeng
04-05-2004, 06:52 AM
Turn keepalive off.

Imago
04-05-2004, 07:52 AM
Originally posted by Boost
what OS? if linux which one and what kernel?
RHE 2.4.21-9.0.1.EL