Weight balance PHP script between apache and os

I wanted to balance the mass process in a web application by letting it run on the OS instead of Apache. I could do this with a shell that does this process, but I think it's better to get the opinions of others in this situation. Here is the scenario:

  • User Login
  • Click process
  • Continue processing on the server, allowing the user to perform their usual actions. Note. The user should not be interrupted by the process, should be a parallel process.
+4
source share
1 answer

Consider starting a separate process on a server that will run continuously, receive working units from PHP scripts, execute them, and return the results. PHP script, and this process can use the database to exchange work units, so when PHP has some work, it inserts the job description into the database. When a separate process is ready for work, it queries the database for pending work units, marks them in the database during processing. Later, processing is performed, it marks the work block in the database as completed and attaches the result of processing to it.

0
source

All Articles