Jump to content

Need help - SQL error


buggalena

Recommended Posts

Looking for someone to help me fix the following error my customers get when they go on my site whenever there is a number of people at one time.  In speaking with my host it should be a simple fix but they said it's a developmental error and will not help me.  Please contact me ASAP if you can help at [email protected] 

 

Link to database cannot be established: SQLSTATE[42000] [1203] User buggalen_shop47 already has more than 'max_user_connections' active connections

Link to comment
Share on other sites

I asked my host if there were limitations and this is what they replied:

 

No, the limit your hitting it for having too many database connections open at a single time. A well optimized site's database connections should open and close in milliseconds. So in order to hit this limit they must be staying open longer than normal. The MYSQL Slow queries logs in the tmp folder on the server, records any mysql connection that stay open longer than normal. So checking those logs would be a good place to start.

Link to comment
Share on other sites

So they did not answer the question, they said you hit the limit, but did not say what the limit is.  Is it 10 connections, 20, 100...

 

I would reply and have them give you a specific answer as to how many connections they are restricting you to.  Once you know the answer, you then need to determine how many visitors are coming to your site each hour/minute/second.  You can use google analytics for this. 

 

Caching aside and in simple terms, think of each visitor to your site as 1 mysql connection.  If you have 10 visitors on your site at the same time, then you need 10 connections open at the same time.  20 visitors, 20 connections. 

 

This is a wordpress article, but is a decent read for understanding visitor and server resources.  The concepts would apply to Prestashop

http://codex.wordpress.org/High_Traffic_Tips_For_WordPress

 

Now you may have an issue as they describe where queries are running too long and the connection is staying open too long, or maybe you have a module or some other process that is opening the connection and never closing it.  That is going to take a lot of trial and error to locate, and someone with a lot of experience with this type of analytical skill

 

But you really need to determine first

1) how many visitors you expect to have on your site.  What is your typical visitor count, and then what is your peak visitor count.  And then project out a few months... do you plan to run any marketing campaigns (ie..  groupon or google adwords) that would generate a lot of traffic?  No use creating a website that can only handle 1000 visitors when you expect to receive 100,000 visitors.  I am inflating the numbers here so you hopefully see the problem

 

 

2) do you have enough resources allocated to you (cpu, memory, etc..) to handle this volume.  With the information from #1, you need to have your host confirm that they can handle this volume.

 

So if you determine that you have at peak times, 20 concurrent visitors on your site, and the host says you are restricted to 10 connections... well it may be time to find a new host.

  • Like 2
Link to comment
Share on other sites

  • My latest conversation with them:

     

    I've been asking around for help. One question they want to know is what exactly is my limit? In your note above you state "in order to his this limit"...

     
     
  • 10671261_809188699102748_311546543627313
    Bluehost

    Hello Katherine,

    Good question. Your limit is 15 concurrent connections in your mysql database. Hope that information helps. Thanks for checking back with us and let us know if you need anything else.

     
     
  • 10556320_10152382721284888_4729405539325
    Katherine Trossen-Lusiak

    OMG, 15 is nothing. I have 1,500+ customers. How can I get this limit lifted???

     
     
  • 10671261_809188699102748_311546543627313
    Bluehost

    No, once again this is only for your database connections that are taking to longer to open/close. It's not the amount of customers that can be on your site. You'll need to forward this information to your developers so that they can help you optimize your current code/script to help those connections close more quickly.

    Social Media Support

Link to comment
Share on other sites

Ok, now read the rest of my previous post and figure out how many concurrent visitors you have.  Having 1500 customers does not mean you have 1500 customers all visiting your site at the same time.

 

If you have 16 concurrent visitors (they may be customers or potential customers or just someone visiting) then you will exceed their restriction.  A search engine bot is also considered a visitor, basically anyone going to any page on your site is going to take 1 of those available 15 connections.

Link to comment
Share on other sites

Sorry a lot of this is just over my head.  I am not a website tech and I'm trying to deal with my children, customers, etc.  According to my Prestashop Dashboard I've had 96 visitors in the last 120 minutes if that helps.   :(

you should be doing research to determine how many people visit your website.  Do you even know if 96 visitors over 2 hours is a lot for your store? 

 

you have been giving a wealth of information, yet I am not seeing you take any initiative to figure this out.

  • Like 1
Link to comment
Share on other sites

Thank you everyone.  I'm trying to find someone who can answer some of these questions for me.  Like I said this is all a little above my area of expertise and I do not have the time needed to answer your questions.  I was hoping it would be a quick fix.  :(    -Katherine

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...