2 ms·
“CPU starvation looks like IO to most eyes” Yes! And add in that you are holding a database connection for longer than needed, putting scaling pressure on your
by scosman 2y ago
“CPU starvation looks like IO to most eyes”
Yes! And add in that you are holding a database connection for longer than needed, putting scaling pressure on your DB, which is the harder thing to scale.
- PaulHoule 2y agoI'm not sure if it is the same phenomenon but I was really disappointed with the performance of a python aiohttp server [1] when I went from the application serving an html page with maybe 2-3 small images that would stick in the cache (icons) and instead was serving 20-50 photographic images per page, particularly over the wrong direction of an ADSL connection. I thought this was low CPU but it was not low CPU enough, in the end I switched to gunicorn (running in WSL) with IIS fronting and serving the images (woulda been nginix in a pure-Linux environment) I think the tiny amount of CPU to serve the images was still getting blocked by requests that used a little more CPU. With gunicorn I'm not afraid to add tasks that crunch on the CPU a little harder too. [1] built a lot of mini-apps that worked great before
- CoolCold 2y agoEverything is better with Nginx! As sysadmin I've seen many cases when not letting backend to serve static files drops latency and load significantly. In the worst case, X-accel-redirect is still better than serving through most of the frameworks.
- WJW 2y agoHaving the connection for longer than needed only puts more pressure on databases on which connections are a scarce resource (basically only postgres, and even then it's easily fixed with pgbouncer). When using a database with a better connection model, holding a connection too long will actually decrease total load on the database because each connection is idle for a larger percentage of the time.
- CoolCold 2y agoIsn't pgbouncer putting extra limitations like prepared statemens use ? Genuine question