Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Adding features does not necessarily increase functionality -- it just makes the manuals thicker.


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

SubjectAuthor
* Server sends 502 status code, but site is fully operational. wtfAnonymous
`* Server sends 502 status code, but site is fully operational. wtfAnonymous
 `- Server sends 502 status code, but site is fully operational. wtfAnonymous

1
Server sends 502 status code, but site is fully operational. wtf ?

<b27edb809d5e14e4d8e5f7b0faea11d6@news.novabbs.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=752&group=rocksolid.programming#752

  copy link   Newsgroups: rocksolid.programming
Date: Sun, 15 Oct 2023 20:02:19 +0000
Subject: Server sends 502 status code, but site is fully operational. wtf
?
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on novalink.us
X-Spam-Level: *
From: Anonymous@news.novabbs.org (Anonymous)
Newsgroups: rocksolid.programming
X-Rslight-Site: $2y$10$BTdEVlgXa62XWwLW79tBPeNMfRAkygafBZEIE9.a/kHwkL4DqwYfa
X-Rslight-Posting-User: df19b9e497e9c806e5721b3201c30e6034ab0fc4
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Rocksolid Light
Organization: Rocksolid Light
Message-ID: <b27edb809d5e14e4d8e5f7b0faea11d6@news.novabbs.org>
 by: Anonymous - Sun, 15 Oct 2023 20:02 UTC

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

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

<44bee2c94c169891b99548013b019e36@rocksolidbbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=753&group=rocksolid.programming#753

  copy link   Newsgroups: rocksolid.programming
Path: 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
 by: Anonymous - Sun, 15 Oct 2023 20:23 UTC

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

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

<e4b134adf6c3dd1fc03d5c66fb79cfdc@rocksolidbbs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=754&group=rocksolid.programming#754

  copy link   Newsgroups: rocksolid.programming
Path: 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
 by: Anonymous - Mon, 16 Oct 2023 06:43 UTC

>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
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor