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

Logger performance due to open/seek/write/close system calls for each logged message #96

Open
vsarunas opened this issue Aug 5, 2024 · 3 comments

Comments

@vsarunas
Copy link

vsarunas commented Aug 5, 2024

Running into a problem if there is a high rate of logging that the logger is unable to keep up and what is written on disk can lag behind several minutes. With all of the log messages being queued in memory.

Creating a test which logs via FileLogger(logFile,logFormat: logFormat, fileURL: fileURL, flushMode: .manual) does not seem to help much on macOS: attaching using Instruments and profiling using File Activity.

For flushMode: .always:
instruments_file_activity_flush

For flushMode: .manual:
instruments_file_activity_noflush

The only difference is sys_fstat64 duration; but how far behind the written log messages fall behind the current time does not seem to drastically change.

On Linux, sync() visible in a FlameGraph at least:
linux_filehandle_sync

@vsarunas
Copy link
Author

vsarunas commented Aug 6, 2024

Fresh sample on Linux with flushMode: .manual:

puppy_without_sync

@aehlke
Copy link

aehlke commented Aug 29, 2024

This project appears to be abandoned.

@vsarunas
Copy link
Author

@sushichop are you still working on this project?

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