Welcome to all phpBB2 Refugees!This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area. |
|
Author |
Message |
qspy Board Member
Joined: 03 Nov 2009
Posts: 10
|
Posted: Tue Nov 03, 2009 7:09 pm Post subject: Memcached, detailed usage strategy on phpbb2 forum |
|
|
I want to know what is your strategy of using memcached in phpbb2 script.
For me its like this:
index.php main query for 15 seconds
viewforum.php
Quote: | //
// Grab all the basic data (all topics except announcements)
// for this forum
//
$cache_time = 5;
if ($start == 0 ){
$cache_time = 5;
} else if ($start > 0 && $start < 320) {
$cache_time = 5;
} else if ($start >= 320 && $start <= 500) {
$cache_time = 43200;
} else if ($start > 500 && $start <= 900) {
$cache_time = 86400;
} else if ($start > 900 && $start <= 1000) {
$cache_time = 172800;
} else {
$start = 0; // message, that LIMIT is too big and older topics are only accessible throught search
} |
search.php (search results only in memory for 10 minutes, no database at all)
usercp_viewprofile.php "main" query, for about 1 day
Its almost all.... i was have banlist for couple days but it exceeded 1 MB of text and i just dont display banlist in panel only if $show=1 is added.
Thats all i think (quick write, could miss something).
Where do you use memcached in phpbb? (too bad phpbb2 and 3 dont have build in support like vbulletin for memcached).
My plan is to rewrite sessions from database to memory, but its little harder and bigger project because session sql queries are combined with user table queries. |
|
Back to top |
|
|
Dog Cow Board Member
Joined: 18 Nov 2008
Posts: 378
|
Posted: Wed Nov 04, 2009 1:36 pm Post subject: Re: Memcached, detailed usage strategy on phpbb2 forum |
|
|
qspy wrote: |
Its almost all.... i was have banlist for couple days but it exceeded 1 MB of text and i just dont display banlist in panel only if $show=1 is added.
| Did you partition your ban list?
For starters, you could probably remove the banned email address check when spawning a new session.
Then that leaves putting IP addresses into one cache, and the banned user IDs into another.
If you still run out of room, then you'd need to sub-divide even further. _________________ Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL • Mac 512K Blog • Mac GUI |
|
Back to top |
|
|
qspy Board Member
Joined: 03 Nov 2009
Posts: 10
|
Posted: Sun Nov 08, 2009 1:10 am Post subject: Re: Memcached, detailed usage strategy on phpbb2 forum |
|
|
Dog Cow thats is not really a problem, dont know if you correctly understand what i mean saying about banlist.
But dont know why you guys are not really using memcache and are not interested in it. With it you can made phpbb perfectly scalable eliminating 60% of database hits (queries).
All is about strategy of using it, because phpbb is from definition dynamic script (forum) and not everything we can cache because it will loose essential functionality.
Project of rewriting session managment is quite big, but think about that, non blocking (table locks), unlimited, independet from database sessions |
|
Back to top |
|
|
Dog Cow Board Member
Joined: 18 Nov 2008
Posts: 378
|
Posted: Sun Nov 08, 2009 2:49 pm Post subject: Re: Memcached, detailed usage strategy on phpbb2 forum |
|
|
qspy wrote: | Dog Cow thats is not really a problem, dont know if you correctly understand what i mean saying about banlist. | Then why don't you explain what you mean? _________________ Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL • Mac 512K Blog • Mac GUI |
|
Back to top |
|
|
Amodinos Board Member
Joined: 21 Oct 2009
Posts: 5
|
Posted: Mon Nov 09, 2009 6:44 pm Post subject: Re: Memcached, detailed usage strategy on phpbb2 forum |
|
|
I have used memcached once, and I won't be using it again. The only things I really found it useful for was topic views, but then I decided a work around for periodic updates is better.
For mainly static queries I am using MySQL's default cache feature. This has worked very well. And I believe (not trying to sound like an egoman) I have one of the biggest phpBB2 forums in terms of traffic (up to 8m page views a day on phpBB alone). My sessions are in memory and so far it really hasn't caused any issues at all. |
|
Back to top |
|
|
|
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0561 seconds using 16 queries. (SQL 0.0155 Parse 0.0006 Other 0.0400) |
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com
|
|