slog-rs / async

Asynchronous drain for slog-rs v2
Apache License 2.0
28 stars 24 forks source link

slog-async: even with increased chan_size, "logger dropped messages due to channel overflow" #26

Closed Geobert closed 3 years ago

Geobert commented 3 years ago

Hi,

I facing this "logger dropped messages due to channel overflow" when stress testing a server.

I've looked at how many records where dropped and increased the chan_size accordingly but I still have these drops, the biggest being hundred or so, so I increased again by adding more and more, but each time, I still have these drops of record :(

What am I doing wrong?

vorner commented 3 years ago

That sounds like you're logging more than what it can handle. The channel can only absorb a „burst“, not a sustained higher amount of messages. If you raise it, it'll sustain it for a bit longer, but eventually will run out anyway. You can choose between:

You could, in theory, set the channel size to insanely huge size so it absorbs the whole stress test, but that doesn't sound like a good idea in general.

Geobert commented 3 years ago

Thank you for your answer!

That's what I don't understand: I'm increasing the buffer like crazy and still got these drops.

I just want to do that for the stress test before setting a more reasonable size for the channel.

EDIT: after going up to 100k no drop anymore :D

EDIT2: It turns out I forgot to put a BufferWriter to my Drain, works way better with it… ^^'