4 ms·
welp, that's unfortunate indeed. It's a single-core 128 MB VPS, which seemed fine for my boring static html articles. I guess I underestimated the interest.
by taviso 3y ago
welp, that's unfortunate indeed.
It's a single-core 128 MB VPS, which seemed fine for my boring static html articles. I guess I underestimated the interest.
- tamimio 3y agoDoesn’t matter, great article!
- account42 3y agoInteresting, do you mind sharing what software you use to serve the static html and what kind of traffic its getting.
- loeg 3y agoHTTP/1.1 200 OK Date: Mon, 24 Jul 2023 17:05:06 GMT Server: Apache
- brazzledazzle 3y agoI do not miss performance tuning apache.
- cesarb 3y agoIn my personal experience, the first step in tuning Apache was "put a nginx server in front of it". Running out of workers (either processes in the prefork model, or threads otherwise) was in my experience way too easy, especially when keepalive is enabled (even a couple of seconds of keepalive can be painful). The async model used by nginx can handle a lot more connections before running out of resources.
- zokier 3y agoApache has been defaulting to event mpm for over a decade.
- javajosh 3y agoAs an aside, I'd be curious to now how your VPS failed. Memory? Bandwidth?
- taviso 3y agoI'm not really sure, cpu and bandwidth utilization were fine. Memory usage was high, but not oom high. It continued serving over http just fine, perhaps there was some automated rate limiting by my provider. I'll have to debug when things cool down. I'm aware 128M is ludicrous in 2023... "a fun challenge", I thought to myself. I can be a dummy.
- yakubin 3y agoFWIW, enabling gzip/zstd compression in your HTTP server could help.
- ransackdev 3y agoA single core machine already overloaded is going to get even worse introducing the cpu overhead of gzipping response bodies (assuming it’s cpu bound and not IO bound) Cache control headers will help with return traffic More cpu cores If using nginx ensure sendfile is enabled and workers are set to auto or tuned for your setup Check ulimit file handle limits Offload static assets to cdn Since it’s a static html site, you could even host on s3, netlify, etc
- brazzledazzle 3y agoCould even host on github pages with a cname.
- jwilk 3y agoIt's a static file. You need to compress it only once, not for every response.
- ptx 3y ago...and here's how to do it in Apache: https://httpd.apache.org/docs/2.4/mod/mod_deflate.html#precompressed https://httpd.apache.org/docs/2.4/mod/mod_deflate.html#preco...
- insanitybit 3y ago> A single core machine already overloaded is going to get even worse introducing the cpu overhead of gzipping response bodies (assuming it’s cpu bound and not IO bound) Unless your CPU is burning due to additional system calls being made.
- wolf550e 3y agoOnly with something like mod_asis (https://httpd.apache.org/docs/2.4/mod/mod_asis.html https://httpd.apache.org/docs/2.4/mod/mod_asis.html) to serve already compressed content. Actually running zlib on every request will only make it worse.