lsapi_backend_max_process_time
Forum
  1. Forums
  2. General
  3. General Discussion
  1. Ryan
  2. Thursday, 23 February 2017
  3.  Subscribe via email
I have some scrips that take a while to run so I had to incrase lsapi_backend_max_process_time from 300. 99.99% of the time I would like the value to be at 300. But for those few times it needs to be longer, is there some way for my php script to communicate back to lsapi that it is still working and needs more time? I tried echoing something at regular intervals to no avail.

Also, the way the this timeout works, it just kills the php process dead in it's tracks without allowing it to run any registered shutdown functions. Optimally I'd like there to be two timeouts, 1) that sends a messages to php telling it to die after X seconds, but still allows it to run cleanup functions. Then 2) one that functions like the lsapi_backend_max_process_time where it would total kill the php process immediately after X seconds.

Sidenote: the docs say the default value for lsapi_backend_max_process_time is 3600 when it is actually 300.
Rate this post:
  1. 24.02.2017 15:02:02
  2. # 1
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
Hello,

I have just clarified things with our developers and have to say that it is not possible to configure it like you want. Something like that doesn't exists.

There is a workardound for it, not elegant but one that will do a trick:

1. Set lsapi_backend_max_process_time 3600 in lsapi.conf file

2. Create .htaccess for each domain and set php_value max_execution_time 30 in it

3. When needed - increase max_execution_time for up to 3600 with .htaccess or with ini_set inside PHP script itself.

But yes, your users will be able to change it same way like you.
  1. 24.02.2017 15:02:13
  2. # 2
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
And, thanks for sidenote, going to update our documentation soon.
  1. 23.04.2018 13:04:50
  2. # 3
Morten Accepted Answer
Posts: 4
Joined: 16.04.2018
0
Votes
Undo
We also have some issues with lsapi_backend_max_process_time.
I see the documentation is 300 now. Is that correct?
It's not possible to change this for just one account/domain somehow?
  1. 24.04.2018 07:04:28
  2. # 4
Igor Ghertesco Accepted Answer
Posts: 146
Joined: 07.08.2015
0
Votes
Undo
Hello,

Correct, the default value is 300.
Unfortunately, no. lsapi_backend_max_process_time value can be set only globally.
  1. 28.11.2018 21:11:17
  2. # 5
Ryan Accepted Answer
Posts: 22
Joined: 18.10.2016
0
Votes
Undo
Has their been any change with how this variable works? I have the following in /etc/apache2/conf.d/lsapi.conf


lsapi_backend_max_process_time 28800


However it looks i get the like the 503 Service Unavailable error after 10 minutes (which is strange because I thought it would have defaulted to 300 seconds or 5 minutes).

Edit: it does happen after 5 minutes
  1. 29.11.2018 14:11:56
  2. # 6
Ryan Accepted Answer
Posts: 22
Joined: 18.10.2016
0
Votes
Undo
Also, to test, I created a script that would run for a long time. I got the 503 error after 5 minutes, but it seemed like the script continued to run because I received LVE faults for several hours afterword. I manually killed the script myself so I'm not sure if it would have been killed by lsapi after my set value or if php would have continued to run "forever" (or until it hit the php time limit or some other php initiated kill.

So is the point of this just to manage possible runaway processes on lsapi and has nothing to do with how php behaves?
  1. 30.11.2018 12:11:19
  2. # 7
Vladimir Accepted Answer
Posts: 96
Joined: 04.07.2017
0
Votes
Undo
Hello,

As far as I know, there were no changes in "lsapi_backend_max_process_time" behaviour.
Please submit a ticket to https://cloudlinux.zendesk.com, our techs will check the issue in place.
  1. 03.12.2018 14:12:20
  2. # 8
Ryan Accepted Answer
Posts: 22
Joined: 18.10.2016
0
Votes
Undo
I looks like what happened was the
lsapi_poll_timeout
variable recently had it's default changed from 0 to 300 seconds. So it used to be infinite. Making it the same value as
lsapi_backend_max_process_time
has fixed the issue.

The CL developers are still looking into whether it functions correctly. I also asked what the reason both settings are necessary because it seems like they do the same thing (at least to my limited understanding).
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.