[RFC|Accepted] Session Backend Abstraction

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

[RFC|Accepted] Session Backend Abstraction

Post by naderman »

Motivation
High traffic websites can already make use of memcache for improved caching. However volatile session data is still handled by the database, occasionally causing load problems.

Proposal
First very complete test coverage of current session code should be achieved to be able to guarantee the continued correct functionality of the session mechanism, which is of critical importance to running a board. The session code should then be refactored to provide an abstraction of the storage mechanism used, to allow for faster backends like memcache to be implemented.

Tracker Ticket
http://tracker.phpbb.com/browse/PHPBB3-9731

Patch (Work in Progress)
https://github.com/phpbb/phpbb3/pull/1322

nall
Registered User
Posts: 6
Joined: Fri Oct 22, 2010 10:35 am

Re: [RFC|Accepted] Session Backend Abstraction

Post by nall »

Since taking down the one and only memcache server would destroy all sessions (presumably -- unless you're planning to just cache what's in the DB), will memcache clusters be supported?

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC|Accepted] Session Backend Abstraction

Post by naderman »

Yes they will be, just like we currently support them for caching.

nall
Registered User
Posts: 6
Joined: Fri Oct 22, 2010 10:35 am

Re: [RFC|Accepted] Session Backend Abstraction

Post by nall »

naderman wrote:Yes they will be, just like we currently support them for caching.
Hmm. In includes/acm/acm_memcache.php, I see:

Code: Select all

                $this->memcache = new Memcache;
                $this->memcache->connect(PHPBB_ACM_MEMCACHE_HOST, PHPBB_ACM_MEMCACHE_PORT);
I believe connect() only supports a single server model. In order to support clustering, this needs to be changed to $this->memcache->addServer (called once per server).

igorw
Registered User
Posts: 500
Joined: Thu Jan 04, 2007 11:47 pm

Re: [RFC|Accepted] Session Backend Abstraction

Post by igorw »

A patch was submitted to fix this, and it will be included in phpBB 3.0.8.

For reference: http://github.com/phpbb/phpbb3/compare/ ... 81018b0915

Post Reply