Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
D7 introduced an optimization for session writing in #744384: Do not write unchanged sessions to the database.
While it's not such a big saving with memcache, when profiling a D6 site I noticed two dmemcache_set() from memcache-session.inc which could be skipped using much the same logic.
Attached patch is against D6, this can likely be ported across to 7.x too though.
Comment | File | Size | Author |
---|---|---|---|
#11 | memcache-lazy-session-writing-973228-11.patch | 4.35 KB | tsphethean |
#7 | memcache-lazy-session-writing-973228-7.patch | 4.64 KB | markpavlitski |
memcache_session.patch | 4.86 KB | catch |
Comments
Comment #1
catchComment #2
Jeremy CreditAttribution: Jeremy commentedWith this patch in place, I've started seeing the following PHP notice when I log out:
We could use $user->session_data_present_at_load to determine whether or not $session->sid is available and avoid this error.
Otherwise, I'm not seeing any problems introduced by this patch.
Comment #4
Jeremy CreditAttribution: Jeremy commentedFixed & committed:
http://drupal.org/cvs?commit=465158
Thanks, Nat!
Comment #5
Jeremy CreditAttribution: Jeremy commentedMarking as "to be ported" to remember that this still needs to be ported to D7.
Comment #6
ogi CreditAttribution: ogi commentedsubscribe
Comment #7
markpavlitski CreditAttribution: markpavlitski commentedPatch for latest 7.x-dev attached.
Comment #8
pwaterz CreditAttribution: pwaterz commented@markpavlitski What the state of that patch? How much testing has been done it?
Comment #9
markpavlitski CreditAttribution: markpavlitski commented@pwaterz personally I've done a reasonable amount of testing against it (at the time of submission) and have been using it in a production environment.
I can't vouch for it now however as there have been a slew of fixes and changes to the module over the last few months.
Unfortunately I don't have much spare time to work on this at the moment.
Comment #10
pwaterz CreditAttribution: pwaterz commentedThanks Mark, that exactly what I needed to know. I have big push from my company to get this working, so I will most likely be putting some time into getting the sessions working in the next few weeks.
Comment #11
tsphethean CreditAttribution: tsphethean commentedHad a go at re-rolling the patch from #7 against the latest 7.x-1.x branch.
Will be do some further testing on this soon hopefully.
Comment #12
pwaterz CreditAttribution: pwaterz commentedJust though I would note that we switched to using the memcache_storage module instead of this one because this one seems to be abandoned. Have had zero issue since we made the switch. Session handling works perfect.
Comment #13
tsphethean CreditAttribution: tsphethean commentedThanks @pwaterz, will take a look at memcache_storage.
Comment #14
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedMemcache module doesn't support sessions.
Comment #15
DamienMcKenna"Closed (won't fix)" is the appropriate status if the proposed change isn't going to be included.