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

Additional Libuv Metrics #4343

Closed
anthonyalayo opened this issue Mar 6, 2024 · 2 comments
Closed

Additional Libuv Metrics #4343

anthonyalayo opened this issue Mar 6, 2024 · 2 comments

Comments

@anthonyalayo
Copy link
Contributor

PR #3749 added support for libuv metrics. These are great! I really appreciate them.

There are some more metrics that I think would be very helpful:

  1. Loop lag metrics

I added loop lag metrics myself with some boilerplate on top of libuv. I did this by using a uv_timer_t, kicking off the timer, and calculating the delay in when it was run. This helped show us big spikes in our main loop that we could optimize.

  1. Worker Pool utilization metrics

We currently use file operations such as uv_fs_open. These operations as far as I know will be serviced with libuv's internal thread pool: https://docs.libuv.org/en/v1.x/threadpool.html

I don't believe there are any metrics exposed for thread pool utilization? We increased UV_THREADPOOL_SIZE above the default due to issues we were seeing, but it was mostly a touch and feel approach. Being able to see utilization of this pool would be great.

How do maintainers feel about this?

@bnoordhuis
Copy link
Member

Loop lag metrics

I'm not too keen on adding that. For one, it's not clear to me how meaningful it would be in UV_RUN_NOWAIT mode.

Worker Pool utilization metrics

We currently use file operations such as uv_fs_open. These operations as far as I know will be serviced with libuv's internal thread pool

Sometimes. They can also be serviced by io_uring. I'm inclined to say thread pool metrics aren't that useful for that reason alone.

I mean, tracking per-request latency (i.e., the time a uv_fs_t operation takes from start to finish) is useful but that's something embedders can implement themselves. We're unlikely to bake that into libuv itself because it's a) not necessary, and b) adds overhead.

@anthonyalayo
Copy link
Contributor Author

Both sound fair, I hadn't thought about those cases.

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

No branches or pull requests

2 participants