How many users can Apache Handle?
Solution 1
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.
Solution 2
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.
Solution 3
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.
Solution 4
- 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.
Related videos on Youtube
user3632453
Updated on September 18, 2022Comments
-
user3632453 over 1 year
How to pass value from Activity to Fragment? I hope someone can help.
-
SLaks about 13 yearsWill you really have 20,000 requests at the same time?
-
Sam Alex about 13 yearsYes, The site will have a burst traffic and could reach around 50000 users. That is what i meant using 20,000 simultaneous connections
-
GregD about 13 yearsHow fast can your car go?
-
Sam Alex about 13 yearsHmm, Around 130 kmph. :)
-
Philip about 13 yearsGreg'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.
-
MilapTank over 9 yearsAdd code that you have try
-
MysticMagicϡ over 9 yearsCan you add a little more description? and what have you tried?
-
user3632453 over 9 yearsThis is another post, stackoverflow.com/questions/25726834/… This is my problem.
-
Akhil Jain over 9 yearsdo you mean
pass
orparse
?? add code which you have already tried -
user3632453 over 9 yearsThis is another post, stackoverflow.com/questions/25726834/… This is my problem. I want to get value from activity and set in the fragment.
-
0101100101 over 9 yearspossible duplicate of Proper way to give initial data to fragments
-
-
JClaspill about 13 yearsYou 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.
-
Sam Alex about 13 yearsWell, i use nginx for all my other works. but for this one i am forced to use Apache.
-
poisonbit about 13 yearsI've never seen apache giving such numbers in a standalone server. Good luck.
-
Sam Alex about 13 yearsYes, JS files are hosted within the server.
-
user3632453 over 9 yearsthis returns java.lang.NullPointerException
-
Naveen Tamrakar over 9 yearscreate a constrater on fragment and get data in constrater object