Current time: 11-29-2024, 09:04 AM Hello There, Guest! (LoginRegister)


Post Reply 
Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Author Message
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #1
Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Welcome,

One of my users get trouble with his application using ispCPOmega.

He run some external programs using shell_exec, but execution of that commands took about 4 - 10 minutes.
In this time, application have to be working, with established database connection, after fetching result decide what to do next...


My first step like sys admin was configure in php.ini of his file right amount of resources (ram) and allocate additional time limit for executing his application.

Thats how it looks:
Code:
max_execution_time = 2200;    
max_input_time = 2200;  
memory_limit = 2512M;


But he still got errors about Internal Server Error 500.
So i check log files and found that reason is too short time of execution fcgi.

So i made little changes in file called
Code:
/etc/apache2/ispcp/DOMAIN_NAME.conf

That's how it looks after my changes:

Code:
# Any changes made to this file will be preserved.
# ispCP doesn't and won't verify the contents of this file.
#
# This file should NOT be deleted, otherwise apache will fail to start
#
<IfModule mod_fcgid.c>
  AddHandler fcgid-script .php .php5
  SocketPath /var/lib/apache2/fcgid/sock
  IdleTimeout 36000
  IdleScanInterval 32400
  BusyTimeout 33000
  BusyScanInterval 320
  ErrorScanInterval 6
  ZombieScanInterval 30
  ProcessLifeTime 7200
  SpawnScoreUpLimit 100
  SpawnScore 1
  TerminationScore 2
  MaxProcessCount 250
  DefaultMaxClassProcessCount 1000
  DefaultMinClassProcessCount 0
  IPCConnectTimeout 3600
  IPCCommTimeout 72000
  MaxRequestsPerProcess 5000
</IfModule>


I had rebooted server several times.
But my user still getting Internal Server Error 500...
And log files says:
Code:
[Tue Feb 23 22:30:35 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7401) exit(communication error), terminated by calling exit(), return code: 0
[Tue Feb 23 22:31:23 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7302) exit(idle timeout), terminated by calling exit(), return code: 0
[Tue Feb 23 22:33:23 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7337) exit(idle timeout), terminated by calling exit(), return code: 0
[Tue Feb 23 22:41:02 2010] [notice] mod_fcgid: call /var/www/virtual/domain_name/htdocs/converter.php with wrapper /var/www/fcgi/domain_name/php5-fcgi-starter
[Tue Feb 23 22:41:35 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7394) exit(communication error), terminated by calling exit(), return code: 0
[Tue Feb 23 22:41:35 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7342) exit(communication error), terminated by calling exit(), return code: 0
[Tue Feb 23 22:42:02 2010] [notice] mod_fcgid: call /var/www/virtual/domain_name/htdocs/converter.php with wrapper /var/www/fcgi/domain_name/php5-fcgi-starter
[Tue Feb 23 22:42:17 2010] [notice] mod_fcgid: process /var/www/virtual/domain_name/htdocs/converter.php(7721) exit(communication error), terminated by calling exit(), return code: 0


exit(idle timeout)

If someone have any idea... i'm open, i will listen to anything...

Regards :-(
02-24-2010 08:19 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #2
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
AFAIK, different fcgid versions support different subsets of directives in the VirtualHosts sections. This is, depending on your fcgid version, it is possible that a "BusyTimeout" directive inside a "VirtualHost" section (as you have it) does not override the base "BusyTimeout" set globally.

Try to apply your modified settings globally (in the /etc/apache2/mods-enabled/fcgid_ispcp.conf file) and see if it makes a difference. If true, you've found the problem. Otherwise you got me! Tongue
02-24-2010 11:41 AM
Visit this user's website Find all posts by this user Quote this message in a reply
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #3
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Welcome.


I just now try Your solution.

First i edit global file
Code:
/etc/apache2/mods-enabled/fcgid_ispcp.conf

Now it have following content
Code:
<IfModule mod_fcgid.c>
  AddHandler fcgid-script .php .php5
  SocketPath /var/lib/apache2/fcgid/sock
#  IPCConnectTimeout 200
# IPCCommTimeout 600
IPCConnectTimeout 1200
IPCCommTimeout 1200

</IfModule>

After change, reboot server.


When it start, i run test script and found following errors:

Code:
[Thu Feb 25 18:21:48 2010] [notice] mod_fcgid: process /var/www/virtual/DOMAIN_NAME/htdocs/converter.php(31397) exit(communication error), terminated by calling exit(), return code: 0
[Thu Feb 25 18:21:48 2010] [notice] mod_fcgid: process /var/www/virtual/DOMAIN_NAME/htdocs/converter.php(18361) exit(communication error), terminated by calling exit(), return code: 0
[Thu Feb 25 18:22:00 2010] [notice] mod_fcgid: process /var/www/virtual/DOMAIN_NAME/htdocs/converter.php(26067) exit(communication error), terminated by calling exit(), return code: 0


So it still don't work like I want.

Do you have any other ideas ?
Is there any diagnostic tool what will show current configuration of fcgi ?
- maybe then we find what's wrong with timeout...

Regards
02-26-2010 03:41 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #4
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Apply all your settings, not just these two (at least BusyTimeout is required too). I'm afraid that I don't know any way to display fcgid's effective configuration :S
02-26-2010 05:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #5
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
Do You know what kilburn ?
After putting all my code and of course reboot i think it start's working.


I don't want be happy to soon but as i said it's look working.

I think Your solution help, Thank you Wink

But i still can't understand why... why when i put these lines in config of "website" it wont work...
I know that master override slave config files, but if master was empty... why that don't use all parameters from slave ?

Who knows... Smile

Regards
02-26-2010 06:34 AM
Find all posts by this user Quote this message in a reply
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #6
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
After one day... stop working...

Code:
/converter.php(13926) exit(communication error), terminated by calling exit(), return code: 0

Same error...

I have no idea...

   
02-28-2010 06:14 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #7
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
First of all, check that the config hasn't been regenerated by the panel (reloading the previous settings or something).

As a workaround for this user, you might allow his website to execute external applications (see disabled_functions in php.ini). Then, he can call his converter script from the website by forking (double-forking might be necessary here) to the background and letting the conversion script just run without stopping the frontend script. The first thing to try would be just running something like:
Code:
exec('/path/to/background/converter.php file.input file.output 2>&1 >/path/to/stdout.file &');
03-01-2010 10:48 AM
Visit this user's website Find all posts by this user Quote this message in a reply
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #8
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
I checked config files, there are not changed after reboot.
Everything look like in posts above.

kilburn - My user already use shell_exec.


I have also try edit edit fcgi starter.

Code:
/var/www/fcgi/MY_DOMAIN/php5-fcgi-starter
And added

Code:
PHP_FCGI_TIMEOUT=1200
export PHP_FCGI_TIMEOUT


But it won't help...
Question remain open :-(

Regards
03-02-2010 05:31 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #9
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
The final "&" appended to the command is the key here. It's supposed to relieve the command to the background, so that the fcgi call can end as expected while the converter keeps working until finishing...
03-02-2010 06:10 AM
Visit this user's website Find all posts by this user Quote this message in a reply
circut_breaker Offline
Junior Member
*

Posts: 11
Joined: Feb 2010
Reputation: 0
Post: #10
RE: Long time execution -exit(idle timeout), terminated by calling exit(), return code: 0
I see Your point but it's override trouble not solve.
I need solution for my problem, many people around the world use fcgi for conversion and i don't see why it shouldn't work longer than few minutes...

I need have running php because i want grab output
Code:
$output = shell_exec('something');

And after finish i want import that output into database...

I know i can rewrite whole application, and execute commands like that
Quote:$output= shell_exec('sometghing > output.txt');
and ever if php / fcgi will be killed i can re-spawn it and read output.txt to get status...


I know, i can workaround this... but why... it should work... and i want it in normal way...
03-03-2010 10:33 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)