Is there a way to limit a site's simultaneous access?

carock

Well-Known Member
Sep 25, 2002
266
8
168
St. Charles, MO
I have a site that uses up all my apache slots occasionally. This leaves all the other sites on that server unable to access.

Does anyone know if there's a way in cPAne;/WHM or in the Apache config file to limit a site to say 100 simultaneous connections and that way leaves the rest available for the other sites?

Thanks,
Chuck
 

hgrfoshee

Member
PartnerNOC
Aug 22, 2006
7
0
151
This is possible with adding "MaxClients NN" to your .htaccess where NN is a positive number.
 

carock

Well-Known Member
Sep 25, 2002
266
8
168
St. Charles, MO
That doesn't appear to work. I get Internal Server Error.

According to another thread I found searching Yahoo, that config option can only be in the httpd.conf file, and only once globally, not in the Virtual host configuration.

Thanks for the idea though.

Chuck
 

dgbaker

Well-Known Member
PartnerNOC
Sep 20, 2002
2,576
9
343
Toronto, Ontario Canada
cPanel Access Level
DataCenter Provider
Not sure you can on a "per site" basis. But one should ask, can the apache server itself be tuned better to accomodate or has the site out grown this server. It is a shame to penalize a site for being popular and the client may not find you too popular if you start limiting how many people can hit their site at one time. Just my opinion. ;)
 

carock

Well-Known Member
Sep 25, 2002
266
8
168
St. Charles, MO
I agree, shared hosting has it's drawbacks that most customers don't realize. This is a big one for some people in that a site can be temporarily popular and not leave any room for the rest of the customers.

Moving other customers from one server to another is usually not acceptable, and unless it's dedicated hosting, they are still prone to the same problem.

I have a Brazil web site hosted on a busy server with 100+ customers. The Brazil site is pretty popular too, but normal monthly bandwidth is only around 16 Gig.

The plane crash in Brazil last month or so ago shot his web hits up and maxed out the simulataneous users limit on the server for over 4 days.

The other day, I saw the same sit explode again, and did some searching. Yahoo.com home page had a story about a 27 story Chrsitmas tree in Rio De Janero. Bam, that server overload fortunately only lasted about 6 hours. The following day also had another residual for a few hours again, but not half as bad as the original.

The bottom line is, it's shared hosting, and if your site wants the whole box, as a service provider, I need to be able to limit it so I can sell it. Otherwise, there's only one solution and thats to shut the site down until the draw goes away. Unfortunately, the customer probably goes with it.

I was hoping cPanel's custom bandwidth mod for Apache had some kind of control in it that allowed for this type of per site limit for available apache server slots. I dont' even know if it's possible. I believe at some time Apache did have this control because I did find a lot of sites explaining how you could put MaxClients directive in the .htacces files. Apache's documentation no longer reflects that, and I also tried it and it didn't work.

That type of control would be awesome, and I believe every single cPanel customer would use it.

Chuck
 

carock

Well-Known Member
Sep 25, 2002
266
8
168
St. Charles, MO
That would take it out of cPanel's management capabilities though wouldn't it?

The customer would still need to use the cPanel tools, web logs, etc. I would still need ot be able to rebuild Apache with WHM and so on.

Chuck