Jool icon indicating copy to clipboard operation
Jool copied to clipboard

Session timer enhancement

Open pcarana opened this issue 7 years ago • 0 comments

Under a load test scenario, the timer used for session expiration can affect the packet translation time. When the expired sessions are being removed, assuming that there are serveral expired sessions, the spin lock used can delay the packet translation the same time that the lock spends removing sessions.

The proposal (thanks @ydahhrk) is to "independize" the session removal timer, so that its behavior can be customized. The timer will do this:

  1. Start execution every 2 seconds and try to remove 1024 expired sessions.
    1. If this is enough, keep the same time and sessions to remove.
    2. If this isn't enough, the next execution will start in 1 second and will try to remove 2048 sessions.
      1. If this is enough, the next execution will start in 2 seconds and will try to remove 1024 sessions (aka begin from the start).
      2. If this isn't enough, the next execution will start in 0.5 seconds and will try to remove 4096 sessions.
        1. And so on...

Removing expired sessions isn't as important as translating packets, but it's still something that must be done (we don't want to keep expired sessions).

pcarana avatar Dec 04 '17 21:12 pcarana