Page MenuHomePhabricator

Investigate ways to decrease MW->sessionstore traffic
Closed, InvalidPublic

Description

Currently we're making ~35k req/s from MW to session storage (redis at the point of writing). This is a lot of requests and it's unclear if all of those are required.

One clear source of excess traffic is construction of the SessionBackend: as soon as it's constructed we [[ https://github.com/wikimedia/mediawiki/blob/master/includes/session/SessionBackend.php#L155 | make an attempt ]]to check for session data in the store. This happens for entirely new sessions too, so the vast majority of requests return a 404.

When an entirely new session is created, we can skip doing this read because we can be quite sure the read will result in a 404.

Event Timeline

Pchelolo created this task.Feb 11 2020, 4:46 PM

Change 571542 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Only try fetching the session from backend is we didn't just generate the ID

https://gerrit.wikimedia.org/r/571542

Change 571542 abandoned by Ppchelko:
Only try fetching the session from backend is we didn't just generate the ID

Reason:
Flawed assumptions

https://gerrit.wikimedia.org/r/571542

Pchelolo closed this task as Invalid.Feb 11 2020, 7:35 PM

I haven't realized the store we have is a CachedBagOStuff thus a check I wanted to eliminate only goes to the backend store once.

I guess the only other way to eliminate that read is to hope the session Id generated will not collide, but I guess that's a risk we can't take.