Reputation: 1665
Please anyone explain this mysql concurrent connections. My host is providing only 10 concurrent connections. Is that enough?. Does that mean only 10 users can access the website at the same time?
Upvotes: 3
Views: 1141
Reputation: 6744
Consider the math for this question: if your average page exec time is 5 seconds and you have 300 users and they tend to click once per minute, then 10 connections will have you at your saturation point: ((300 * 5) / 60) == 10. Your choices: make your pages faster (eg. a sub-second page will increase your limit x6) or get more connections. Otherwise, your users will end up waiting longer.
Upvotes: 2
Reputation: 3417
Does that mean only 10 users can access the website at the same time?
This isn't a well-defined measure of what 10 concurrent users means. Consider the following hypothetical blog I have:
I go to example.com/blog and it loads in 100 ms. I then read this page for 3 minutes. In the course of three minutes, the page I loaded spent 100ms loading, where < 100ms was actually used connecting to a database.
That means at the exact same time I was loading the page, 9 other people could have been also loading a page. The page has been open for 3 more minutes, however, and no concurrent connections were exhausted and hundreds of other people could have loaded the page, concurrent connections unrelated to me 'accessing the website'.
So the important take-away is at any given precise moment will you ever have more than 10 people accessing it? Assuming you find even the most elementary ways to reduce the page load times of your code-behind (the php, not external assets being loaded), you'll be easy able to handle hundreds of people an hour without once running into a "Too many connections" error, which would be the signal of an actual issue.
On the other hand--and again depending on your content--if you think you have enough users (or enough db connections) to by-chance have > 10 users all trying to do something within the exact same ~100-200ms of time window, that persists on attempted refreshes--then you'd have to request the host up that limit or move elsewhere. On that note, many hosts and the web servers behind it can help log these issues or bring them to your attention. Until then, there's a good chance 10 concurrent users is sufficient for even medium sized websites.
Upvotes: 2
Reputation: 13709
No, it's not that just 10 users that can access the website at the same time, it's the number of database connection that are possible at same time i.e.
At a time, only 10 connections get there processing to be done and other requests need to wait until a connection if freed.
If the number of users accessing the site concurrently are less then, this is not a concern. But you would need to increase this number if you need to scale the website for more number of users.
Upvotes: 0
Reputation: 51
That means that only 10 users can access the database at the exact same time.
http://dev.mysql.com/tech-resources/articles/mysql-administrator-best-practices.html
10 is a very low value, you can safely increase it.
Upvotes: 0