Welcome Guest, Not a member yet? Register   Sign In
transactions, sleeping queries and hanging php5.cgi processes
#1

[eluser]yekibud[/eluser]
I don't know if this is a CodeIgniter issue, a PHP or MySQL config issue, or something else going on with my hosting service (DreamHost), but here's the problem:

Multiple subsequent queries cause a number of php5.cgi processes to launch. They do not terminate and my web-app hangs. Looking at MySQL show processlist, I see a sleeping query for each php process.

Note:
- My MySQL tables are InnoDB so that I can use foreign key constraints for delete operations. I don't know if this makes any difference.
- PHP is being run as CGI

Everything works fine in my local development environment where I have PHP running as an Apache module.

Any tips would be greatly appreciated.
#2

[eluser]NogDog[/eluser]
If you have persistent connections enabled in your CI config, it might be worth disabling them and seeing if that makes a difference. In application/config/database.php, look for the line:
Code:
$db['default']['pconnect'] = false;
#3

[eluser]yekibud[/eluser]
Thanks for the reply, NogDog, but, yeah, disabled persistent connections in both the CI database config and the PHP init mysql.allow_persistent. No luck.
#4

[eluser]rdvade[/eluser]
I had (well, have since the solution is a compromise) this problem.
In my case it's the encrypted cookie that causes php to hang, switch it off and the thing works great. Kind of disappointing that I have to switch it off, I might email dreamhost to see if they can help - I'm sure this is on their end.
#5

[eluser]yekibud[/eluser]
I wound up compromising, too. My client needed to switch to a VPS for production, anyway - and Dreamhost allows you to run PHP as an Apache module if you have a VPS with them. That "solved" the problem for me.
#6

[eluser]rdvade[/eluser]
It seems that dreamhost have disabled switching php to run as an apache module.

If you changed it recently, did you do it through the panel, the old way (used to be a radio button for it), or is there some other way to do it?

Dreamhost don't seem to mention anywhere that they disabled it. Annoying, because the issue is there with flash videos through codeigniter if you refresh too many times when the video is playing.
#7

[eluser]yekibud[/eluser]
It's probably been moved to a feature of their VPS package. Do you have that, or just their normal shared hosting?




Theme © iAndrew 2016 - Forum software by © MyBB