I am facing some occasional database related issues for my app, where more than half a million users are registered, a few thousand of requests coming every minute to the server the app performs very well and server response time is good but every day for some time the database related errors start popping, I have attached a few screenshots of different kind of errors The database is MySQL(v5.7) and the backend is running on Codeigniter3 (PHP v5.6) I believe it happens during the peak usage period mostly in the evening
Showing the connectivity error which comes quite often when the problem starts happening]:
The error says
Unable to connect to your database server using the provided settings
Filename: third_party/MX/Base.php
Line Number: 55
The above error may look like the configuration settings are incorrect but the application runs fine with the same settings
This is another error which appears sometimes:
Error Number: 9001
Max connect timeout while reaching hostgroup 11 after 11043ms
SELECT * FROM `uc_role_rights` WHERE `user_role_id` = '1' AND `module_id` = 18 AND `module_view` = 1
Filename: modules/settings/models/Settings_model.php
Line Number: 100
Few more information which may help you to understand it
- max_connections is set to 151
- In Codeigniter's database connection configuration
pconnect
is set to FALSE- Used
dbdriver
ismysqli
- Database hosted on 'localhost'
I'd appreciate any help to reach to the root of the problem. Thanx