Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
  1. #11
    Join Date
    Apr 2008
    Location
    Qld, Australia
    Posts
    303
    Plugin Contributions
    6

    Default Re: User already has more than 'max_user_connections

    Quote Originally Posted by torvista View Post
    I would be interested to know what value others have if they are using shared servers (where there is no user control over this parameter/it's set by the hosting).

    This is shown in the ZC Admin->Tools->Server/Version Info, search for "max_user_connections".

    Our local test servers default to $nbsp; for zc158 and zc158a or display nothing with zc200.

    Production servers running on virtual hosts default to $nbsp; for zc158 and zc158a
    OldNGrey
    ZC158a PHP 8.2.15
    MySQL 10.6.16-MariaDB

  2. #12
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,731
    Plugin Contributions
    30

    Default Re: User already has more than 'max_user_connections

    If no number is shown, it's because it is 0 which is no limit (https://github.com/zencart/zencart/issues/6228).
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  3. #13
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,731
    Plugin Contributions
    30

    Default Re: User already has more than 'max_user_connections

    I'll note that my hosting company has their shared server option limited to 25.
    I was getting errors from this so moved to their VPS option with no limit/my limit. No errors since.

    For interest I reduced this to 25 recently. No errors since, so I'm assuming it was some external factors triggering those errors on the shared server.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  4. #14
    Join Date
    Apr 2019
    Posts
    279
    Plugin Contributions
    0

    Default Re: User already has more than 'max_user_connections

    Quote Originally Posted by mikebr View Post
    To rotate randomly, I'm trying the following:
    Code:
    $dbusers = array(
    array('user' => 'mysql_username_1', 'password' => 'mysql_password_1') // First MySQL user/password combination
    , array('user' => 'mysql_username_2', 'password' => 'mysql_password_2') // Second MySQL user/password combination
    , array('user' => 'mysql_username_3', 'password' => 'mysql_password_3') // Third MySQL user/password combination
    );
    $mysql_user = $dbusers[rand(0, count($dbusers) - 1)];
    define('DB_SERVER_USERNAME', $mysql_user['user'];
    define('DB_SERVER_PASSWORD', $mysql_user['password'];
    Hi. I just tried your code with zc1.58a with php 8.1, and it worked great except one typo... Here is the updated code:

    Code:
    $dbusers = array(
    array('user' => 'mysql_username_1', 'password' => 'mysql_password_1') // First MySQL user/password combination
    , array('user' => 'mysql_username_2', 'password' => 'mysql_password_2') // Second MySQL user/password combination
    , array('user' => 'mysql_username_3', 'password' => 'mysql_password_3') // Third MySQL user/password combination
    );
    $mysql_user = $dbusers[rand(0, count($dbusers) - 1)];
    define('DB_SERVER_USERNAME', $mysql_user['user']);
    define('DB_SERVER_PASSWORD', $mysql_user['password']);

  5. #15
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,731
    Plugin Contributions
    30

    Default Re: User already has more than 'max_user_connections

    >Hi. I just tried your code with zc1.58a with php 8.1, and it worked great

    You mean you've stopped getting the error logs?
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  6. #16
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,731
    Plugin Contributions
    30

    Default Re: User already has more than 'max_user_connections

    So my site was killed over the last couple of days, CPU and memory shot up to 100%
    Name:  2024-06-29 18_25_10-cPanel - Resource usage.jpg
Views: 44
Size:  22.3 KB

    I got the server log and examined the hits per minute by counting the rows:
    hour min rows
    10 35 135
    10 36 99
    10 37 177
    10 38 128
    10 39 319
    10 40 279
    10 41 212
    10 42 190
    10 43 132

    Just from this I don't think this is excessive.
    Anyway, examining in detail 10.39 I find it to be mainly

    but the hits are at most 3 per second. Again, this does not seem excessive enough to max out the cpu/memory.

    max_user_connections is at 30.

    I'm using three mysql users, rotating randomly as above: if I used only one, the site page would show the database connection error.

    There are always two errors

    --> PHP Warning: mysqli_connect(): (HY000/1203): User tienda_user1 already has more than 'max_user_connections' active connections in includes/classes/db/mysql/query_factory.php on line 86.

    and

    [29-Jun-2024 14:24:37 Europe/Madrid] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1203] User tienda_user1 already has more than 'max_user_connections' active connections in ...../laravel/vendor/illuminate/database/Connectors/Connector.php:70
    Stack trace:

    followed by a load of laravel trace.

    I assumed the second debug was just the result of the first....

    But, my site has never had these problems until the last couple of years.

    Is it possible that the addition of Laravel has introduced some performance issue that only shows up on these more restricted servers?

    There are multiple threads on this max_user_connections error.

    I would note that my site while being heavily customised, is using the GitHub development code.

    I don't think I can take this any further apart from upping the server spec, but maybe that is just masking a problem.

    I'm open to dev suggestions as to what more can be done to investigate further, or if the above traffic and result is not unreasonable.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  7. #17
    Join Date
    Apr 2019
    Posts
    279
    Plugin Contributions
    0

    Default Re: User already has more than 'max_user_connections

    Quote Originally Posted by torvista View Post
    >Hi. I just tried your code with zc1.58a with php 8.1, and it worked great

    You mean you've stopped getting the error logs?
    Yes, the mod in this thread definitely helps. But my issue is intermittent anyway. It looks like some hackers tried to attack my site via DDoS sometimes.

  8. #18
    Join Date
    Apr 2019
    Posts
    279
    Plugin Contributions
    0

    Default Re: User already has more than 'max_user_connections

    Quote Originally Posted by torvista View Post
    So my site was killed over the last couple of days, CPU and memory shot up to 100%
    Name:  2024-06-29 18_25_10-cPanel - Resource usage.jpg
Views: 44
Size:  22.3 KB

    I got the server log and examined the hits per minute by counting the rows:
    hour min rows
    10 35 135
    10 36 99
    10 37 177
    10 38 128
    10 39 319
    10 40 279
    10 41 212
    10 42 190
    10 43 132

    Just from this I don't think this is excessive.
    Anyway, examining in detail 10.39 I find it to be mainly

    but the hits are at most 3 per second. Again, this does not seem excessive enough to max out the cpu/memory.

    max_user_connections is at 30.

    I'm using three mysql users, rotating randomly as above: if I used only one, the site page would show the database connection error.

    There are always two errors

    --> PHP Warning: mysqli_connect(): (HY000/1203): User tienda_user1 already has more than 'max_user_connections' active connections in includes/classes/db/mysql/query_factory.php on line 86.

    and

    [29-Jun-2024 14:24:37 Europe/Madrid] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [1203] User tienda_user1 already has more than 'max_user_connections' active connections in ...../laravel/vendor/illuminate/database/Connectors/Connector.php:70
    Stack trace:

    followed by a load of laravel trace.

    I assumed the second debug was just the result of the first....

    But, my site has never had these problems until the last couple of years.

    Is it possible that the addition of Laravel has introduced some performance issue that only shows up on these more restricted servers?

    There are multiple threads on this max_user_connections error.

    I would note that my site while being heavily customised, is using the GitHub development code.

    I don't think I can take this any further apart from upping the server spec, but maybe that is just masking a problem.

    I'm open to dev suggestions as to what more can be done to investigate further, or if the above traffic and result is not unreasonable.
    I got the same issue from facebookexternalhit recently, so I blocked it in htaccess file using RewriteCond %{HTTP_USER_AGENT}. I suspected facebookexternalhit was hacked somehow.

  9. #19
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,731
    Plugin Contributions
    30

    Default Re: User already has more than 'max_user_connections

    In the end I moved to a server without the low restrictions....end of error logs and site disappearing.
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v154 Concurrent admin access / more than one simultaneous user
    By Haggis in forum Customization from the Admin
    Replies: 2
    Last Post: 1 May 2016, 09:38 PM
  2. Replies: 7
    Last Post: 9 Jul 2015, 10:04 PM
  3. Why have more than one admin user?
    By edwinlloyd in forum Basic Configuration
    Replies: 4
    Last Post: 26 Aug 2010, 11:00 AM
  4. How to set up different shipping options than what UPS has already?
    By bnieukirk in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 6 Sep 2009, 06:03 AM
  5. Customer bought more than the stock has, how?
    By yellow1912 in forum General Questions
    Replies: 3
    Last Post: 26 Jan 2007, 03:41 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR