Cached routes significantly decrease throughput #2558
Unanswered
InstantlyMoist
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Hi dear @InstantlyMoist. You should use caching when the computation cost is more than cache retrieval like when making a costly database query or long-time fetch. In the In the We can improve Nitro DX though to show some info in about it ~> #2559 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
Node v22.2.0
Nitro latest (as of posting)
Reproduction
https://github.com/InstantlyMoist/nitro-throughput
Describe the bug
Currently it appears that using a cached event handler reduces the throughput of a route by around 40% this is tested with
https://github.com/fomalhaut88/winrk but can also be tested with wrk for linux.
My findings (based on reproduction)
For all endpoints I used the same settings (t = 4, d = 10, c = 200), tested 3 times
/simple = ~16k requests per second
/simple_cached = ~11k requests per second
/big_payload = ~100 requests per second
/big_payload_cached = ~60 request per second
While nitro's throughput seems to significantly decrease with a higher payload, it seems to decrease even further with the use of a cached event route.
Additional context
No response
Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions