O
O
Octoberfest2016-10-30 20:42:33
PHP
Octoberfest, 2016-10-30 20:42:33

How long will it take to process a request?

Hello. I want to know this moment: there is a script on the server, let it be script.php, every minute it is called by cron and the command is executed for 10-15 seconds. Also, this script processes other requests (for example, it receives data from a website form and adds it to the database). And now such a question, CRON started (the script runs for 10 seconds) and at that moment a request was received to add data to the database to the same script, how long will the addition to the database take?
1) right away
2) after cron finishes
??
I guess option 2, but what do you say?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Entelis, 2016-10-30
@Octoberfest

If you don't take any special action - all* requests are processed in parallel ( * actually not all, but by the number of web server workers - but for simplicity it's easier to consider that all).
I will say more - if your script is running for example 2 minutes - then every minute one more thread will still be launched.
In general, this is a question that can be easily verified experimentally :-)

M
Maxim, 2016-10-30
@pudovMaxim

As soon as resources are available.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question