MySQL consume all my CPU - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: MySQL consume all my CPU (/showthread.php?tid=66229) |
MySQL consume all my CPU - Compra Venta Cuba - 09-24-2016 Hi, I have a production website since two years ago. Bachecubano.com is a classiffieds website with a new and a improved functionalities to bring more power to the Buy & Sell in Cuba and Miami. But in the last month I study some SEO thecniques that explode the visits to the website and then become the "Can't connect to the DB" error due to overloaded connections. ¿Hoy do I fix this? It seem to be a lot of users navigating the site. This is the config database: $db['mocha'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'bache', 'password' => 'dtyjtyj', 'database' => 'bache6', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => APPPATH . 'cache', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => FALSE ); What I doing wrong? I have a VPS with 4Gb RAM and 4 cores. Sometoimes in the project I made some Joins, but I cant believe that 100 concurrent users consume all this. This is the "top command in console" 31814 mysql 20 0 714m 201m 9124 S 49.5 9.6 248:10.89 mysqld 31814 mysql 20 0 714m 200m 9124 S 26.9 9.5 249:13.02 mysqld RE: MySQL consume all my CPU - Paradinight - 09-25-2016 The default connection limit is 151 (100 in early versions). https://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html RE: MySQL consume all my CPU - Compra Venta Cuba - 09-25-2016 Thanks!, the issue was related with a bad INDEX configuration in a deep query. Solved! Thaks! RE: MySQL consume all my CPU - zurtri - 09-25-2016 Im glad it was solved. I had a similiar problem and the solution was to enable and then investigate the Slow Query Log. http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html Obviously not a help here - but could possibly help someone else. RE: MySQL consume all my CPU - Compra Venta Cuba - 09-27-2016 Yes, it helps. I still checking that file every two days. Thanks! |