Php script is getting executed multiple times on nginx as a proxy server

Adrian Bulgariu adrian at wecode.ro
Thu Jun 24 17:40:42 UTC 2021


the only error I could get was this one using wget on linux to call on 
the script:

HTTP request sent, awaiting response... Read error (Success.) in headers.
Retrying.

and it is starting new task on other servers ...


On 24-Jun-21 19:40, Sergey A. Osokin wrote:
> Hi Andrian,
>
> On Thu, Jun 24, 2021 at 08:18:05AM +0300, Adrian Bulgariu wrote:
>> Hello,
>>
>> i have nginx as a proxy server. When i run a php script that takes allot
>> of time to import (some product imports) i see in the log file that
>> starts on a web child and after some time the script it is called by
>> another child
>>
>> fom my file log:
>> [ ip of the child ] [iteration of product nr]
>> [ 10.38.1.106 ] [ 7724 ] Product: 50376 - updated
>> [ 10.38.1.106 ] [ 7725 ] Product: 50378 - updated
>> [ 10.38.1.106 ] [ 7726 ] Product: 50379 - updated
>> [ 10.38.1.106 ] [ 7727 ] Product: 50391 - updated
>> [ 10.38.1.105 ] [ 9453 ] ==============================
>> [ 10.38.1.106 ] [ 7728 ] Product: 50392 - updated
>> [ 10.38.1.105 ] [ 0 ] Product: 104474 - updated
>> [ 10.38.1.106 ] [ 7729 ] Product: 50394 - updated
>> [ 10.38.1.105 ] [ 1 ] Product: 104675 - updated
>> [ 10.38.1.106 ] [ 7730 ] Product: 50395 - updated
>> [ 10.38.1.105 ] [ 2 ] Product: 105186 - updated
>> [ 10.38.1.106 ] [ 7731 ] Product: 50396 - updated
>> [ 10.38.1.105 ] [ 3 ] Product: 106417 - updated
>> [ 10.38.1.106 ] [ 7732 ] Product: 50397 - updated
>>
>> nginx backends config:
>>           upstream backends {
>>                   sticky name=cresist path=/;
>>                   server 10.38.1.104:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 1
>>                   server 10.38.1.105:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 2
>>                   server 10.38.1.106:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 3
>>                   server 10.38.1.107:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 4
>>                   server 10.38.1.108:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 5
>>                   server 10.38.1.109:80 weight=10 max_fails=3
>> fail_timeout=30s; # Child 6
>>           }
>>
>> how can i set nginx not to split the load on another child if execution
>> time is high ?
> How is the php script executed?  Could you share more details
> in the NGINX configuration file, an upstream description is just
> a small part of the configuration file and it isn't enough.
>


More information about the nginx mailing list