ispCP - Board - Support
ispcpphptemp - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: Usage (/forum-34.html)
+--- Thread: ispcpphptemp (/thread-8169.html)

Pages: 1 2


ispcpphptemp - givre - 10-20-2009 05:11 AM

Hi all,

Can you explain to mee what ispcphptemp.sh really do ?
i have got a big problem on my server, it's cause load.. very hight..

Firts i'm was thinking that was because i had more than 3000 accounts, but on a fresh install without any account there is the same problem.

It dont kill itself.. why ?

Thanks for you help.

Regards,
Benoit.

Code:
root     15083  0.0  0.0   8832  1140 ?        Ss   15:00   0:00 /bin/sh -c /var/www/ispcp/engine/tool /ispcpphptemp.sh >/dev/nul
root     15085  0.0  0.0   8840  1160 ?        S    15:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15097  0.0  0.0   8840   652 ?        S    15:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15126  0.0  0.0 113160  1008 ?        S    15:30   0:00 /USR/SBIN/CRON
root     15127  0.0  0.0   8832  1144 ?        Ss   15:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15130  0.0  0.0   8840  1160 ?        S    15:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15141  0.0  0.0   8840   652 ?        S    15:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15173  0.0  0.0 113160  1008 ?        S    16:00   0:00 /USR/SBIN/CRON
root     15174  0.0  0.0   8832  1140 ?        Ss   16:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15176  0.0  0.0   8840  1164 ?        S    16:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15187  0.0  0.0   8840   656 ?        S    16:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15217  0.0  0.0 113160  1008 ?        S    16:30   0:00 /USR/SBIN/CRON
root     15218  0.0  0.0   8832  1140 ?        Ss   16:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15220  0.0  0.0   8840  1164 ?        S    16:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15232  0.0  0.0   8840   656 ?        S    16:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15264  0.0  0.0 113160  1008 ?        S    17:00   0:00 /USR/SBIN/CRON
root     15265  0.0  0.0   8832  1144 ?        Ss   17:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15268  0.0  0.0   8840  1160 ?        S    17:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15279  0.0  0.0   8840   652 ?        S    17:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15308  0.0  0.0 113160  1008 ?        S    17:30   0:00 /USR/SBIN/CRON
root     15309  0.0  0.0   8832  1144 ?        Ss   17:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15312  0.0  0.0   8840  1164 ?        S    17:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15319  0.0  0.0   8840   656 ?        S    17:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15355  0.0  0.0 113160  1008 ?        S    18:00   0:00 /USR/SBIN/CRON
root     15356  0.0  0.0   8832  1140 ?        Ss   18:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15358  0.0  0.0   8840  1160 ?        S    18:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15370  0.0  0.0   8840   652 ?        S    18:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15406  0.0  0.0 113160  1008 ?        S    18:30   0:00 /USR/SBIN/CRON
root     15407  0.0  0.0   8832  1144 ?        Ss   18:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15410  0.0  0.0   8840  1164 ?        S    18:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15421  0.0  0.0   8840   656 ?        S    18:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15453  0.0  0.0 113160  1008 ?        S    19:00   0:00 /USR/SBIN/CRON
root     15454  0.0  0.0   8832  1144 ?        Ss   19:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15456  0.0  0.0   8840  1160 ?        S    19:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15467  0.0  0.0   8840   652 ?        S    19:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15497  0.0  0.0 113160  1008 ?        S    19:30   0:00 /USR/SBIN/CRON
root     15498  0.0  0.0   8832  1144 ?        Ss   19:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15501  0.0  0.0   8840  1164 ?        S    19:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15512  0.0  0.0   8840   656 ?        S    19:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15544  0.0  0.0 113160  1008 ?        S    20:00   0:00 /USR/SBIN/CRON
root     15545  0.0  0.0   8832  1140 ?        Ss   20:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15547  0.0  0.0   8840  1164 ?        S    20:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15556  0.0  0.0   8840   656 ?        S    20:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15602  0.0  0.0 134828  5104 ?        S    20:25   0:00 /usr/sbin/apache2 -t
root     15612  0.0  0.0 113160  1008 ?        S    20:30   0:00 /USR/SBIN/CRON
root     15613  0.0  0.0   8832  1140 ?        Ss   20:30   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15616  0.0  0.0   8840  1160 ?        S    20:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15627  0.0  0.0   8840   652 ?        S    20:30   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15696  0.0  0.0 113160  1008 ?        S    21:00   0:00 /USR/SBIN/CRON
root     15697  0.0  0.0   8832  1144 ?        Ss   21:00   0:00 /bin/sh -c /var/www/ispcp/engine/tools/ispcpphptemp.sh >/dev/nul
root     15700  0.0  0.0   8840  1160 ?        S    21:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh
root     15709  0.0  0.0   8840   652 ?        S    21:00   0:00 /bin/bash /var/www/ispcp/engine/tools/ispcpphptemp.sh



RE: ispcpphptemp - kilburn - 10-20-2009 05:26 PM

It's supposed to remove the hanging session files from php. If it's not working properly for you, please report everything that can help us identify the issue, including at least:

1. OS/Distro
2. Ispcp version
3. Execution strace


RE: ispcpphptemp - givre - 10-20-2009 08:42 PM

Hi,

Quote:1. OS/Distro
Debian 5 lenny

Quote:2. Ispcp version
2 lasted version
1.2 and 1.3

Quote:3. Execution strace
Here the file Smile

For my two systems they are alway processing, never stop (for each)
At every cron, another ispcpphptemp is running so it takes lot of cpu/ram

With the last ISPCP version, there is just one account ..
Is a fresh install on virtual server who using NFS for /var/www/virtual

On the other system, there is 3000 accounts.
On this system i have to process the ispcphptemp.sh just one per days.. otherwise all others process can't work correctly with a lot of ispcphptemp.sh running.

Thanks


RE: ispcpphptemp - givre - 10-21-2009 04:22 AM

Here the strace file Smile

Thank you for your help.

Best Regards,
Benoit.


RE: ispcpphptemp - kilburn - 10-21-2009 05:55 PM

It seems that your server has a problem with:
Code:
for ini in "${fcgidir}/php4/php.ini ${fcgidir}/php5/php.ini"; do
        if [ ! -f "$ini" ]; then
                continue;
        fi
....

This should loop two times, one with ini = /var/www/fcgi/domain.tld/php4/php.ini and another with ini = /var/www/fcgi/domain.tld/php5/php.ini. Now, looking at your trace file, we see the following:

Code:
stat("/var/www/fcgi/master/php4/php.ini /var/www/fcgi/master/php5/php.ini", 0x7fffb8768440) = -1 ENOENT (No such file or directory)

So it's checking both files as if they were a single one. AFAIK, the script file is correctly assuming that they would be treated as separate entries, and the only thing that could change that is the setup of the IFS environment variable. Therefore, I would try the following things:

1. As you don't have php4, just remove the "${fcgidir}/php4/php.ini " part from the "for" lines (note that there are two fors like this in the script). After that, try to re-execute (don't have to wait for cron, just do it manually) and see if it now ends in a reasonable time...

2. Once you've ensured that this is actually the problem, recover the original script and add
Code:
IFS=" "
at the beggining of it, to ensure that spaces are detected as "item separators".

If it works when using the second method, I'll patch the script accordingly Wink


RE: ispcpphptemp - givre - 10-22-2009 06:35 AM

Hi,

Thank you for your great support.

That is good if i keep out "${fcgidir}/php4/php.ini" part from the "for" lines

But, if i add
Quote:IFS=" "

The script do nothing Sad


RE: ispcpphptemp - kilburn - 10-22-2009 04:47 PM

I don't know what else could be causing this. Can you confirm that, when manually executing
Code:
for f in "/php4/php.ini /php5/php.ini"; do echo $f; done
you get
Code:
/php4/php.ini /php5/php.ini
instead of
Code:
/php4/php.ini
/php5/php.ini
please?

Anyways, take into account that this script stats *all* files inside each and every customer phptmp folder. These are a bunch of files/folders to stat in your heavily loaded server, so if they are stored in an NFS server this is may also cause some slowness.

Thus, unless you really need temporary files stored in the server for some reason (load balancing?), I would try to offload such files to a local disk. You should be able to do this by:

1. Moving all the phptmp folders to another (local disk) location
2. Symlinking the old location to the newer one
3. Ensuring that php lets users access this folder. I'm not sure about this, but you may have to modify customer's php.ini to allow the new (local disk) location in "open_basedir".

Further, as a side effect your websites should also work faster, because now php sessions won't be stored in the NFS server but in the local disk Wink Whatever you decide to try... test first! Wink


RE: ispcpphptemp - givre - 10-22-2009 05:21 PM

Code:
for f in "/php4/php.ini /php5/php.ini"; do echo $f; done
I get
Code:
/php4/php.ini /php5/php.ini

On my principal server, i'm not using NFS Wink
But i will do that if i use NFS and make phptmp localy

But i dont understand why, if i put this :
Code:
IFS=" "

The script dont check every customer phptmp ... and is runni 1second :s

Thank You Smile


RE: ispcpphptemp - kilburn - 10-22-2009 08:23 PM

Nevermind about the "IFS" thing, as it's a stupid fault on my side. Your bash behaviour is actually good, and there's an error on the ispcpphptmp.sh script that I've just fixed in trunk.

Now, if you run the script twice in a very short time, the second run is expected to end almost instantly because the file properties are already in the disk cache (left there by the previous execution). If you wait some minutes, they'll have been removed from the cache and will need to be read from disk again ("stat"ing a lot of files is the slow part of this script).

That said, I would need a trace of one of this "never ending" processes to actually see what's happening there (the trace you posted earlier is from an execution which finished correctly, right?).


RE: ispcpphptemp - givre - 10-22-2009 08:37 PM

Quote:The trace you posted earlier is from an execution which finished correctly, right?).

Yes it is Smile
But when is not finish is unfortunatly on strange hours of day

So, i had 2 solutions:

1- I dont modify ispcpphptmp.sh
I'm wating for have some ispcpphptmp.sh in same time how dont finish correctly and i make a trace

2- I make change like this
Code:
remove the "${fcgidir}/php4/php.ini " part from the "for" lines

I will see