Jump to content
MDDHosting Forums

Concurrent MySql Connections


Adam

Recommended Posts

First of all, is it 50 concurrent connections for shared hosting as well as semi-dedicated?

 

Well, I run a wordpress site with caching. If someone loads a cached page, does it connect to MySql and count as a connection?

Any time you connect to MySQL it uses a connection. Depending on how long the query/ies are is it can be from a split second to several seconds. A connection limit of 50 does not mean you are limited to 50 users and a vast majority of providers offer between 10 and 15 connections with some exceptions as high as 25. 50 is actually exceptionally high for any sort of shared environment and yes, the limit is the same on shared and semi-dedicated.

 

If you're crossing 50 concurrent connections one of two things is going on:

  1. You're way out of the bounds of a regular shared or semi-dedicated account.
  2. You have some really poor queries or you're running a LOT of queries per page load.

Link to comment
Share on other sites

Any time you connect to MySQL it uses a connection. Depending on how long the query/ies are is it can be from a split second to several seconds. A connection limit of 50 does not mean you are limited to 50 users and a vast majority of providers offer between 10 and 15 connections with some exceptions as high as 25. 50 is actually exceptionally high for any sort of shared environment and yes, the limit is the same on shared and semi-dedicated.

 

If you're crossing 50 concurrent connections one of two things is going on:

  1. You're way out of the bounds of a regular shared or semi-dedicated account.
  2. You have some really poor queries or you're running a LOT of queries per page load.

 

If my pages are cached, do they open a connection to MySql?

Link to comment
Share on other sites

If my pages are cached, do they open a connection to MySql?

It really depends on how much of the page is being cached (i.e. is it just the main portion and the widgets are still loading dynamically). Generally caching is an attempt to avoid doing the same queries repeatedly.

 

For example - if nothing has changed on your site and two people visit the page 10 minutes apart - why would you need to run the same exact query twice when you can run it once and serve the static copy to the second visitor? :D

Link to comment
Share on other sites

It really depends on how much of the page is being cached (i.e. is it just the main portion and the widgets are still loading dynamically). Generally caching is an attempt to avoid doing the same queries repeatedly.

 

For example - if nothing has changed on your site and two people visit the page 10 minutes apart - why would you need to run the same exact query twice when you can run it once and serve the static copy to the second visitor? :D

 

Is there a way I can check all these stats and figure out how many queries per page load, how many cached queries, etc.?

Link to comment
Share on other sites

Is there a way I can check all these stats and figure out how many queries per page load, how many cached queries, etc.?

There are some plugins that do this depending on what script you're running - I don't know of any off the top of your head. There are no tools from the hosting side of things that would do it.

 

I mean, you could run mytop via SSH to see your queries in realtime but you would have no way of seeing which particular URL caused it, whether it you or a visitor, etc.

 

You would want to seek out the support department or forums for whatever script you're wanting to see these metrics as surely you're not the first person to want to see this information assuming it's not a one-off custom application.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...