3 ms·
I think even a distributed cache in front of a database shouldn't have any trouble handling 2000 requests per second. The issue is not really the number of req
by kragen 5y ago
I think even a distributed cache in front of a database shouldn't have any trouble handling 2000 requests per second.
The issue is not really the number of requests per second, probably, but the number of bytes, which they don't talk about at all in the article; reading manga with no ads is a pretty static kind of application, which could be satisfied amply with a web browser or even a much simpler program loading images from a filesystem directory.
Valgrind claims httpdito runs a few thousand instructions per request, but that's not really accurate; what happens is that the kernel is doing all the work. httpdito on Linux can handle about 4000 requests per second per core, nearly a million clock cycles per request, almost all of which is in the kernel. Of course it doesn't ship its logs off to Grafana. In fact, it doesn't have logs at all. But it would work fine for reading manga.
- antupis 5y agoAlso that 2000 request per second has to happen 24/7 not only quick demo session.
- kragen 5y agohttpdito is nothing if not consistent in its performance. It doesn't have enough state to have many ways to perform well at first and then more poorly later, or for that matter vice versa. (Not saying it couldn't happen, but it's not that likely.) Linux is pretty good about consistent performance, too, though it has more state.
- buzer 5y ago> The issue is not really the number of requests per second, probably, but the number of bytes, which they don't talk about at all in the article; reading manga with no ads is a pretty static kind of application, which could be satisfied amply with a web browser or even a much simpler program loading images from a filesystem directory. I assume they are talking about their more dynamic content serving in this post (for things like search, tracking which chapters are read, new chapter listing based on what user follows etc.). They have a custom CDN that is hosted by volunteers to serve the images for the manga pages. They provide some metrics for that at https://mangadex.network https://mangadex.network, there are also some older screenshots where they hit 3.2GB/s.
- kragen 5y agoInteresting! Thanks! It still doesn't sound like the kind of thing that would require load balancing, but maybe it was easier to write it in Python or PHP or something, and that made it so heavy that it did.
- hsn915 5y ago> distributed cache in front of a database Already an over kill. Think smaller. Think simpler. A single machine serving files directly from the file system (yes, from the SSD attached to the machine) will be able to handle a LOT more.
- kragen 5y agoWell, that's what httpdito does: it serves files directly from the filesystem. That's why I mentioned it. But, for some applications, such as the website you're using right now, it's useful to display pages that haven't been previously stored in the filesystem.