So my site was killed over the last couple of days, CPU and memory shot up to 100%
Attachment 20675
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.