[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
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

[RFC|Accepted] Session Backend Abstraction

Post by naderman » Mon Jul 19, 2010 8:41 am

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 » Fri Oct 22, 2010 10:47 am

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
Product Manager
Product Manager
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Karlsruhe, Germany
Contact:

Re: [RFC|Accepted] Session Backend Abstraction

Post by naderman » Mon Oct 25, 2010 5:33 pm

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 » Mon Oct 25, 2010 9:12 pm

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).

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

Re: [RFC|Accepted] Session Backend Abstraction

Post by igorw » Tue Oct 26, 2010 7:22 am

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