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

Adrian Bulgariu adrian at wecode.ro
Thu Jun 24 05:18:05 UTC 2021


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 ?

Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20210624/b3ba1ccf/attachment-0001.htm>


More information about the nginx mailing list