-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we add metrics to cold start? #126
Comments
I'm generically +1 to add that benchmark. Note that cold start is not such a critical thing anymore unless your application has extremely low traffic. (Note that on AWS the process is reused and it allows to make https://github.com/fastify/aws-lambda-fastify more performant than the express equivalent under traffic). The relevant metric to track is the time between starting the Node.js process, calling As far as Fastify goes, fastify/fastify#1598 sums it up. Our main bottleneck is in the Ajv dependency tree - TL;DR essentially executing a really long regexp we are not matching. |
I started something like this: To check if this (empty) repo can speed up the start! I would glad to work on this with you 馃憤 |
I Agree. Although, I believe that the more we expose the metrics of Fastify more confident will be the consumers.
Good! Perhaps this metric can be the first one to create. @Eomm the fastify/fastify#2195 get this metric already? We can continue on that PR. |
The hard things is that the schema compiling is the slower part, so we need to define a set of use cases. Because if we don't use schemas, for example, we are ignoring that component |
We can do both actually. I thinking about:
I don't know if expose the memory consumption when we use a lot of schemas is a good metric though. What do you think? |
Would it mean without endpoints? - maybe we could do a poll on Twitter to define a good tradeoff for a "typical fastify application"
I think it would be not because a higher memory consumption :
For sure we could measure it to write down some "best practice" Usually, I run in prod fastify applications with:
|
Yes, I mean, maybe increase the number of routes until reaching some limit and document it or to understand that each route can increase the startup time in X. |
Ok, would you like to work on a branch in this repo? (I don't have write access here, so I should do PRs to your branch tho) |
Ok. How fastify/fastify#2195 is related to the work above? There is something to reuse? |
I think so: the structure with |
Closing since the improvements is being discussed in the PR above. |
馃殌 Feature Proposal
I know that provide a fast cold start is not the focus of
fastify
, but I think that should we provide some metrics aboutfastify
regardless of the route response time.Besides these metrics could help us to improve the initialization at some point.
The text was updated successfully, but these errors were encountered: