4

What is the meaning of following statement?

A shared server should not have more than 25 simultaneous connections for an extended or consistent period of time.

4

A shared server should not have more than 25 simultaneous connections for an extended or consistent period of time.

Assuming

  1. this statement is made in the context of a webserver serving webpages for a website or web application,
  2. the context was 25 connections per user account on a shared host - knowing there would be anything from 5 to 30 other accounts on the machine

Then its purpose is most likely a guideline to prevent users exceeding the servers memory resources.
Likely also to prevent overloading other resources such as CPU.

When a browser wants to request a webpage from a server - it must first establish TCP connections with that server (lets assume apache as its the most common). Typically the browser will establish about 6-8 TCP connections.
It is these TCP connections over which HTTP requests and responses travel. HTTP is the protocol which contains the HTML and javascript files, images etc.
One of the less desirable characteristics of Apache is that everytime it establishes a TCP connection with a browser it needs to load the "apache program" into memory - for every connection.
How much memory per connection apache consumes varies alot and is determined by how many modules are loaded into apache: rewrite, logging, authentication etc, also whether the pages are static or CGI scripts like PHP, Ruby, etc and also the MPM - mulitprocessing module Apache is using, options being

  • prefork
  • worker
  • event

Taking a default configuration of Apache 2.4 as a baseline. In order to prevent apache consuming too much memory and causing the server to page RAM (very bad) apache defines an upper threshold on connections it will hold open using the MaxRequestWorkers directive

The MaxRequestWorkers directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxRequestWorkers limit will normally be queued, up to a number based on the ListenBacklog directive.

This is set at 150 by default, so when you consider you have to share these 150 connections amongst the other users the 25 connections per user account is not unreasonable.
This obviously varies by many orders of magnitude from site to site and server to server, but hopefully this gives some background into how and why the host provider would recommend you stay within those limits.

For anyone wanting more background this is the best introduction I have read on the subject - https://www.nginx.com/blog/http-keepalives-and-web-performance/

  • 1
    As promised! Nicely done!! I will defer my answer for yours. Thanks!! – closetnoc Nov 13 '15 at 3:35
  • 1
    @closetnoc no problem, hope it helped! – the_velour_fog Nov 13 '15 at 3:43
  • 1
    For me it is about helping people. For whatever reason, I like webmasters! Other than my few cr@ppy sites, this is not what I did for a living. I was a developer, systems internals engineer, Internet services consultant, IT business consultant, managed 1000's of servers, etc. I was also a web host which exposed me to webmasters and ever since then, I have liked them very much. You all are the professionals. I bring my experience which is now getting rather old since I am retired. If you do not know, this is a fantastic group to throw your hat into the ring! I am having fun anyway!! – closetnoc Nov 13 '15 at 4:02
  • @closetnoc nice one, I've enjoyed reading your posts here on webmasters and also on your main closetnoc website too. I think we have similar interests - I am currently building a web application for helping painting contractors calculate price estimates on jobs and I would like to monetize it with Google adsense. Its a solo project and quite alot of work for one person so I am always interested to get feedback or opinions from people like yourself - especially with your background and your approach to things. So I will for sure be around asking questions and help out with answers where I can! – the_velour_fog Nov 13 '15 at 4:18
  • Thanks for your comments! I have been updating my SEO stuff for my site since last winter... I have yet to post it, but it is based on what I write here so it will sometimes buck common wisdom. I am getting fairly deep into the science of it all. I am experimenting with Hadoop, Solr, Nutch, semantics and so forth to see if a true SEO analysis engine can be built. BTW- One thing I did years ago that may help you was create private stock for a software product and I asked people to help develop for shares of the stock. It worked and we made money when we sold it which was always of the plan! – closetnoc Nov 13 '15 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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