S
S
Sazanovdm2022-03-13 15:58:04
PHP
Sazanovdm, 2022-03-13 15:58:04

How to find out the maximum number of simultaneously running processes?

There is script.phpone in which I make a cURL request to a specific url address, the average execution time is ~ 3.7 seconds.

I create index.phpin which I write a Multi curl function and create 100 requests to my script.php, which starts to perform its task.

Multi Curl should be completed in ~ 4-5 seconds, but in the end it takes 40-50 seconds.

It turns out that Multi Curl sent requests, but due to the fact that there are no free "Workers", requests are executed in a certain queue?
For example, 5 pieces have been processed, as soon as the worker is released, it takes on new 5.

How to find out / increase the maximum number of simultaneously running processes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Karabanov, 2022-03-13
@karabanov

If mpm_worker is used, then find and change the following directives in the config:

<IfModule mpm_worker_module>
        StartServers             2
        MinSpareThreads          25
        MaxSpareThreads          75
        ThreadLimit              64
        ThreadsPerChild          25
        MaxRequestWorkers        150
        MaxConnectionsPerChild   0
</IfModule>

If mpm_prefork is used, then find and change the following directives in the config:
<IfModule mpm_prefork_module>
        StartServers             5
        MinSpareServers          5
        MaxSpareServers          10
        MaxRequestWorkers        150
        MaxConnectionsPerChild   1024
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question