PDA

View Full Version : do i have too many apache processes?


young
11-17-2003, 07:18 AM
is something wrong if the show services page looks like this:

Service Status Start Stop Restart Reload
Apache httpd (pid 22691 22692 22693 22694 22695 22696 22697 22698 23816 23817 23818 23819 23820 23821 23822 23823 23824 23825 23826 23827 23828 23829 23830 23864 23865 23866 23867 23868 23869 23870 23871 23872 23873 23874 23875 23876 23877 23878 23879 23907 23908 23909 23910 23912 23913 23914 23915 23916 23917 23918 23919 23920 23921 23922 23923 23924 23925 23926 23927 23928 ) Start Stop Restart Reload

chuckd
11-17-2003, 07:29 AM
Not necessarily. Lots of hits require lots of processes. Apache starts up new processes to handle the load when necessary. Of course if your box isn't serving any large number of pages you might start to worry.

It's more interesting to look at the detailed status page which tells you which URL each process is currently serving (e.g. there might be an AVI that's getting hammered).

Also check the configuration directions in httpd.conf that set how many servers to start initially, max servers etc.

Peter
02-17-2004, 01:18 PM
Uhmm i have the same problem at the moment and my load is getting higher and higher...
Please help me asap...

httpd (pid 24784 24677 24672 24641 24291 24219 24044 23803 23475 23195 22945 22691 22567 22273 22272 22271 22270 22268 22267 22263 22262 22261 22260 22250 22249 22243 22242 22241 22239 22238 22237 22236 22228) is running...

existenz
02-17-2004, 03:32 PM
Guys that is the process id's. That is completely normal. You can verify this information from:

#ps aux| grep httpd

If you don't want this many processes then you can change the settings (no recommened) by searching the httpd.conf file for

-Timeout
-MaxKeepAliveRequests
-KeepAliveTimeout
-MinSpareServers
-MaxClients

To learn more about each (rather than posting long here) search the documents from the apache website

http://search.apache.org/

Peter
02-18-2004, 09:59 AM
It's more that if someone refreshes a website alot that apache generates like 50 load or so.... That is not good is it?

existenz
02-18-2004, 10:26 AM
If someone refreshes their browser in enough time it should not open a new pid because they have not timed out yet. The problem is newer browsers (Mozilla/Netscape, Safari, etc) can actually spawn multiple threads (pid's) while grabbing websites. This is how they help improve the rendering time.

To give you a idea this is from one of our customers boxes it moved in the last 18 days 81428MB the entire website is less than 4MB to that tells you how many people surf that website...

httpd (pid 30448 30446 30430 30429 30428 30413 30406 30405 30401 30399 30388 30384 30383 30376 30359 30357 30351 30348 30329 30328 30327 30326 30301 30300 30296 30288 30287 30282 30276 30269 30268 30267 30264 30256 30254 30253 30239 30237 30235 30210 30200 30196 30190 30184 30182 30172 30165 30162 30158 30157 30156 30155 30134 30133 30132 30131 30102 30098 30095 30094 30078 30077 30076 30051 30049 30044 30043 30035 30034 30033 30003 29997 29986 29980 29979 29952 29951 29949 29923 29917 29905 29899 29892 29

That is just SOME the pid's. Their are so many connections that DA does not list them all. The person that leases this server could help lower the RAM usage if he lowered his timeout. The only problem is you could end up with, in this type of load, using more memory since you are not keeping a connection alive, but spawing more of them.

It is a fine line between long timeout's and short timeout's. You can use the top command to figure out how much httpd is using and adjust as necessary.

Peter
02-18-2004, 11:36 AM
I'ts just 1 process which is causing that...

Anzix
05-05-2004, 12:13 AM
Since the last update I am having apache load problems.

httpd (pid 29161 29159 29158 29157 29156 29155 29154 29153 29152 29151 29150 29149 29148 29147 29146 29145 29144 29143 29142 29141 29140 29139 29138 29137 29136 29135 29134 29133 29132 29131 29130 29129 29128 29127 29126 29125 29124 29123 29122 29121 29120 29119 29118 29117 29116 29115 29114 29113 29112 29111 29110 29109 29108 29107 29106 29105 29104 29103 29102 29101 29100 29099 29098 29097 29096 29095 29094 29093 29092 29091 29090 29089 29088 29087 29086 29085 29084 29083 29082 29081 29080 29079 29078 29077 29076 29075 29074 29073 29072 29071 29070 29069 29068 29067 29066 29065 29064 29063 29062 29061 29060 29059 29058 29057 29056 29055 29054 29053 29052 29051 29050 29049 29048 29047 29046 29045 29044 29043 29042 29041 29040 29039 29035 29034 29033 29032 29031 29030 29029 29028 29027 29026 29025 29024 29023 29022 29021 29020 29019 29018 29017 29016 29015 29014 29013 29012 29011 29010 29009 29008 29007 29006 29005 29004 29003 29002 29001 29000 28999 28998 28997 28996 28995 28994 28993 28992 28991 28990 28989 28988 28987 28986 28985 28984 28983 28982 28981 28980 28979 28978 28977 28976 28975 28974 28973 28972 28971 28970 28969 28968 28967 28966 28965 28957) is running...

DirectAdmin Support
05-05-2004, 12:17 PM
Hello,

DA doesn't change the httpd settings that control process spawing and timeouts. You can edit them by modifying:

-Timeout
-MaxKeepAliveRequests
-KeepAlive
-KeepAliveTimeout
-MinSpareServers
-MaxClients

just as existenz said. You can try to decrease the Timeout, you can decrease the MaxClients (not too low), but as more people visit your server, more processes are spawned to accomodate everyone.

Another thing you can try is to set KeepAlive to On. This will enable people to make multiple requests through the same apache process, which prevents the need for as many apache processses. Just play with those settings to suite your needs.

John

Anzix
05-05-2004, 12:54 PM
How do you see a detailed status page I really want to see why this is all happening there is only 2-3 sites on the server and barely any of them get traffic.