Web Hosting Talk







View Full Version : Too Many Simultaneous Visitors


NVB
01-07-2002, 12:02 PM
My server has become very slow. Each page has roughly a 4-6 second delay. This is almost certainly temporary and related to today's Howard Stern show.

Is there anything I can do to improve the situation, such as modifying the httpd.conf file?
Perhaps changing the timeout value, keep alive, or maxclients would have an effect. I could also try changing .shtml files to .htm. 'Top' gives me:
11:51am up 17 days, 19:29, 5 users, load average: 1.51, 1.24, 0.92
193 processes: 189 sleeping, 3 running, 1 zombie, 0 stopped
CPU states: 22.5% user, 11.8% system, 0.0% nice, 65.5% idle
Mem: 509272K av, 492984K used, 16288K free, 484428K shrd, 246704K buff
Swap: 530104K av, 0K used, 530104K free 174920K cached
The load and memory are not excessive, but the numebr of processes is far above normal. 'ps -auxw | grep -c http' gives 152, which is two above my MaxClients value in the httpd.conf file.

JDF
01-07-2002, 12:06 PM
I'm sorry but I have nothing constructive to say.. but were you mentioned on the Howard Stern Show? That'd be sweet! :D

BTW, from what I remember.. your top printout looks pretty ok, w/ a max load avg. of 1.5. Any errors? If not, I wouldn't worry about it just yet. And I would change the keepalive and timeout values before I messed w/ maxclients.

sigma
01-07-2002, 12:13 PM
Originally posted by NVB
My server has become very slow. This is almost certainly temporary and related to today's Howard Stern show.

Is there anything I can do to improve the situation, such as modifying the httpd.conf file?
Perhaps changing the timeout value, keep alive, or maxclients would have an effect. I could also try changing .shtml files to .htm. 'Top' gives me:

The load and memory are not excessive, but the numebr of processes is far above normal. 'ps -auxw | grep -c http' gives 152, which is two above my MaxClients value in the httpd.conf file.

Your server isn't overloaded. It's partly idle, in fact, because your MaxClients is set too low. Set it to 250. If the server doesn't crash or get too heavily into swap, raise it to 400 (you may have to recompile Apache after changing httpd.h for this value).

Kevin

mpjetta
01-07-2002, 12:16 PM
I have nothing to really contribute here except that one of my sites was mentioned on Howard Stern a few months back and it killed my server for about 3 days....About 600 people online at a time for a good 48 hours straight. Let me just say I didn't sleep for 3 days re-writing all my php to make it more efficient. At least the site is quick now a days and a lot of good things came out of the Stern plug for me like plugs on other radio stations and I even did an interview with a radio station. Congrats on your plug ;)

Craig
01-07-2002, 12:22 PM
Hi there,

Is this a cpanel based server? If it is try using /scripts/userps (as root)
this will show you the users accounts and how many processors that they are using. Could be good to try and find the account that's using the most and then maybe speak to him about finding an alternative. Greatest good for the greatest number and all that. If hes using 100 out of your apache maxclients then he maybe could do with some dedicated solution.

I would up your maxclients for the time being but possible look at getting more RAM for the machine or even another machine to put new clients on as that one seems to be getting full.

Out of interest are there many accounts on that box?

C.

NVB
01-07-2002, 01:36 PM
I modified max_clients to 400. Things were fine for awhile. Now the show is being rebroadcast in PST. My cgi processes keep giving internal server errors. I do an apchachectl restart, the processes increases to several hundred, then the errors begin.

The errors are Resourse Temporarilly Unavailble: couldn't spawn child processes

Craig
01-07-2002, 01:40 PM
Whats the servers load at?

C.

NVB
01-07-2002, 01:44 PM
The server load is about 0.5, but there are about 300 processes. After reducing maxclients down to 250, the errors appear to have stopped. Perhaps this was related to setting maxclients above hard_server_limit (default is 256).

PS -auxw shows that the httpd is pegged at 252.

bteeter
01-07-2002, 01:49 PM
Originally posted by NVB
I modified max_clients to 400. Things were fine for awhile. Now the show is being rebroadcast in PST. My cgi processes keep giving internal server errors. I do an apchachectl restart, the processes increases to several hundred, then the errors begin.

The errors are Resourse Temporarilly Unavailble: couldn't spawn child processes

You may need to increase the max_clients again. Also, check to see if your linux install has a limit set on active processes. If there is, you may need to set it higher and possibly recompile.

Take care,

Brian

NVB
01-07-2002, 02:18 PM
Answering various questions:
were you mentioned on the Howard Stern Show?

I do not think so, but I did hear the whole broadcast. I think that people found it through search engines. It has top spot at Google, and the top relevant spot at Yahoo. My site will receive more traffic today, than the day the site domain name was mentioned on the show.

Out of interest are there many accounts on that box?
Could be good to try and find the account that's using the most and then maybe speak to him about finding an alternative.

I have a dedicated server for my web site. I do not host any other sites.

You may need to increase the max_clients again.

I think the increased max clients was causing the errors. When I reduced the maxclients to 250, the errors went away. I heard that you are supposed to increase the hard_server_limit when you increase max clinets, but I did not feel comfortable messing with the httpd.h file. Perhaps having a hard_sever_limit so much lower than maxclients was causing problems.

Craig
01-07-2002, 02:22 PM
Sorry i was under the impression that the server was used for hosting of more then one domain name. =]


Sorry again,

C.

BlueBox
01-07-2002, 03:24 PM
you may also be suffering from OS max open files being to low we found we had to up this figure quite a lot on some servers we have that run over 500 processes

cat /proc/sys/fs/file-max

above will tell you (depending on OS flavour)

echo 556000 >/proc/sys/fs/file-max

would set it at 556000

mahinder
01-07-2002, 04:33 PM
Originally posted by NVB
Answering various questions:


I do not think so, but I did hear the whole broadcast. I think that people found it through search engines. It has top spot at Google, and the top relevant spot at Yahoo. My site will receive more traffic today, than the day the site domain name was mentioned on the show.




I have a dedicated server for my web site. I do not host any other sites.



I think the increased max clients was causing the errors. When I reduced the maxclients to 250, the errors went away. I heard that you are supposed to increase the hard_server_limit when you increase max clinets, but I did not feel comfortable messing with the httpd.h file. Perhaps having a hard_sever_limit so much lower than maxclients was causing problems.

:rolleyes:
can somebody tell me what is "Howard Stern Show" :confused:
and how do i get my site announced there :D

Planet Z
01-07-2002, 05:03 PM
Originally posted by NVB
I think the increased max clients was causing the errors. When I reduced the maxclients to 250, the errors went away. I heard that you are supposed to increase the hard_server_limit when you increase max clinets, but I did not feel comfortable messing with the httpd.h file. Perhaps having a hard_sever_limit so much lower than maxclients was causing problems.

If you increase the maxclients above the hardserverlimit, Apache automatically reverts to the hard limit. You could set it to 256 or 50000 and it wouldn't make a difference if the actual hard limit remains at 256.

I think you need to check out the maximum number of open files on your OS and then increase the hard limit in Apache.

311
01-07-2002, 05:39 PM
Originally posted by mahinder


:rolleyes:
can somebody tell me what is "Howard Stern Show" :confused:
and how do i get my site announced there :D

If you're not joking and you auctally don't know what the howard stern show is then... http://www.google.com/search?q=Howard+Stern

If you are joking and DO know, then...:D

skylab
01-07-2002, 05:47 PM
did you happen to tape where he mentioned it? you could upload a small bit of it in mp3 on your site and use it in your marketing campaigns!

but yeah, your RAM usage is looking a little rough on your TOP, but at least you're not going into swap.

blueboxes post was also neat to hear about.

ADEhost
01-07-2002, 05:49 PM
this is a great thread.

I would like to add the following please.

You might want to consider splitting up into 2 real drives ( not partitions )

1 drive to have the mysql,php and other applications.
the database and the web code on another. this might help

what you are doing is reducing the I/O load by spearding it out
mike

Planet Z
01-07-2002, 06:30 PM
Originally posted by 311


If you're not joking and you auctally don't know what the howard stern show is then... http://www.google.com/search?q=Howard+Stern

If you are joking and DO know, then...:D

I'm pretty sure they don't have Howard Stern in India. :D