Process Manager
Posted: Mon Aug 22, 2011 2:42 am
I am trying to build a simulation server which can be driven over the internet. Each simulation runs in its own process. The user should be able to start a simulation, stop a simulation, and get the status of a simulation by calling a PHP script over the internet. The simulations can take a very long time, and the "start simulation" call should not block. The "status" of the simulation is printed to stdout by the simulator so this needs to be made available to the user.
My initial design was to fork & exec the simulation, and pipe the results to a file. Then lookup the file when the user asks for the status. However, you cannot fork & exec in php inside an apache module. Should I use a dedicated application server? It seems a bit difficult to use a standard web server since there is no global state which stores the list of running processes (simulations).
My initial design was to fork & exec the simulation, and pipe the results to a file. Then lookup the file when the user asks for the status. However, you cannot fork & exec in php inside an apache module. Should I use a dedicated application server? It seems a bit difficult to use a standard web server since there is no global state which stores the list of running processes (simulations).