| ▲ | echoangle 4 hours ago |
| > Some light load testing (with (ab -n 1000 -c 1) shows that right now we can serve about 2-3 requests per second (on a ~$10/month VM). > After turning on template caching, it seems like the site can now pretty easily handle 12 requests per second or so without using all of the CPU. I have not carefully benchmarked the before and after but it seems like it’s made a pretty big difference. That seems crazy low, I think there has to be something else going on here. |
|
| ▲ | shakna 4 hours ago | parent | next [-] |
| Those numbers sound... Single-threaded. Like they're using the development runserver instead of uwsgi or gunicorn. |
| |
| ▲ | jonatron 3 hours ago | parent | next [-] | | A $10/month VM might only have a single thread anyway. Some providers like lightsail are really slow too. | | |
| ▲ | echoangle 3 hours ago | parent | next [-] | | You can run multiple OS threads (gunicorn workers) on one VM thread so the workers don’t have to wait for each others request to finish though, right? And if you pay $10/month for a single threaded machine, you’re overpaying by a lot. | | |
| ▲ | jonatron 3 hours ago | parent [-] | | True, but in this case with SQLite, there's unlikely to be much of a difference because there isn't the spare time available when waiting for a separate database server. I don't know what providers are good for a $10/month instance these days. | | |
| ▲ | echoangle 2 hours ago | parent | next [-] | | How are you spending any non-negligible time reading from SQLite at 12 requests per second though? That would mean you’re spending something like 50 ms per request on reading from SQLite. | |
| ▲ | ErroneousBosh 2 hours ago | parent | prev [-] | | Most of the time you're hitting SQLite, you're just reading from it, and so it doesn't hold anything up. |
|
| |
| ▲ | shakna 2 hours ago | parent | prev [-] | | For a cheap VM, I'd still be expecting in the range of 500-1000 connections a second. Green threads are cheap, even with a single processor. For a half-decent VM, I'd be expecting multi-thousand. Single figures a second, is choked to a single connection at a time. |
| |
| ▲ | BiteCode_dev 2 hours ago | parent | prev [-] | | Also, they may be serving static files through Django. Otherwise, it's really, really low. |
|
|
| ▲ | bigfatkitten 28 minutes ago | parent | prev [-] |
| That’s a number I would been disappointed with 25 years ago, running Perl CGI on a 700MHz Pentium III. |