Welcome Guest, Not a member yet? Register   Sign In
Too many processes = very slow site
#1

[eluser]medvind[/eluser]
Hello!
I have a self made web shop built on CodeIgniter, with order and product administration functions. Sometimes when using these functions the entire website, but especially the admin pages, get very, very slow. phpMyAdmin is also very slow. Sometimes it all borders on being unusable because of the load times.

Unfortunately I don't have access to error logs as the shop is hosted by a web hotel, but I've been told there were too many processes running, resulting in errors like this:

Code:
[notice] mod_fcgid: too many /opt/php-wrapper/[username]/php-
wrapper processes (current:5, max:5), skip the spawn request

My host has raised the maximum number of processes to 10 (from 5) but the problem is still not resolved.

Once when I had to process a couple of thousands of rows in a database table (and run one insert operation for each row), I noticed that even though the PHP script was finished, the changes hadn't yet been made to the database. Each time I refreshed the table there would be new changes made.

What might be the problem? I run CodeIgniter 1.7.1 on a server with PHP 5.2.14, MySQL 5.0.45 (using MyISAM). Please tell me what I'm doing wrong! (or could be doing better)
#2

[eluser]n0xie[/eluser]
[quote author="medvind" date="1282242193"]
Once when I had to process a couple of thousands of rows in a database table (and run one insert operation for each row), I noticed that even though the PHP script was finished, the changes hadn't yet been made to the database. Each time I refreshed the table there would be new changes made.
[/quote]
Seems to me your database couldn't keep up and instead queued your queries.

Quote:What might be the problem? I run CodeIgniter 1.7.1 on a server with PHP 5.2.14, MySQL 5.0.45 (using MyISAM). Please tell me what I'm doing wrong! (or could be doing better)
The first thing that comes to mind is that your database has too much to do and is therefore slowing you down. But this is just a guess.

Take a look at the profiler. Find the bottle neck. We can't give advice on mere guesses.
#3

[eluser]Unknown[/eluser]
Sounds like the database server is your bottleneck. Is it physically on the same hardware as the web server?
#4

[eluser]pickupman[/eluser]
As noxie mentioned:
Code:
$this->output->enable_profiler(TRUE);

When any troubleshooting, try to isolate where the problem is coming from. What happens when you run the site locally like on a desktop/laptop?
#5

[eluser]echoDreamz[/eluser]
Seems that the webserver / fastCGI controller is asking for a new fastCGI PHP process to start as the load for each of the other processes is over the max requests / queue config value.

IE Say the limit is 100 requests / process, if your site gets 500 requests, it will try to launch more processes (assuming you have more to give) to handle the extra requests.

I do not know how the specifics of *nix based items work though. IIS / Windows fastCGI module for PHP is quite similar. If you are running a large site (or many sites under 1 user) that have alot of traffic then the issue may simply be you need to either 1) Move to a shared host that can deliver what you want, or 2) Move to a managed dedicated solution like a VPS, unless of coarse you can setup your own box in which case you dont need managed.

Although 5 PHP processes for a single user is quite alot, 10 is crazy. Unless your running many websites that require PHP under 1 user.




Theme © iAndrew 2016 - Forum software by © MyBB