hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting : MySQL connection limit question
Reply

Forum Jump

MySQL connection limit question

Reply Post New Thread In Web Hosting Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19

MySQL connection limit question


I've been shopping around for hosts and I've seen more then a few times information given about how many query/connections per user one could make on a particular host.

I was wondering if someone could explain it a bit more for me? Like what it's all about.

Does the "user" count as me accessing the MySQL databases I've got set up? Like for example if I'm accessing and working with a CMS? Something like: I've logged into my manager panel, this counts as one connection, or I'm editing this page this also counts as a connection.

Or is it for outside users, like: Bob signs into his favorite website and that query goes to the corresponding database and now he sees all his personalized stuff.

Or is it neither of these?

Also, let's say there's a 25 connections per user limit with a host. Is that 25 connections an hour? a day? a month?

My apologies if these seems like it should be really obvious stuff.

Thanks!



Sponsored Links
  #2  
Old
Temporarily Suspended
 
Join Date: May 2011
Posts: 57
Yes, Accessing the CMS also counts as mySQL usage, as the CMS pulls data from the database. One person Accessing your CMS = 1 mySQL database connection.

The 25 connections is concurrent (simultaneous connections) I think, as 25 an hour/day/month is too less.

  #3  
Old
Web Hosting Master
 
Join Date: Nov 2006
Location: Karachi, Pakistan
Posts: 1,202
The duration is until the connection is made, the query run, the result returned to the script running on the server and the connection closed. So the connection is only active for a short timespan. On the order of a few dozen to a few hundred milliseconds. It definitely is NOT active while you are viewing the page.

25 connections means the maximum number of connections at a time. During a day you can have thousands of connections that are established and then closed. Also 25 connections does not mean 25 simultaneous users. The actual number of users will be higher because, as I said before, connections are opened and closed very fast. How many simultaneous users does it mean? Depends on your website. Anyway 25 is a good number for shared hosting.

One last point 25 does not mean that if you run out of connections your website stops functioning. I believe there is a queuing mechanism so that some connections are simply delayed. Your website will slowdown not stop working completely.

Sponsored Links
  #4  
Old
Cloud Engineer
 
Join Date: Jul 2011
Location: ATL,DFW,PHX,LAX,CHI,NJ
Posts: 696
Thought some forum software and such open persistent connections to handle all requests over it? Maybe I misunderstood that feature, but I've used it with several bulletin boards in the past. Never really had a need to figure it out even when we were running 40-50 people on at the same time never saw an issue.

__________________
█ Total Server Solutions
OnApp Cloud Solutions, CDN, DNS, Load Balancers, and Hybrid Dedicated Servers
█ Colocation with Colo@
Visit us at http://www.totalserversolutions.com/

  #5  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19
So can many users on a shared host server making a lot of MySQL requests cause problems?
Like let's say I'm accessing my CMS while another user in their section of the server is checking their email, and someone else is updating their blog, etc.
And if so, could this affect memory usage on the entire server? Could it cause Php requests to the databases to time out or fail to process?

  #6  
Old
Web Hosting Master
 
Join Date: Nov 2006
Location: Karachi, Pakistan
Posts: 1,202
Quote:
Originally Posted by drding View Post
So can many users on a shared host server making a lot of MySQL requests cause problems?
Like let's say I'm accessing my CMS while another user in their section of the server is checking their email, and someone else is updating their blog, etc.
And if so, could this affect memory usage on the entire server? Could it cause Php requests to the databases to time out or fail to process?
The limit of 25 concurrent connections is per shared hosting account not for the entire server. A typical shared hosting server can probably handle hundreds of simultaneous MySQL connections.

All your other questions are related to server resources. Unless your hosting provider has overloaded the server with too many users it should not be a problem. So the question to ask is are you buying hosting from a dodgy provider? A reputable provider will not overload the server.

  #7  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19
Quote:
Originally Posted by Website themes View Post
All your other questions are related to server resources. Unless your hosting provider has overloaded the server with too many users it should not be a problem. So the question to ask is are you buying hosting from a dodgy provider? A reputable provider will not overload the server.
Would it point to an overloaded server if I'm seeing internal server errors and items in my server error log like this one "(12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/myusername/public_html/manager/index.php"

And I see that error when using two different CMS's including WordPress.

Is there any way to see how many users are on my server?

  #8  
Old
Premium Member
 
Join Date: Oct 2010
Location: Kent
Posts: 3,372
Quote:
Originally Posted by drding View Post
Would it point to an overloaded server if I'm seeing internal server errors and items in my server error log like this one "(12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/myusername/public_html/manager/index.php"

And I see that error when using two different CMS's including WordPress.

Is there any way to see how many users are on my server?
It means that the host is running PHP under suPHP, which is a good thing. That means that each time a PHP page is parsed, Apache starts a new PHP instance. When it tried to do that, it needed to allocate some memory, but it couldn't do so. Basically: {max-memory-per-php-script} * {number-of-currently-running-php-scripts} > {total-available-memory-on-server}

So, yes, overloaded.

How many users on my server? No host would tell you that. Even if you knew it, without knowing what resources they each use it wouldn't tell you much. If they were mostly static users, it wouldn't have any impact

__________________
James Oakley, OakHosting.NET | UK Based | US Servers | Pay in , $ or
Affordable, Reliable Shared Hosting for 3 years. Specialising in Charities and Churches
Oh look, they've got a : Shiny new website!
... Drupal a speciality; PHP 5.3, 5.4, 5.5 or 5.6; Drush; Git; cPanel; Varnish; Apache 2.4

  #9  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19
Quote:
Originally Posted by JamesOakley View Post
It means that the host is running PHP under suPHP, which is a good thing. That means that each time a PHP page is parsed, Apache starts a new PHP instance. When it tried to do that, it needed to allocate some memory, but it couldn't do so. Basically: {max-memory-per-php-script} * {number-of-currently-running-php-scripts} > {total-available-memory-on-server}

So, yes, overloaded.

How many users on my server? No host would tell you that. Even if you knew it, without knowing what resources they each use it wouldn't tell you much. If they were mostly static users, it wouldn't have any impact
Would a high CPU% also be indicative of an overloaded server? Like if I look at my server via PuTTy and saw MySQL running any where between 3% to 200% (towards the higher end pretty regularly, highest I saw a few moments ago was 245%) is that a bad sign or normal fluctuations?

  #10  
Old
Web Hosting Master
 
Join Date: Nov 2006
Location: Karachi, Pakistan
Posts: 1,202
Quote:
Originally Posted by drding View Post
Would it point to an overloaded server if I'm seeing internal server errors and items in my server error log like this one "(12)Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/myusername/public_html/manager/index.php"

And I see that error when using two different CMS's including WordPress.

Is there any way to see how many users are on my server?
Yep that's an overloaded server. Complain to the provider. Maybe they'll fix it. If they BS you its time to switch hosts.

Quote:
Originally Posted by drding View Post
Would a high CPU% also be indicative of an overloaded server? Like if I look at my server via PuTTy and saw MySQL running any where between 3% to 200% (towards the higher end pretty regularly, highest I saw a few moments ago was 245%) is that a bad sign or normal fluctuations?
What's the server load number? Also what CPU does the server have? Under centos you can find this out by doing a :

uptime;
cat /proc/cpuinfo

  #11  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19
Quote:
Originally Posted by Website themes View Post
Yep that's an overloaded server. Complain to the provider. Maybe they'll fix it. If they BS you its time to switch hosts.



What's the server load number? Also what CPU does the server have? Under centos you can find this out by doing a :

uptime;
cat /proc/cpuinfo
You have to forgive me, I just downloaded PuTTy and looked up how to find the top processes. So I need a bit of guidance.

How do I find the server load number?

when I put in uptime I get this:
22:16:58 up 4 days, 23:24, 2 users, load average: 0.70, 0.78, 0.67

I tried putting in cat /proc/cpuinfo and I got a message that there was no such file or directory. So I'm assuming I'm doing something wrong.

  #12  
Old
Web Hosting Master
 
Join Date: Oct 2010
Posts: 1,784
That's a nice load average (for the moment).

__________________
Hosting is like a box of chocolates, you never know what you're gonna get.

  #13  
Old
Web Hosting Master
 
Join Date: Nov 2006
Location: Karachi, Pakistan
Posts: 1,202
The number 0.70, 0.78 and 0.67 are your load average at different time intervals. I think its 1 minute, 5 min and 15 min. Anyway your server load is well under control.

  #14  
Old
Cloud Engineer
 
Join Date: Jul 2011
Location: ATL,DFW,PHX,LAX,CHI,NJ
Posts: 696
You're likely to see only one instance of mysql running using top. If netstat is available try

netstat -a

look for mysql socket connections, but if you have this access there are plenty of programs out there that can tell you your mysql stats.

__________________
█ Total Server Solutions
OnApp Cloud Solutions, CDN, DNS, Load Balancers, and Hybrid Dedicated Servers
█ Colocation with Colo@
Visit us at http://www.totalserversolutions.com/

  #15  
Old
Newbie
 
Join Date: Aug 2011
Location: New Jersey
Posts: 19
I have no idea what a socket connection looks like lol. I don't know if I should post some of what came up that I could grab (it went really fast and a bunch of it is gone, meaning it'll only let me scroll up so far) because there's IP addresses in it.

I did see a ton of "TIME_WAIT" and "ESTABLISHED". and a few "FIN_WAIT1" and "FIN_WAIT2". I don't know if that's helpful at all.

Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preventing 25 Simultaneous Connection Limit (MySQL) mpcidm Programming Discussion 3 11-19-2007 06:17 PM
MySQL Concurrent Connection Limit gobeyond Hosting Security and Technology 11 07-04-2007 01:44 AM
Is it possible to set mysql connection limit for each account? helmishariff Web Hosting 5 03-24-2006 02:09 PM
set max connection limit for specific mysql database jaymef Hosting Security and Technology 7 03-24-2006 07:15 AM
MySQL Connection Limit qwer123 Web Hosting 7 11-23-2000 05:05 AM

Related posts from TheWhir.com
Title Type Date Posted
Cloud and Hosting Providers Need Innovative and "Value Unique" Services to Survive Web Hosting News 2014-05-19 13:57:30
Google Releases Hosted Database Service Cloud SQL to General Availability Web Hosting News 2014-02-12 13:46:02
Google Cloud Provides Support For Native MySQL Connections Web Hosting News 2013-11-01 14:36:06
How to Create a Cultural Connection with Jeremy Gutsche of TrendHunter Web Hosting News 2013-02-06 13:45:48
New Internet Censorship Law in Russia Requires Web Hosts, ISPs to Block Illegal Websites Web Hosting News 2012-11-12 12:06:43


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?