I have a multisite setup running several sites. As far as I know each page request in Drupal passes through index.php. I have an issue in server I see too many index.php being executed simultaneously:

/usr/bin/php /home/username/public_html/index.php

This in turn eats up the memory and causes server to run out of memory. This issue happens off-peak hours and there is no regular pattern during which this occurs. There are no specific error messages indicated in the "Recent Log Messages".

Comments

Jaypan’s picture

It sounds like your traffic has exceeded your server's capacity to deal with it. All requests go through index.php, there isn't a way around this.

janithpunna’s picture

This issue happens even in off-peak hours. We do not have any pattern for the occurrence of this issue. This happens intermittently, once in a day or so. This lasts only for a couple of minutes bring back the memory usage to normal.

MathewEPecoraro’s picture

maybe

Sam Moore’s picture

Is most of your traffic anonymous? If so, you could put Varnish in front of your web server and handle many thousands of hits without bootstrapping Drupal at all (well, except for the first request on each page).

If you can't install Varnish you could look at the Boost module, which works well in shared environments.

MathewEPecoraro’s picture

Advice is very good

janithpunna’s picture

We have both anonymous and authenticated users. The issue occurs during off-peak hours as well. We have Nginx running in front end and Apache in the back end. We have also configured memcache for every site. We have cloud server with 8GB memory.

Can this issue occur due to some internal looping ?

Jaypan’s picture

You need to find out the exact URLs that are being accessed - this includes the $_GET variables being appended to index.php. Every Drupal process runs off index.php, so only having that information isn't enough to get an idea of what is happening.

hkdorama’s picture

How can I find it?

Jaypan’s picture

Ask your hosting company.

hkdorama’s picture

Hostgator says they cannot trace it further. All they can say is that new processes to index.php are created constantly and there are no problems on they site... Is there any way to trace the problem?

Jaypan’s picture

Time to find a new host then, because:

1) They aren't willing to help you find the issue. Telling you that the problem is with index.php, without exploring what the $_GET variables appended to the URL are, tells you nothing. And since they are not willing to do anything more, you can't fix the problem.

2) I suspect the problem is just that you are getting more traffic than your account can handle. Hostgator is the bottom of the barrel as far as hosting goes, and it's pretty easy to hit their limits. It's like trying to drive a lamborghini (drupal) on a dirt road (host gator). You're going to hit your limits pretty quick.

hkdorama’s picture

Update:
I have moved my site to localhost and it seems to work fine here.

I then optimized the databased and turned a few recent modules off and then again moved the site to the remote... Again the same problem: too many processes... What could that be?

Is there a way to test on the localhost what is happening to the site and what processes are running? I am using Acquia Dev Desktop locally.

hkdorama’s picture

I am having the same problem. The Hostgator has blocked my access to the database until I can fix the problem. But I have no idea how to troubleshoot this problem...