Bug 57299 - mod_session_dbd should not make a database call per request
Summary: mod_session_dbd should not make a database call per request
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_session_dbd (show other bugs)
Version: 2.4.6
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-02 22:17 UTC by Christoph Rabel
Modified: 2014-12-02 22:17 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Rabel 2014-12-02 22:17:45 UTC
Using mod_session_dbd is extremely inefficient, because session_dbd_load in mod_session_dbd.c fetches the session_record once per request from the database. Since there is also a "Cache-Control no-cache" header added, it's even worse than for normal pages where stylesheets, js, and so on are cached. For reference: https://issues.apache.org/bugzilla/show_bug.cgi?id=54608

If there are 16 "items" (images, stylesheets, ...) on a page, the database is queried at least 17 times (16 plus one for the page itself).

This is really annoying. So, in addition to storing it in the notes ( apr_table_setn(m->notes, note, (char *)zz);) I propose to store it in cache similar to mod_authn_dbd.c if it is available.