Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Async is fantastic if you do a lot of I/O and you have to scale. For instance if you have a web service that makes a lot of network calls.

In our particular case, and oversimplifying, the app is a smart router. Take a request, farm out pieces of it to multiple other servers, aggregate responses. Some of those requests finish in 5ms, some take several seconds, which is a crappy pattern to deal with. Today's not a particularly busy day, so we're doing about 70 req/sec/VM at 5% CPU on a dual core VM. In load tests I've had it up to 300 req/sec/VM with no problems. It actually bottlenecked our 10Gb network cards before the the CPU maxed out.

I haven't tried running the actual app without async because it would be a major rewrite. But I did some benchmarking making lots of parallel HTTP calls with threads vs async, and found that async was 10-20x faster and used less CPU.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: