Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Your life would be very empty if you had nothing to regret.


rocksolid / Programming / Re: Server sends 502 status code, but site is fully operational. wtf ?

SubjectAuthor
* Server sends 502 status code, but site is fully operational. wtf ?Anonymous
`* Re: Server sends 502 status code, but site is fully operational. wtf ?Anonymous
 `- Re: Server sends 502 status code, but site is fully operational. wtf ?Anonymous

1
Subject: Server sends 502 status code, but site is fully operational. wtf ?
From: Anonymous
Newsgroups: rocksolid.programming
Organization: Rocksolid Light
Date: Sun, 15 Oct 2023 20:02 UTC
Path: eternal-september.org!news.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: Anonymous@news.novabbs.org (Anonymous)
Newsgroups: rocksolid.programming
Subject: Server sends 502 status code, but site is fully operational. wtf
?
Date: Sun, 15 Oct 2023 20:02:19 +0000
Organization: Rocksolid Light
Message-ID: <b27edb809d5e14e4d8e5f7b0faea11d6@news.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1736688"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Site: $2y$10$BTdEVlgXa62XWwLW79tBPeNMfRAkygafBZEIE9.a/kHwkL4DqwYfa
X-Spam-Level: *
X-Rslight-Posting-User: df19b9e497e9c806e5721b3201c30e6034ab0fc4
View all headers

Hope someone can shed some light on this, cause I'm really a little lost...

I'm coding a website, consisting of some static files (images, css, and such) and some dynamic content in php.
The server is nginx, and it uses php-fpm to link to php.

Now I thought before I go live, I'd do a little stress testing just to see how it handles (hardware is an old
raspberry pi with 1G of RAM available, so I wasn't expecting much...).

I used a little python script that generates a flood of randomized requests, and halfway expected the server to go down
quickly and become unreachable. To my amazement, I found the site remained completely operational during the stress
testing, both for static files (which are served directly by nginx), and also for the dynamic content generated by my
php scripts. Happy with that result, I went on to see the server logs, and here came my surprise:
the requests from the flooding tool generated a lot 502 status codes (bad gateway), indicating an overload on the php side.
This I found also confirmed in the php logs ("server reached pm.max_children setting").
In between the thousands of 502 status codes, there were the requests I did manually during the stress test with a browser,
and they all had the status code 200 (OK), for the static files as well as for the dynamic content (and I could see the
content in the browser as well, so it was actually delivered).

As I said, I kind of expected that I could take the server backend down (my php is probably not too efficient), and that
was confirmed by the logs of the webserver and the php logs. But why did the site function at the same time and was delivering
content (again confirmed by the logs) ? I would expect the site to be up or down, but not both at the same time.
Have I created a Schroedingers site accidentally ?

Happy to receive any comments or questions.

--
Posted on Rocksolid Light

Subject: Re: Server sends 502 status code, but site is fully operational. wtf ?
From: Anonymous
Newsgroups: rocksolid.programming
Organization: RetroBBS
Date: Sun, 15 Oct 2023 20:23 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!usenet.network!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: Anonymous@rocksolidbbs.com (Anonymous)
Newsgroups: rocksolid.programming
Subject: Re: Server sends 502 status code, but site is fully operational. wtf
?
Date: Sun, 15 Oct 2023 20:23:46 +0000
Organization: RetroBBS
Message-ID: <44bee2c94c169891b99548013b019e36@rocksolidbbs.com>
References: <b27edb809d5e14e4d8e5f7b0faea11d6@news.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1738490"; mail-complaints-to="usenet@i2pn2.org";
posting-account="qk6pvs/sIyKYNRNFdjVS+ghlZZkCUq7cWs+7p7kaLpU";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: b47da4f5d75d2e6d622c05424a406bf5739a21a2
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Spam-Level: *
X-Rslight-Site: $2y$10$LfLvA6R0EHJNTs6WUYYFk.H53r7XtDX60gIqdz5NrHUwa2O7fiFDq
View all headers

Anonymous wrote:

> Hope someone can shed some light on this, cause I'm really a little lost...

> I'm coding a website, consisting of some static files (images, css, and such) and some dynamic content in php.
> The server is nginx, and it uses php-fpm to link to php.

> Now I thought before I go live, I'd do a little stress testing just to see how it handles (hardware is an old
> raspberry pi with 1G of RAM available, so I wasn't expecting much...).

> I used a little python script that generates a flood of randomized requests, and halfway expected the server to go down
> quickly and become unreachable. To my amazement, I found the site remained completely operational during the stress
> testing, both for static files (which are served directly by nginx), and also for the dynamic content generated by my
> php scripts. Happy with that result, I went on to see the server logs, and here came my surprise:
> the requests from the flooding tool generated a lot 502 status codes (bad gateway), indicating an overload on the php side.
> This I found also confirmed in the php logs ("server reached pm.max_children setting").
> In between the thousands of 502 status codes, there were the requests I did manually during the stress test with a browser,
> and they all had the status code 200 (OK), for the static files as well as for the dynamic content (and I could see the
> content in the browser as well, so it was actually delivered).

> As I said, I kind of expected that I could take the server backend down (my php is probably not too efficient), and that
> was confirmed by the logs of the webserver and the php logs. But why did the site function at the same time and was delivering
> content (again confirmed by the logs) ? I would expect the site to be up or down, but not both at the same time.
> Have I created a Schroedingers site accidentally ?

> Happy to receive any comments or questions.

Is nginx throttling the flooding ip address, and maybe the ip address you're connecting from a different address?

I'm not sure if nginx does this by default, but it does have the ability to do so.

--
Posted on RetroBBS

Subject: Re: Server sends 502 status code, but site is fully operational. wtf ?
From: Anonymous
Newsgroups: rocksolid.programming
Organization: RetroBBS
Date: Mon, 16 Oct 2023 06:43 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!news.mixmin.net!news.neodome.net!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: Anonymous@rocksolidbbs.com (Anonymous)
Newsgroups: rocksolid.programming
Subject: Re: Server sends 502 status code, but site is fully operational. wtf
?
Date: Mon, 16 Oct 2023 06:43:39 +0000
Organization: RetroBBS
Message-ID: <e4b134adf6c3dd1fc03d5c66fb79cfdc@rocksolidbbs.com>
References: <b27edb809d5e14e4d8e5f7b0faea11d6@news.novabbs.org> <44bee2c94c169891b99548013b019e36@rocksolidbbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1785423"; mail-complaints-to="usenet@i2pn2.org";
posting-account="qk6pvs/sIyKYNRNFdjVS+ghlZZkCUq7cWs+7p7kaLpU";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$/PzSiLCHAGwi21bG8OVj1ep.C6E0LnbA45Ps.JnoTnNwSaupT3GH6
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Rslight-Posting-User: 7d1b1c0431a54fcbeb6112e1ac43419a90ad024c
View all headers

>Is nginx throttling the flooding ip address, and maybe the ip address you're connecting from a different address?

Seen from the perspective of nginx all incoming connections came from 127.0.0.1 (it was an onion-site). So throttling would not work around the ip, but maybe via another property.
Since I have not put any rule like that in the configuration, it must be some default option of nginx.

--
Posted on RetroBBS

1

rocksolid light 0.9.8
clearnet tor