xendo commented on PR #1410: URL: https://github.com/apache/logging-log4j2/pull/1410#issuecomment-1500188250
We can reproduce this pretty reliably. There may be a secret ingredient in our setup (we use custom LogEventPatternConverters), but as I said before, we were not able to produce minimal reproducer that I could share. We initially confirmed that additional discard buffer proposed here mitigates the issue. We looked into SYNCHRONIZED policy, but the problem we have is that it can make the performance worse when the traffic is the highest. The service we own is latency sensitive and the tradeoff we want to make is to discard the logs if we can't keep up. As far as I understand the DISCARD and SYNCHRONIZED policies are mutually exclusive. SYNCHRONIZED_DISCARD policy may be another way to solve this. > When the buffer is full, each time an event is processed, the background thread will notify all waiting threads. Yes, that was also something I noticed while running benchmarks, although the impact was not nearly as big as it was when you [initially worked on this](https://github.com/apache/logging-log4j2/pull/273) . > The ringbuffer we use is configured for multi-producer-single-consumer, where concurrent requests to add data should be safe. From what I can tell it not always is. Ideally that's what should be fixed but, to be honest, I don't know how. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
