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

Writing to Log Blocks Other Operations #10368

Closed
brianlong opened this issue Jun 2, 2020 · 5 comments
Closed

Writing to Log Blocks Other Operations #10368

brianlong opened this issue Jun 2, 2020 · 5 comments
Labels
good first issue Good for newcomers locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Milestone

Comments

@brianlong
Copy link
Contributor

Problem

Writing to the log blocks other validator operations.

In Discord, I asked "Q: Does writing to the log file block any other threads/procedures within the validator?" and Leo replied "Logging does block. interesting. it's a synchronous write to a fd."

When the log level is low (info or debug), the amount of data written to the logs might interfere with block production on a busy validator.

Proposed Solution

Move the logger to an asynchronous thread.

If that is not possible, review the amount of data written to the logs and the log level for each. A busy validator should be able to run a log level of 'error' or 'warn' without a performance hit.

@mvines
Copy link
Member

mvines commented Jun 3, 2020

There's a convenient central location where the dispatch to another dedicated logging thread could be plugged in:

solana/logger/src/lib.rs

Lines 18 to 20 in 69d90b5

fn log(&self, record: &log::Record) {
LOGGER.read().unwrap().log(record);
}

This would incur another memory allocation for each log message, and might skew the logging timestamp (nbd).

Seems like we could enable "async logging" initially as a solana-validator command-line argument, to allow people to experiment with it

@mvines mvines added the good first issue Good for newcomers label Jun 7, 2020
@mvines
Copy link
Member

mvines commented Jun 7, 2020

It would be worthwhile to invest some time measuring where the time goes while logging. We burrow through at least 4 software layers within the validator itself from the info!() macro to when the contents finally hit the log file.

@mvines mvines added this to the The Future! milestone Jun 7, 2020
@stale
Copy link

stale bot commented Jun 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Jun 9, 2021
@stale
Copy link

stale bot commented Jun 16, 2021

This stale issue has been automatically closed. Thank you for your contributions.

@stale stale bot closed this as completed Jun 16, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2022

This issue has been automatically locked since there has not been any activity in past 7 days after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers locked issue stale [bot only] Added to stale content; results in auto-close after a week.
Projects
None yet
Development

No branches or pull requests

2 participants