NLog
NLog copied to clipboard
Remove LogEvent SequenceID or change to 64 bit ?
Random thoughts after looking at #4139. And the overhead from synchronizing cpu-caches to atomically increment a counter that very few people uses, and unexpectedly can become negative after some days.
Lets say we have an application that handles 10.000 requests/sec. This application writes a single logevent for each request.
This means the application will write 36..000.000 logevents/hour. And 864.000.000 logevents/day.
Right now the SequenceID is an integer and can hold 2,147,483,647 events, before it becomes negative. So that is 3 days without restarts. Many applications often run 7 days without restarts.
Maybe the SequenceID-property should only increment when calling the propery-getter? (Skip on constructor)
Maybe https://github.com/NLog/NLog/wiki/SequenceId-layout-renderer should be replaced by https://github.com/NLog/NLog/wiki/Counter-layout-renderer ? (Merge into one)
Maybe the SequenceID-property should only increment when calling the propery-getter? (Skip on constructor)
Sounds good for NLog 5!
Sounds good for NLog 5!
Yes already implemented with #4247
But it only reduces the overhead. It doesn't really fix the issue with negative integer values
Ow yes indeed. Well I guess we can close this one. Long is also nice, but not sure if needed