Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Slow logging #100

Open
btrask opened this issue Nov 8, 2015 · 1 comment
Open

Slow logging #100

btrask opened this issue Nov 8, 2015 · 1 comment

Comments

@btrask
Copy link
Owner

btrask commented Nov 8, 2015

Our alogf log function prefixes logged messages with a timestamp, which is very useful. Unfortunately, that requires two printf statements, which we don't want to get split up by concurrent writes. Right now we're using flockfile(3) which makes logging even slower than usual.

Possible approaches:

  • Do all logging on a single thread
  • Use fputs_unlocked(3) to write without locking
  • Use write(2) (or libuv's equivalent) to write without locking

Not sure what the best (simplest/fastest) solution is.

Performance does in fact matter for traffic logging.

@btrask
Copy link
Owner Author

btrask commented Nov 10, 2015

Actually alogf isn't used for traffic logging. However traffic logging could still be made faster by doing all writing on a single thread, which would let us omit extra locking.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant