Hacker News new | ask | show | jobs
by viraptor 2146 days ago
> plummets when a random external API endpoint starts to time out

You should add something like https://pypi.org/project/circuitbreaker/

Continuously failing external requests should not make each one of your responses slow.

1 comments

Interesting, will certainly try it out, thanks!

> Continuously failing external requests should not make each one of your responses slow.

It is not really a matter of the responses becoming slow, the problem is that if you are running sync with i.e 6 application server processes and you have just 6 hits on an endpoint in your app that is hung up on an external API call your application stops processing requests altogether.

Exactly this. I see the whole django async stuff being far more relevant for applications with lots of traffic or high request rates where you are already running on beefy infrastructure with a ton of workers and any small improvement in performance translates into huge real world cost savings. Your standard blog, no so much.