Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a static site and an 8GB RAM Server. The site would have just some javascript and static content. I need to handle about 20,000 concurrent visitors. Will my 8GB Server able to handle this ? Can anybody explain how to configure Apache MaxClients and other settings for this ?

share|improve this question

migrated from stackoverflow.com Apr 8 '11 at 14:49

This question came from our site for professional and enthusiast programmers.

1  
Will you really have 20,000 requests at the same time? –  SLaks Apr 8 '11 at 14:50
    
Yes, The site will have a burst traffic and could reach around 50000 users. That is what i meant using 20,000 simultaneous connections –  Sam Alex Apr 8 '11 at 14:56
3  
How fast can your car go? –  GregD Apr 8 '11 at 15:02
1  
Hmm, Around 130 kmph. :) –  Sam Alex Apr 8 '11 at 15:09
4  
Greg's comment was sarcastic, implying that Apache's ability to handle "connections" means nothing without context. For instance, how fast can your car go while towing a 10,000# trailer might be completely different than how fast it can go while it's stuck in sand, etc. 20k visitors means nothing as well; each visitor will likely initiate multiple connections, and they wont be concurrent; additionally the rate of those connections would be dependent on your site design/purpose. There's far too many variables for us to give you any sort of intelligent answer. –  Chris S Apr 13 '11 at 13:49
add comment

4 Answers

up vote 5 down vote accepted

If you have money for enough bandwidth, just put nginx for serve static (js are static files).

It can serve high numbers on 2G RAM + sata disk desktops, so it should fly with server hardware.

Of course, do not use php + apache2 with mpm prefork, just to serve static content... or RAM will be a problem (and I/O, and context switching, and time waits, and... etc etc)

Oh, and add cache headers for everything you can, being a static content server. If things are cached, I doubt you get 20.000 NEW requests each second... or in one day all the planet and part of the universe have seen your site.

share|improve this answer
    
Well, i use nginx for all my other works. but for this one i am forced to use Apache. –  Sam Alex Apr 8 '11 at 15:57
1  
I've never seen apache giving such numbers in a standalone server. Good luck. –  poisonbit Apr 8 '11 at 16:01
add comment

RAM isn't going to be your problem if all the files are just 'as-is' and static. Your bandwidth is what will really matter. 20,000 concurrent will need a hefty connection to send out those files.

share|improve this answer
    
Yes, i know, but it will be hosted on Amazon EC2. Will there be a problem there ? –  Sam Alex Apr 8 '11 at 14:55
    
You still have to send the html/js files? Assuming you host your js libraries offsite(ie: use Google for core JQuery), I would say you're still limited more by bandwidth/network than the server hardware. –  JClaspill Apr 8 '11 at 15:25
    
Yes, JS files are hosted within the server. –  Sam Alex Apr 8 '11 at 16:06
add comment
  • Use the apache2 mpm worker engine.
  • Disable any unneeded module.
  • Check for other bottlenecks (firewalls, kernel network settings)

Make sure you have enough bandwidth, and test, test, test your setup before you make it available to the masses.

share|improve this answer
add comment

If you are worried about a single server not being able to cope with too many connections you should consider using a web cache like Varnish. This will take the load off when serving images and static content.

The only way to really ever test how many users etc you could have on a single server depends entirely on what you are running on it. For example I could have a PHP script that chews up a lot of the CPU or memory, then serves a page. It may perform well with up to a few hunders page serves per minute. But if you have a well written optimized site, then you might find that you could server thousands of (average) pages per minute. Varnish will definitely take some of the basic load requests off the web server. nginx is another good web server, it doesnt have as many bells and whistles as apache, but the general consensus is that it is very fast, well optimized at what it does do and uses less resources.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.