You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something we've identified with load testing with is that the latency cost of logging "starting request" and "request completed" is very high under load: we observed p95 latency being 7x higher with log level at info vs log level at warn.
The reason for this is zerolog is currently configured to log to os.Stderr directly, without any buffering. This is relatively expensive in a cloud environment with network attached storage. To optimise this, it would help to use buffered logging. It looks like zerolog supports this.
The problem is, I don't think encore currently provides a way of configuring the RootLogger in runtimes/go/appruntime/logging.
I'm wondering whether
a. you'd be open to making this configurable
b. what your thoughts are on the config interface
For b., I can imagine either making it very flexible and allowing the caller to pass in an arbitrary zerolog.Logger with something like SetLogger, but maybe you'd prefer to be more opinionated and allow a non-blocking logging to be configured via standard Encore config.
Let me know your thoughts and I could have a stab at implementating this.
(Note, I brought this up in Discord here, but I think an issue is probably a better place to track this).
The text was updated successfully, but these errors were encountered:
Something we've identified with load testing with is that the latency cost of logging "starting request" and "request completed" is very high under load: we observed p95 latency being 7x higher with log level at info vs log level at warn.
The reason for this is zerolog is currently configured to log to os.Stderr directly, without any buffering. This is relatively expensive in a cloud environment with network attached storage. To optimise this, it would help to use buffered logging. It looks like zerolog supports this.
The problem is, I don't think encore currently provides a way of configuring the
RootLogger
inruntimes/go/appruntime/logging
.I'm wondering whether
a. you'd be open to making this configurable
b. what your thoughts are on the config interface
For b., I can imagine either making it very flexible and allowing the caller to pass in an arbitrary
zerolog.Logger
with something likeSetLogger
, but maybe you'd prefer to be more opinionated and allow a non-blocking logging to be configured via standard Encore config.Let me know your thoughts and I could have a stab at implementating this.
(Note, I brought this up in Discord here, but I think an issue is probably a better place to track this).
The text was updated successfully, but these errors were encountered: