• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MySQL consume all my CPU

#1
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
PHP Developer. Codeigniter Fan. Family Lover.
Reply

#2
The default connection limit is 151 (100 in early versions).

https://dev.mysql.com/doc/refman/5.5/en/...tions.html
Reply

#3
Thanks!, the issue was related with a bad INDEX configuration in a deep query. Solved!

Thaks!
PHP Developer. Codeigniter Fan. Family Lover.
Reply

#4
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/s...y-log.html

Obviously not a help here - but could possibly help someone else.
Reply

#5
Yes, it helps. I still checking that file every two days. Thanks!
PHP Developer. Codeigniter Fan. Family Lover.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.