|
Boost Users : |
From: Dmitry (dbnikiforov_at_[hidden])
Date: 2023-06-30 13:53:20
Hello,
I would like to have a metric that measures time spent for work (executing
completion handlers) vs time spent waiting for work in thread pool
executing io_context::run(). It will help to estimate service capacity
(i.e. how many more requests per second it can handle). It is similar to
the system's CPU usage metric but CPU usage metric does not include waiting
for mutex locks or sync io performed from completion handlers. In our
performance tests io_context becomes overloaded (the queue grows faster
than it's processed) when CPU usage is about 85%. I would like to have a
metric that shows 100% in this case.
There is BOOST_ASIO_CUSTOM_HANDLER_TRACKING macro that allows to intercept
handler invocations and to measure execution time. But in the case of many
lightweight handlers measuring time can bring significant overhead. I'm
considering adding similar macros before and after waiting for the
condition variable and epoll to measure wait time and then calculate
execution time.
I'm writing to ask if there is a better alternative? If not, would you be
interested in a patch that adds "Handler Tracking" macros around wait calls?
Thank you,
Dmitry
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net