Skip to content

Cached routes significantly decrease throughput #2555

Description

@InstantlyMoist

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions