-
-
Notifications
You must be signed in to change notification settings - Fork 162
FixedWindowRoller: rotate log files in a separate thread #117
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
Conversation
|
Hi @yakov-bakhmatov thanks for opening this PR! I'm just catching up from the holiday season but I should have some time to review this soon. One question I had: is there a benchmark that you have that demonstrated the delays? Also, would you rebase on master? |
a6688dd to
96a134b
Compare
|
Hello, @estk Thanks for a great library. Benchmark code: https://github.com/yakov-bakhmatov/log4rs-benchmark My results: Office desktop, Windows, 4 cores, SSDLinux server, 12 cores, SSDAncient laptop, Linux, 2 cores, HDD 5400 rpm |
|
The benchmark is configured for a maximum log file size of 100 MB. |
|
First thing, would you rebase again? Sorry, somehow I didnt have CI set up correctly and it didnt run. So I started peeking around and this is awesome! |
…async_rotation` feature
96a134b to
ebb7b2b
Compare
|
Sorry for the delay in answering. |
|
@yakov-bakhmatov Thanks! |
|
@yakov-bakhmatov also, if you're interested, I'd love to add that code that showed the issue as a bench test. Would you be interested in submitting another pr? Or do you mind if I lift that code? |
Compression of large files during log rotation may take several seconds. At this time, all threads writing logs are blocked, which can lead to undesirable delays.
The problem is resolved when the rotation is executed in a separate thread. Library users can enable new behavior using feature
async_rotation.