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

No, they are not usable in production. We tried and was forced to rewrite whole app after this ASAP and eliminate usage of async hooks. We used them exactly same way: logs and some query-level context data.

Bluebird is bad for measuring async hooks because they have custom scheduler and most of the execution is done in single tick.

Overhead is for each tick, not each promise. If you have ~10 promises per request then you have N overhead if you will have 1000 promises you will get 100N overhead.

Our backend barely survived this after async hooks was just enabled and just disabling them make everything x100 faster.



Are you saying that async hooks perform fine with Bluebird but not native promises? Why not use Bluebird everywhere then?


Because this is not a solution, you still get penalty and bluebird is slower in latest nodejs versions.

Not really a long term solution.

We adapted approach with context from golang and now it works really well.




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

Search: