Error when uploading big file, recv() failed

I’m running laterst Nextcloud on PHP7.3 and NGINX 1.19.7 running on a VPS with 16GB memory, enough storage.

error occur while uploading a 1GB file, it can be uploaded to the nextcloud cache directory in data/username/uploads/random_number, but it can’t proceed to merge the file.

error in NGINX log:

[error] 18600#0: *186134 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: , server: , request: “GET /index.php/apps/logreader/poll?lastReqId=q HTTP/2.0”, upstream: “fastcgi://unix:/tmp/php-cgi-73.sock:”, host: “”

PHP config:

    max_execution_time 3600
    max_input_time 3600
    post_max_size 100G
    upload_max_filesize 100G
    memory_limit 2048M

NGINX config:

    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 256k;
	fastcgi_intercept_errors on;

I tried anything on google, no luck, thank you a lot for helping me out!

Does it take longer than 5min?

For the fast_cgi settings, it can help if you let fast_cgi log a bit more in case it is a timeout or a full buffer, you’ll see the difference.

thank you for replying

it didn’t took that long, i tried to increase it to 3000 but it fail quickly

the file was actually uploaded to my server under cache directory, and it fails, if i restart the upload, i assume it was trying to merge the file but fail within a few seconds. and oiutput the error in nginx.

Have you checked the logging from php/fast-cgi? Or the php process itself is killed?

The 1GB size, is this just a size you observed randomly? If you try 800MB or 500MB, there are no problems?