# after long request go down with error 500

**URL:** <https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561>\
**Category:** InterWorx API Discussion\
**Created:** [February 10, 2020, 12:38pm UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561 "2020-02-10T12:38:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![standus](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@standus](https://forums.interworx.com/u/standus)\
**Post date:** [February 10, 2020, 12:38pm UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/1 "2020-02-10T12:38:15Z")

</div>

I am using PHP 7 SoapClient and all works well except long time requests like creating account with domain. It take aprox. 30 sec. and \_\_soapCall go down with (104, ‘Connection reset by peer’) which means timeout. Somewhere I read that SoapClient using https connection has problem to extend this connection timeout with ini\_set(‘default\_socket\_timeout’, 5000);. Simple it is not accepted and is timedout after 5 seconds.  
How to fix it?

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [February 11, 2020, 3:55am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/2 "2020-02-11T03:55:28Z")

</div>

HI Standus

I would open a support ticket and let IW have a look as it is an area I am not familiar with sorry.

Perhaps another forum member may have an idea

Many thanks

John

---

<div class="post-metadata">

**Author:** ![standus](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@standus](https://forums.interworx.com/u/standus)\
**Post date:** [February 11, 2020, 9:38am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/3 "2020-02-11T09:38:34Z")

</div>

All is described here

> <https://stackoverflow.com/questions/60147362/soapclient-and-https-goes-down-with-error-500-after-longtime-call-response>

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [February 11, 2020, 10:25am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/4 "2020-02-11T10:25:49Z")

</div>

Hi Standus

Many thanks

Looking at your posts, I see error 104 not error 500.

So if error 104, in your php logs, do you see anything similar to this

(104)Connection reset by peer:  
mod\_fcgid: error reading data from FastCGI server

if so, what is displayed after peer;

If looking your link, at the end of is shows as below

Have you tried that to set default socket timeout

Lastly, which php-fpm version 7 have you tried to change - IW-php-fpm is the one to change for timeout upload limits etc…

Many thanks

John

> <https://stackoverflow.com/questions/60147362/soapclient-and-https-goes-down-with-error-500-after-longtime-call-response>

------- Quote -------

Please note that although you may try to set default\_socket\_timeout to something over 20s, you may get tricked by the Linux kernel.

The default value of tcp\_syn\_retries is set to 5, which will effectively timeout any TCP connection after roughly 20s, no matter what limits you set in PHP higher than this.

The value can be altered by root only, like this:

echo 6 \> /proc/sys/net/ipv4/tcp\_syn\_retries

A value of 6, as above, will give you a timeout up to ~45s.

---

<div class="post-metadata">

**Author:** ![standus](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@standus](https://forums.interworx.com/u/standus)\
**Post date:** [February 11, 2020, 11:02am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/5 "2020-02-11T11:02:25Z")

</div>

Browser show error 500 and in log is

> (104)Connection reset by peer: FastCGI: comm with server “remi-safe-php73.fcgi” aborted: read failed  
> at different time when 500 goes.

using

> echo 6 \> /proc/sys/net/ipv4/tcp\_syn\_retries  
> has no effect.

set default socket timeout has no effect.

PHP-FPM 7.3.14  
remi-safe

Just now I tested with PHP-FPM 7.4.2 and timeout is little longer aprox. 20 seconds. But its still short because I got also error 500. Another timeouts are around 8 seconds.

I am testing “[Controller: /nodeworx/siteworx](http://docs.interworx.com/interworx/api/index-Controller---nodeworx-siteworx.php#toc-Chapter-55)” and Action: add , it takes long time.

---

<div class="post-metadata">

**Author:** ![d2d4j](https://forums.interworx.com/user_avatar/forums.interworx.com/d2d4j/32/16_2.png) [@d2d4j](https://forums.interworx.com/u/d2d4j)\
**Post date:** [February 12, 2020, 1:51am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/6 "2020-02-12T01:51:01Z")

</div>

Hi Standus

Sorry that didn’t work, but worth a try

I see your adjusting php-fpm for siteworx users and not IW php-fpm as that should be php-fpm7.2 but not sure of that is the issue.

Actually, if you use opcache (or any cache) test with this disabled/stopped

> <https://serverfault.com/questions/699053/fastcgi-comm-with-server-aborted-read-failed-only-for-one-specific-file>

As I said, I would open a support ticket as I do not have much experience with this issue sorry

Many thanks

John

---

<div class="post-metadata">

**Author:** ![standus](https://forums.interworx.com/letter_avatar_proxy/v4/letter/s/c77e96/32.png) [@standus](https://forums.interworx.com/u/standus)\
**Post date:** [February 14, 2020, 12:36am UTC](https://forums.interworx.com/t/after-long-request-go-down-with-error-500/16561/7 "2020-02-14T00:36:14Z")

</div>

OK, I will wait to result.
