Welcome! Log In Create A New Profile

Advanced

Remove timeouts for a long time running app

Posted by leonardolima 
Remove timeouts for a long time running app
June 03, 2015 03:39PM
Hi everyone,

Here in the office we have an PHP Application that needs to run for about 2 or 3 days. This week we migrate from Apache to Nginx but I could not find a way to make this application runs without timeout... and I don't wanna remove timeouts for all the others app.

How could I configure this?
Re: Remove timeouts for a long time running app
June 03, 2015 04:18PM
That long will timeout any client, the best way I can think of is using Lua to start the php process and return some info page to the client so the client doesn't timeout and kill the php process.

You will also need to use a Lua co-socket and most likely it will block a worker for that amount of time.

You could also do something else, like create a que system externally which you feed from nginx/Lua.

request -> Lua fire batch job, store job handle in shared memory, return a job handle to client -> close connection
A separate process picks up the batch and runs it, when done create a signal file.
request result -> Lua check for job signal file, compare with handle in shared memory -> return result or busy state.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready