0

I have a 3 docker container configuration, NGINX, php-fpm and a mysql db. A request I just added, which involves sending a ~80kb png across HTTP causes nginx to freeze and neither complete the request nor accept subsequent requests. However this only happens when the Connection header is set to keep-alive, and only on the 2nd request (further requests can't be made because it's frozen).

I cannot find any log which describes a crash, exception or error, either in nginx, docker, php-fpm or symfony (the PHP framework we're using).

Here is the nginx error log, when the error happens:

2019/03/05 20:46:59 [debug] 7#7: *18 event timer del: 13: 417492
2019/03/05 20:46:59 [debug] 7#7: *18 http keepalive handler
2019/03/05 20:46:59 [debug] 7#7: *18 close http connection: 13
2019/03/05 20:46:59 [debug] 7#7: *18 SSL_shutdown: 1
2019/03/05 20:46:59 [debug] 7#7: *18 reusable connection: 0
2019/03/05 20:46:59 [debug] 7#7: *18 free: 0000000000000000
2019/03/05 20:46:59 [debug] 7#7: *18 free: 0000000000000000
2019/03/05 20:46:59 [debug] 7#7: *18 free: 000055676BF00B50, unused: 0
2019/03/05 20:46:59 [debug] 7#7: *18 free: 000055676BF09900, unused: 400

After this the log simply stops, and nothing else is logged. I'd include the php-fpm logs, but they show no indication that any request was made.

The nginx service on the docker container stays active throughout, it certainly does not seem to crash.

Here's the nginx conf (I've pared it down to what I assume are the relevant parts):

server {
    listen 443 ssl;
    index index.php index.html;
    error_log  /var/log/nginx/error.log debug;
    access_log /var/log/nginx/access.log main;

    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;

    ...

    location ~ ^/.+\.php(/|$) {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_pass fpm-dev:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }
}

I realize I could turn off keep-alive on the request, and take the mild performance hit. But I've been banging my head against this for almost 2 days now and I'd like to know what I'm not understanding.

Let me know if I can provide anything else, this stuff is well outside my wheelhouse so I'm open to the fact I may have made a basic mistake.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.