Welcome Guest, Not a member yet? Register   Sign In
Too many sleeping mysql processes using codeigniter
#1

[eluser]Christophe28[/eluser]
Hi,

Yesterday my database server crashed. When checking the list of mysql processes I noticed there where only processes started by the dbuser of my codeigniter website (in developing)

Each time I make a request by the codeigniter website, mysql starts a new process and set the command to sleep. Also there is a busy website (phpbb forum) on the same dbserver, and that works fine, so the mysql.conf is probably set correctly.

After searching the internet I found this post claiming I had to set the $db['default']['pconnect'] value in application/config/database.php to FALSE ... and it works!

I'm new in codeigniter so I'm not sure this is the correct solution? Can anybody explain how come there is a 'sleeping' process started?

Thx!
#2

[eluser]n0xie[/eluser]
It is a bug in the way Apache and MySQL work. Unless you set it up 'just' right, Apache will spawn a new process for each new request, which has a different ID, so a new MySQL thread is started. So yeah setting pconnect to FALSE solves this, although if you want to use pconnect you need to setup Apache and MySQL correctly.
#3

[eluser]Christophe28[/eluser]
Hi,

I use Nginx (which I love btw) but that does probably the same thing.

Thx for the reply! Good to know :-)

Best,
Christophe




Theme © iAndrew 2016 - Forum software by © MyBB