Question:
Concurrent MySQL connections question?
2008-03-18 14:39:09 UTC
I've been researching hosts and one question I was told to ask is how many concurrent sql connections they allow, for a Zen-Cart my friend hopes will become popular. Some say 10-20, a couple said 50 but my question is, what does this mean? If his site does get popular and he runs a special and, say, 500 people from his mailing list hit the site at the same time and he has a 50 concurrent limit, are a bunch of people going to be out of luck and if so, for how long? ANY knowledge on this would be appreciated.
Three answers:
General Cucombre
2008-03-18 14:57:27 UTC
The limit is not set by default, so it is up to hosting company. I've dealt with several pretty busy web sites crammed into shared hosting, however I've never ran into that limit.



But if the limit exists and is - for example, 50 - the 51th concurrent connection will be denied. Most pages, though, will require connection only for the duration of time when the page is rendered - which may be a matter of milliseconds - so it's got to be 50 page requests at the same very moment, every moment, continuously.



In practice, however, if you use shared hosting and get a lot of traffic, you will see significant performance degradation and your scripts will run out of memory long before you hit the limit of 500 or even 50 concurrent connections.



If that happens, move to dedicated or virtual dedicated hosting, where you normally set those limits yourself.
RiggsFolly
2008-03-18 15:00:54 UTC
Connections to the database are only used while a script is actually running. Once the script is finished and the page is built all connections are automatically released.



Once the page is complete the time taken to send that page to a users browser and for the user to view/read it will not be using a databse connection.



Therefore you should be able to service many more clients than the maximum number of connections allowed. Its a little difficult to say exactly how many but I would say 10 times the number of clients to connections should not be any problem unless you are using a very badly written script.



Hope this helps
zula
2016-05-24 04:51:04 UTC
JSP and MySQL work very well together, in my experience--much faster than ASP with SQL Server. Chances are greatest that the HTTP server itself isn't allowing enough child processes to spawn to handle the requests, or that the server that it's on is simply too small. If you're running JSP/Tomcat/IIS or JSP/Tomcat/Apache on Windows, this may be another part of your problem. Running Java web servers on Windows is usually a bad idea, and MySQL is similarly recommended to be used on other systems in a production environment. Don't look at the language or the database, look at the server underneath and work from there.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...