LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [solved] Retry with new instance.

Reply
 
Thread Tools Display Modes
  #11  
Old 01-17-2011, 08:59 PM
IanD IanD is offline
Member
 
Join Date: Sep 2010
Posts: 41
That would be ideal.

I see now it's not so much the 'retrying' that is the problem, because even if LiteSpeed didn't retry the process - the process would have stopped at the connection timeout.

If Retry Timeout (secs) worked as well though, that would be great.

Because at times mysql is under too much pressure and normal queries can back up fast. If LiteSpeed is then retrying these scripts (which run these queries) things just melt down quicker.. This might just be unique to me though and yes, I need upgrade / work on the server!

I've been using LiteSpeed since October 2010 - would this be classed as old?

I've got:

Found LiteSpeed php binary at /usr/local/lsws/fcgi-bin/lsphp5. Version is 5.3.2

Quote:
If you use latest LSAPI, and set "LSAPI_ACCEPT_NOTIFY" environment variable for lsphp external app, should remove it.
Not 100% sure what you mean here, I've got:

Code:
PHP_LSAPI_MAX_REQUESTS=500
PHP_LSAPI_CHILDREN=35
currently in my Environment. Do I add something like:

Code:
PHP_LSAPI_MAX_REQUESTS=500
PHP_LSAPI_CHILDREN=35
LSAPI_ACCEPT_NOTIFY = 1
Many thanks for your help.
Reply With Quote
  #12  
Old 01-17-2011, 09:05 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
No, do not add LSAPI_ACCEPT_NOTIFY .

check if your LSAPI version is the latest 5.5 release. if is, phpinfo() page shows it.
Reply With Quote
  #13  
Old 01-17-2011, 09:13 PM
IanD IanD is offline
Member
 
Join Date: Sep 2010
Posts: 41
Server API LiteSpeed V5.4
Reply With Quote
  #14  
Old 01-20-2011, 01:18 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
we just added new feature on 4.0.19 to address this timeout issue:
"added another special rewrite environment variable "noconntimeout", this will disable connection timeout, it will keep the connection open forever till the request complete."

for example:

RewriteRule abc.php - [E=noconntimeout:1]

please test at your end, see if it 100% resolves your issue.
Reply With Quote
  #15  
Old 01-20-2011, 03:02 PM
IanD IanD is offline
Member
 
Join Date: Sep 2010
Posts: 41
That's great - I'll test.

How do I upgrade to 4.0.19? I'm at the 'Version Management' but I don't see this option.
Reply With Quote
  #16  
Old 01-20-2011, 05:03 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
manually upgrade:

download lsws...4.0.19..tar.gz
tar zxvf lsws...4.0.19..tar.gz
cd lsws-4.0.19
./install.sh

install to same directory of past installations. select U(upgrade)
in cPanel, it's /usr/local/lsws
Reply With Quote
  #17  
Old 02-17-2011, 09:22 PM
IanD IanD is offline
Member
 
Join Date: Sep 2010
Posts: 41
The 'no connection timeout' is great for one problem but I'm still looking a solution to the

retry with new instance

problem. It don't want it to retry, I want it to hit the connection timeout and die. If it's hitting the connection timeout it means there is a problem and just retrying it only makes things worse..

In my situation with long running mysql queries anyway! I look at mytop and see 4 or 5 identical long queries running because they are from the same user and their process is just trying and retrying.

Any ideas?
Reply With Quote
  #18  
Old 02-18-2011, 12:20 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,216
I tried to set
LSAPI_MAX_PROCESS_TIME (default value: 300 seconds)
"In Self Managed Mode, LSAPI_MAX_PROCESS_TIME controls the maximum processing time allowed when processing a request. If a child process can not finish processing of a request in the given time period, it will be killed by the parent process. This option can help getting rid of dead or runaway child process."
it looks working in test environment.

your php in suExec mode or not? if not, above setting will give you an option.

update: I re-read your post:
Quote:
I look at mytop and see 4 or 5 identical long queries running because they are from the same user and their process is just trying and retrying.
it may not result of "re-try". rather, there are 4 or 5 independent requests to same page, and this page need access mysql. for each php request, lsws has to launch a lsphp process to handle it. I think the root cause is slow mysql. if you use memcache to cache the mysql query result(just for example), mysql and the whole site's performance may improve a lot.

Last edited by NiteWave; 02-18-2011 at 03:26 AM..
Reply With Quote
  #19  
Old 02-18-2011, 10:00 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Quote:
Originally Posted by IanD View Post
The 'no connection timeout' is great for one problem but I'm still looking a solution to the

retry with new instance

problem. It don't want it to retry, I want it to hit the connection timeout and die. If it's hitting the connection timeout it means there is a problem and just retrying it only makes things worse..

In my situation with long running mysql queries anyway! I look at mytop and see 4 or 5 identical long queries running because they are from the same user and their process is just trying and retrying.

Any ideas?
I am not sure those mysql queries are caused by "retry with new instance", maybe user keep trying to load that page.

There are many cases will trigger retry with new instance, mainly due to PHP crashes or exits after finishing "PHP_MAX_REQUESTS".

"retry with new instance" is to reduce 503 error as much as possible. Will see anything can be done to avoid "retry with new instance" when possible.
Reply With Quote
  #20  
Old 02-21-2011, 12:37 PM
IanD IanD is offline
Member
 
Join Date: Sep 2010
Posts: 41
No it's not the user refreshing the page that causes it - because I can replicate it and I'm not refreshing the page.

Yes, I agree to the core problem is the mysql slow query.. but at the moment is unavoidable. I just don't want it to keep retrying it.

This is what I got from the log file at the time:

Code:
2011-02-21 20:15:23.007 [NOTICE] [89.238.173.**:1399-0#APVH_] Content len: 0, Request line: 'GET /test.php HTTP/1.1'
2011-02-21 20:15:33.006 [NOTICE] [94.250.17.**:21751-0#APVH_] No request delivery notification has been received from LSAPI process:8249, possible run away process.
2011-02-21 20:15:33.006 [NOTICE] [94.250.17.**:21751-0#APVH_] Retry with new instance.
2011-02-21 20:15:54.654 [NOTICE] [89.238.173.**:1409-0#APVH_] Content len: 0, Request line: 'GET /test.php HTTP/1.1'
test.php is the script that contained my test slow mysql query.

89.238.173.** is my IP - not sure where 94.250.17.** came from. Maybe it was a coincidence (there is other traffic on the server) but it certainly looks like when it says "Retry with new instance" it's talking me and my script.

My php is in SuExec mode.

I think something like 'LSAPI_MAX_PROCESS_TIME' is what I'm looking for, I want to set that to 60 seconds and then I want the process to die (along with the mysql query).

Thanks for all your help.

Last edited by IanD; 02-21-2011 at 05:42 PM.. Reason: removed domain
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:03 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.