phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

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.

PHPBB and WinCache


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Fri Sep 23, 2011 2:59 pm 
Post subject: PHPBB and WinCache

Have been looking through the WinCache documentation

http://us3.php.net/manual/en/ref.wincache.php

and of particular interest is the USERCACHE function which apparently can be told to store certain things from PHPBB.

Anyone have any idea of some good places in PHPBB2 this could be implemented? Could result in significant performance increases

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Fri Sep 30, 2011 8:12 pm 
Post subject: Re: PHPBB and WinCache

Ok, made some progress on this.

Basically you can store array's and vars.

So example

$sql = "SELECT f.forum_id, f.cat_id, f.forum_name, f.forum_desc, f.forum_status, f.forum_order, f.forum_posts, f.forum_last_post_id, f.forum_last_post_time, f.auth_view, f.forum_icon, f.forum_parent
FROM ( " . FORUMS_TABLE . " f)

ORDER BY f.cat_id, f.forum_order";

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
}


$forum_data = $db->sql_fetchrowset($result);



Basic Query now you can take the result and insert it into Wincache

wincache_ucache_set("FORUMDATAKEY", $forum_data, 600);


}

Problem I am having is this. Has to do with SQL_Fetchrow

I want to take this

$sql = "SELECT f.*
FROM ( " . FORUMS_TABLE . " f)

ORDER BY f.cat_id, f.forum_order";

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}

$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;

if ($row['forum_last_post_time'] > $userdata['user_lastvisit'])

$new_topic_data[$row['forum_id']][$row['topic_id']] = $row['forum_last_post_time'];
}



$db->sql_freeresult($result);

if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}


Insert result of query into WinCache and then have the last part above

(This)

$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;

if ($row['forum_last_post_time'] > $userdata['user_lastvisit'])

$new_topic_data[$row['forum_id']][$row['topic_id']] = $row['forum_last_post_time'];
}



$db->sql_freeresult($result);

if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}


do the same thing as it would with the result that I can grab and present ahead of this with WINCACHE.

So basically it would be something like


$queryresults = $datafromwincache;

***SOMETHING NEEDS TO GO HERE TO CONNECT THE TWO***

$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;

if ($row['forum_last_post_time'] > $userdata['user_lastvisit'])

$new_topic_data[$row['forum_id']][$row['topic_id']] = $row['forum_last_post_time'];
}



$db->sql_freeresult($result);

if ( !($total_forums = count($forum_data)) )
{
message_die(GENERAL_MESSAGE, $lang['No_forums']);
}

_________________
http://www.jlaforums.com
Back to top
lumpy burgertushie
Board Member



Joined: 18 Nov 2008

Posts: 266


flag
PostPosted: Wed Oct 05, 2011 11:25 pm 
Post subject: Re: PHPBB and WinCache

I never understood the benefit of a cache for this unless you have a very large board and lots of traffic/views etc.

Even for phpbb3 I find it to be more of nusiance than a benefit.


robert
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Thu Oct 06, 2011 1:13 am 
Post subject: Re: PHPBB and WinCache

lumpy burgertushie wrote:
I never understood the benefit of a cache for this unless you have a very large board and lots of traffic/views etc.

Even for phpbb3 I find it to be more of nusiance than a benefit.


robert


We have a pretty large board. The cache has worked some miracles for us.

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Tue Jul 16, 2013 11:17 pm 
Post subject: Re: PHPBB and WinCache

Made some great progress with further implementation of Wincache and PHPBB.

Added alot of items such as seeding, board config, album, attachment and music config calls, attachment data, attachment thumbnail, forum plus cat data, album thumbnail just for starters. These have significantly reduced DB load and boosted overall site performance significantly.

For some reason, there are some RAM limitations in the WINCACHE config for the usercache and file cache. Was really hoping to start caching topic and post data - but this will fill the cache in a matter of minutes and cause contention with the smaller frequently used items that needed to be cached.

_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Sat Jul 20, 2013 4:39 pm 
Post subject: Re: PHPBB and WinCache

Finally got around to adding the viewforum queries to Wincache. Was already using it for the category bread crumbs and general forum info - but now added all of the topic data which nows saves 2 more queries off the page. Had to add cache updates to the posting functions so if a user posts a new topic the topic will appear immediately if they choose to go to the posted forum's index to see their post listing.
_________________
http://www.jlaforums.com
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 451
Location: U.S.A


flag
PostPosted: Mon Mar 03, 2014 7:32 pm 
Post subject: Re: PHPBB and WinCache

Another item added to the Wincache routine in the $is_auth array's on viewtopic, viewforum and the index. The one from our index (with 600+ forum sections is over 172K which translates to a huge savings) Also using this on the forum attachment thumbs, attachment photos. The rest of the auth areas are soon to follow.

The $is_auth is cached by user_id. Save a couple queries per page which makes things good!

_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 4 Hours
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0399 seconds using 17 queries. (SQL 0.0086 Parse 0.0007 Other 0.0306)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo