-
Thank you for providing such an awesome logging library! I'm currently facing an issue where my backend worker thread appears to be consuming an entire CPU. In my attempt to understand BackendWorker.h, I'm not able to identify any blocking code in the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
hey and thanks for checking out the library. Since the library is designed mainly to offer low latency the logging thread is constantly spinning even when there are no events to log. The thread will spin and check if there are any messages to log if not it will do some housekeeping work. In So you can use something like
|
Beta Was this translation helpful? Give feedback.
-
It is also now possible to use a high sleep duration for the backend logging thread and then wake it up on demand to process the logs from any thread. See example The backend logging thread still spins / busy waits and when it goes into sleep it can be waken up by any thread if you call |
Beta Was this translation helpful? Give feedback.
hey and thanks for checking out the library. Since the library is designed mainly to offer low latency the logging thread is constantly spinning even when there are no events to log.
The thread will spin and check if there are any messages to log if not it will do some housekeeping work.
You can configure it to sleep if you want but I won't recommend you to set a sleep higher than 1 us. The reason for that is that it needs to wake up to pick up the log messages, because if it doesn't and the log messages are too many they can cause a queue allocation that will impact the hot threads.
Also you can pin the logging thread to a non critical core https://github.com/odygrd/quill/blob/master/qui…