• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue recv() failed (104: Connection reset by peer) while reading response header from upstream

kaboemm

New Pleskian
Hello,

Me and my business partner experiencing the same issue at around the same time.

We run large PHP crawl scripts that sometimes takes an hour of 3. We have never experienced issues with this as we used all the correct time out en buffer settings (nginx and php). If we run our scripts it randomly 502's with the following log entry:
4214#0: *17080 recv() failed (104: Connection reset by peer) while reading response header from upstream

I have Google myself tired and have tried every settings I could find on the internet but none of it works. It also happens randomly, sometimes with 2 hours, sometimes with 15 minutes. The funny part is that sometimes it does work, and most of the time is this when it runs scheduled at night with a cron job.

Info:
I run plesk on my own VPS with CentOS Linux 7.8.2003 (Core)‬ with update Plesk Obsidian 18.0.29 Update #3. 4 vCPU, 8GB RAM and around 150GB SSD storage. Im running PHP 7.4.10 with nginx only (No proxy with Apache).

PHP:
FPM application served by nginx

memory_limit 2048M
max_execution_time 21600
max_input_time 21600
post_max_size 128M
upload_max_filesize 64M
max_input_vars = 10000

Nginx directive:
client_header_timeout 21600s;
client_body_timeout 21600s;
keepalive_timeout 21600s;
keepalive_requests 10000;
proxy_connect_timeout 21600s;
proxy_send_timeout 21600s;
send_timeout 21600s;
fastcgi_connect_timeout 21600s;



I have also tried adjusting the nginx.conf with worker_processes to 4. I have also tried adjusting /etc/sw-cp-server/config and put
fastcgi_buffers 32 32k;
fastcgi_buffer_size 64k;
there without any luck.

I tried to run it with Apache as proxy aswell. No luck.

If there is anyone that could hepl me solve this problem I would be really happy because this is hurting my business. Also this problem isnt really easy to reproduce or test as sometimes it can take hours for it to 502.

If you need any more info, please ask.

Thanks,

Gr Kaboemm
 
I don't think that there is any reliable method to run a script that takes an hour or even longer to complete through a web server front end. My suggestion is to change the script so that it runs in the background and reports it's state to somewhere like a file or a database entry (e.g. " 40% completed"), also that it checkes every n seconds whether a tag exists that tells it to prematurely stop. Then you can simply create an auto-reload web-page that loads these data from the source and maybe has a button like "stop script" that sets the tag to tell the script to stop.
 
Back
Top