Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axiom significantly impacting Next.js performance #215

Open
radziminski opened this issue Jul 18, 2024 · 1 comment
Open

Axiom significantly impacting Next.js performance #215

radziminski opened this issue Jul 18, 2024 · 1 comment

Comments

@radziminski
Copy link

Hi!

I'm using the next-axiom library in my recent Next.js and I've noticed, that even for very few logs the await logger.flush() takes even up to 150ms of the whole request time. This is usually twice as much as the time for processing the whole request without the logging, and it has a significant impact on the whole page performance. The same goes for Route Handlers wrapped with withAxiom (I'm assuming it does logger.flush() under the hood).

As a result, the logs in server-side Next.js are unusable in most of my use cases (I feel like 150ms increase for all requests time is not worth it).

Is there some other way of handling Axiom logs in Next.js server-side that does not impact the response time? If not, it would be great if you could consider adding a possibility to flush logs in some kind of non-blocking way.

@empz
Copy link

empz commented Aug 6, 2024

If you're using Vercel, you could use waitUntil (https://vercel.com/changelog/waituntil-is-now-available-for-vercel-functions)

But yes, I agree that 150ms for logging is not worth it. Besides, there's not much going on around here. I've just started a Next.js project with Axiom and I'm already considering switching to another platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants