I am working on a web application for users who need to perform a lengthy background process tied to each client request. In the long run, I mean 1 to 3 minutes.
Here is an example thread. The object / widget really does not matter.
- The client comes to the site and indicates the object / widget that they are looking for.
- We do a search / cleanup / filter for widgets that match some source criteria. <- long process
- The client further sets up more detailed information about the widgets they are looking for.
- When the shutdown process is completed, the client can take the last few steps before conversion.
Steps 3 and 4 are not very important. I just mention them because we can buy some time while we do a lengthy process.
The environment in which we work is a LAMP stack - PHP is currently in use. This is not like a good design, so that a lengthy process takes up the apache stream in mod_php (or the fastcgi process). The apache level of our application should be focused on serving content, and not on IMO processing.
A few questions:
- Do we think that we should separate this “long” part from the apache / web application level?
- Is there a standard / typical way to abort this in Linux / Apache / MySQL / PHP (we can use a different language for processing if necessary)?
- Any suggestions on how to deal with this? For instance. do we create a deamon that gets off through the FIFO queue?
: , 1/4 . . , , , .
!