Server Load Issues

with 2GB's of ram
i had MaxClients set to 1024
the load was way up
i did ps -ef | grep httpd | wc -l which showed that i had 700+ http connections
i was running out of mem and swap was being used



i set MaxClients back down to 256 and the load dropped to normal
but when i ran ps -ef | grep httpd | wc -l it showed that all 256 http connections were filled
and no one could connect to any sites, it would just time out.


i threw a bunch more ram in the box and it helped out a little, but i was thinking the load would drop a lot more
ps -ef | grep httpd | wc -l shows 700+ connections again with MaxClients set to 1024


check the mem usage on these http processes:


7438 apache 15 0 24532 23M 7088 S 0.2 0.3 0:00 3 httpd
25534 apache 15 0 24720 24M 7156 S 0.1 0.4 0:00 2 httpd
29607 apache 15 0 24736 24M 7160 S 0.1 0.4 0:00 1 httpd
30314 apache 15 0 24496 23M 7152 S 0.1 0.3 0:00 3 httpd
32562 apache 15 0 24848 24M 7284 S 0.1 0.4 0:00 3 httpd
1928 apache 15 0 24716 24M 7176 S 0.1 0.4 0:00 0 httpd


how can i find out what sites are hogging this much mem?


i was starting to think that i was running out of ram again, but as you can see, i still have 3GB's of mem free


[8:10pm]# free -m
total used free shared buffers cached
Mem: 6021 3298 2722 0 115 2106
-/+ buffers/cache: 1075 4945
Swap: 1999 0 1999


i have not really "tweaked" anything except for httpd.conf:

# Timeout: The number of seconds before receives and sends time out.
#
##Timeout 300
Timeout 30

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
#KeepAlive Off
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
##MaxKeepAliveRequests 100
MaxKeepAliveRequests 1000

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
##KeepAliveTimeout 15
KeepAliveTimeout 5

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
#ServerLimit 512
ServerLimit 1024
#ServerLimit 2048
#ServerLimit 3072
#MaxClients 150
#MaxClients 256
#MaxClients 512
MaxClients 1024
#MaxClients 2048
#MaxClients 3072
MaxRequestsPerChild 1000
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0



any suggestions?

this server runs a lot of php/mysql scripts.

i guess i need to tweak my.conf and php.ini as well


thanks for your help.

 

 

 

 

Top