3 ms·
I also have some doubts for some specific scenarios: - Imagine you have a monolith that mostly talks to the database. You have a primary with multiple read rep
by pdhborges 5y ago
I also have some doubts for some specific scenarios:
- Imagine you have a monolith that mostly talks to the database. You have a primary with multiple read replicas. How are you going to take advantage of millions of async tasks if your IO concurrency ends up being caped at a couple of thousand database connections?
- The second question is: even if you can have a million requests on flight do you really want to have such a large blast radius on a single server?
- akiselev 5y ago> - Imagine you have a monolith that mostly talks to the database. You have a primary with multiple read replicas. How are you going to take advantage of millions of async tasks if your IO concurrency ends up being caped at a couple of thousand database connections? You use a connection pool and multiplex queries over a few persistent connections. This problem exists regardless of whether you use async or thread-per-client. Process per client (i.e. PHP CGI) requires an external connection pool like pgpool. > - The second question is: even if you can have a million requests on flight do you really want to have such a large blast radius on a single server? What's the alternative? When there's a billion connections going through round robin DNS to a thousand load balancers and another hundred million going to backups on failover, everyone's going to have to handle that level of traffic. The scale of the internet is huge and it only just barely works because many services (like DNS, LBs, and databases + their read replicas) can operate at that kind of scale. The people solving these kinds of hard problems have a lot of money that ends up sloshing around via open source github projects, thus influencing the wider engineering community. Many naturally gravitate towards these approaches because they are well tested and usually guaranteed overkill, right in that sweet spot between cover-my-ass and proven-but-shiny. In reality, async is one of those "if you have to ask, you [probably] don't need it" kind of things.
- preseinger 5y agoI/O perf is usually a measure of throughput, and while concurrent connections are certainly part of that calculus other factors tend to dominate.