Avoid reading session from the database multiple times during a big pipe request

Created on 12 January 2024, 10 months ago
Updated 21 August 2024, 3 months ago

Problem/Motivation

Found in šŸ“Œ Add authenticated user umami performance tests Fixed .

Bigpipe does rendering after the initial response is sent. Sending the initial response requires the session to be closed. This means that big pipe has to read the session again, this results in running the session read query twice in one request.

While this only reduces one database query, it does so when the dynamic render cache is fully warmed, so it's quite a high percentage of the non-cache database queries on those requests (15 down to 14). Once you take into account that most of the remaining 14 queries are cache tags (can also be moved to redis/memcache) and state (open issue to move to a cache collector), the percentage reduction is even higher.

Steps to reproduce

Proposed resolution

Add the session data to a property on the session handler, this allows the data to be got from there if the session is read twice.

Stacked on šŸ“Œ Add authenticated user umami performance tests Fixed for performance test coverage.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

šŸ“Œ Task
Status

Fixed

Version

10.3 āœØ

Component
BigPipeĀ  ā†’

Last updated 6 days ago

Created by

šŸ‡¬šŸ‡§United Kingdom catch

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024