PHP/MySQL application - how to schedule server processes?
| From: | Lee P Reilly | Date: | Tue, 12 Mar 2002 20:37:24 +0000 |
| Subject: | PHP/MySQL application - how to schedule server processes? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88229@lists.php.net to get a copy of this message | ||
Hi there,
I wonder if anyone can offer me some advice...
I have developed a portal using PHP, which allows users to uploads files
into their own personal storage locations. These files are stored in a
MySQL database. The system also allows the users to select these files
and submit them for analysis. By "analysis", I mean that these files
will be used as the input to separate executables (written in C) running
on the server.
This aspect of the system be accomplished in 2 ways:
CASE 1: Where the analysis program has a run time of less than 1 second
(nb: the amount of users estimated at any one time is no greater than
10). Here, the file can be extracted, a command line argument generated,
and then passed to the server via the PHP passthru() function. The
result will then be returned to the user. Easy peasy.
CASE 2: Where the analysis program may have a run time in excess of 2
hours. The passthru() function is obviously not an option as we do not
expect the user to sit in front of the computer for a few hours, or even
minutes waiting for a result. I am not sure as to the correct
terminology, but I believe I am looking for something like an
'application server' / 'process management scheduler'. Maybe something
that is commercially/freely available, or an idea of how to go about
writing my own.
Here is a rough idea of what I am trying to accomplish:
The user accesses the web application and, and selects a file for
analysis. The system (implemented in PHP) updates the databases to say
that 'ANALYSIS A' of 'FILE B' has been requested. A separate entity
running on the server watches the database for analysis requests, and
either (a) runs them one after another & updates the database
appropriately (b) or schedules according to some priority. When each
analysis is complete, the user will have access to the a results folder
in the system containing a list of their submitted analysis (either
pending or complete).
Can anyone offer any advice/suggestions on how this can be accomplished?
Thank you very much for your time.
- Best regards,
Lee Reilly
--
Lee P. Reilly, ms:G758
Szilard Resource, tel:505-665-7025
Bioscience Division,
SM-30 Bikini Atoll Rd,
Los Alamos National Laboratory, mailto:lreilly@lanl.gov
Los Alamos, NM 87545. http://home.lanl.gov/lreilly
"Quidquid latine dictum sit, altum viditur"
<filter>PHP SQL</filter>