NLog / NLog/NLog

Remove LogEvent SequenceID or change to 64 bit ?

Open
#4,159 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

discussion
Dominant language
C#
Stars
6.5k
Forks
1.4k
Avg merge
9h 17m
Merged PRs (30d)
24

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading issue #4139 and comparing the SequenceID and Counter layout-renderer wiki pages. Trace how SequenceID is incremented and consumed, then define whether the completed work removes it, merges the renderers, or changes its range; completion requires an agreed direction and corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.