-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
make event logging configurable #938
Comments
Hey @elagergren-spideroak, how were you running benchmarks? |
This is how you configure the logger: https://github.com/dgraph-io/badger/blob/1496af939d8533779f7b6b3f3a6cd251abf5c598/options.go#L231 In your case you'd create a logger that takes the input but returns immediately without doing anything with it. |
I've set the |
This seems to work:
|
Note that I’m not talking about general logging, I’m talking about event logging from x/net/trace. https://github.com/dgraph-io/badger/blob/e627d49fa7e9ddf9c31a833e83c4b3937bb81c66/db.go#L280 See also my screenshot. |
Are you running pprof while running your benchmarks? Could you share the whole pprof trace you obtained? Both web and top -cum output would be great |
I seem to have the same issue. @campoy can you explain what you mean by "running pprof while running your benchmarks"? In my case, the application calls |
Also here is
|
FWIW these same Printf calls are also responsible for a good chunk of allocations in some of my applications. Also, if someone can suggest what the API for this configuration should look, I may take a stab at implementing it. |
Yes, that's what I meant. @jarifibrahim, please have a look and see whether there's any improvements we can make and how you can guide Martin with his implementation |
This introduces an option to disable or enable trace.EventLog logging of events. For backward compatibility this defaults to true. The reason for making this configurable is that under some workloads the cost of event logging is significant and so can cause performance issues. Fixes #938
This introduces an option to disable or enable trace.EventLog logging of events. For backward compatibility this defaults to true. The reason for making this configurable is that under some workloads the cost of event logging is significant and so can cause performance issues. Fixes #938 (cherry picked from commit 75c6a44)
This introduces an option to disable or enable trace.EventLog logging of events. For backward compatibility this defaults to true. The reason for making this configurable is that under some workloads the cost of event logging is significant and so can cause performance issues. Fixes hypermodeinc/badger#938
What version of Go are you using (
go version
)?What version of Badger are you using?
v1.6.0
What did you do?
Ran benchmarks using badgerdb.
What did you expect to see?
I didn't expect to see logging appear on the CPU profile.
What did you see instead?
It did, and there's no way to turn it off.
In some of my benchmarks ~10% of the time spent inside (*DB).doWrites (and more elsewhere!) is spent printing to the event log. ISTM there's no way to disable this.
The text was updated successfully, but these errors were encountered: