Anyone knows which version of acm_xcache.php works with phpBB 3.0.5?ToonArmy wrote:Chris also forgot to press submitnaderman wrote:Chris started an article on caching: http://wiki.phpbb.com/Cache
ACM Modules
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Re: ACM Modules
- bantu
- 3.0 Release Manager
- Posts: 557
- Joined: Thu Sep 07, 2006 11:22 am
- Location: Karlsruhe, Germany
- Contact:
Re: ACM Modules
The package php5-xcache (1.2.2-3) in Ubuntu/Debian works out of the box for me. All I had to do was edit the xcache ini file.davidyin wrote:Anyone knows which version of acm_xcache.php works with phpBB 3.0.5?
Re: ACM Modules
The modules in SVN should work fine with 3.0.5, you will need acm_xcache.php and acm_memory.php.davidyin wrote:Anyone knows which version of acm_xcache.php works with phpBB 3.0.5?ToonArmy wrote:Chris also forgot to press submitnaderman wrote:Chris started an article on caching: http://wiki.phpbb.com/Cache
Re: ACM Modules
Chris, I've started dumping my tuning notes in my wiki user space: Terrye/A phpBB Use Case Discussion, where I've identified and discussed 3 main infrastructure use cases for the phpBB installation. You might want to track this and the other pages that I'll dump there. At the moment this is just working thoughts, but I want to turn them into an installation / tuning guide eventually. What is quite clear to me is that the acm_files module should really be optimised for the "shared web hosting" scenario and the PHP accelerator versions for the Virtual and Dedicated Hosting scenarios. Anyway have a scan.
I want to finish my tuning analysis, but I already have some outline suggestions that will help with performance improvement that you might consider worthwhile and slipstream into 3.0.6. I just want to double check them first to avoid making a prat of myself and wasting your time. Terry.
I want to finish my tuning analysis, but I already have some outline suggestions that will help with performance improvement that you might consider worthwhile and slipstream into 3.0.6. I just want to double check them first to avoid making a prat of myself and wasting your time. Terry.
Last edited by TerryE on Tue Jun 16, 2009 1:16 am, edited 1 time in total.
Forum Admin OpenOffice.org User Groups
Re: ACM Modules
Terry, we've already been reading it.TerryE wrote:Chris, I've started dumping my tuning notes in my wiki user space: Terrye/A phpBB Use Case Discussion, where I've identified and discussed 3 main infrastructure use cases for the phpBB installation. You might want to track this and the other pages that I'll dump there. At the moment this is just working thoughts, but I want to turn them into an installation / tuning guide eventually. What is quite clear to me is that the acm_files module should really be optimised for the "shared web hosting" scenario and the PHP accelerator versions for the Virtual and Dedicated Hosting scenarios. Anyway have a scan.
I want to finish my tuning analysis, but I already have some outline suggesting that will help with performance improvement that you might consider worthwhile and slipstream into 3.0.6. I just want to double check them first to avoid making a prat of myself and wasting your time. Terry.
Re: ACM Modules
One example is where you've added extra tracking variables <prefix>sql_<tablename> which contains the array
I suggest that you store the array '<md5hash>' => ttl instead and run over it with an array_filter() to cull expired entries whenever you load this and thus keep it from growing. You can also do the trick of gating this prune by a if (rand(1,20) == 1) clause so that it is only done on 5% of the updates, thus minimising the overhead.
- '<md5hash>' => true
I suggest that you store the array '<md5hash>' => ttl instead and run over it with an array_filter() to cull expired entries whenever you load this and thus keep it from growing. You can also do the trick of gating this prune by a if (rand(1,20) == 1) clause so that it is only done on 5% of the updates, thus minimising the overhead.
Forum Admin OpenOffice.org User Groups
Re: ACM Modules
Something like this:
Code: Select all
Index: includes/acm/acm_memory.php
===================================================================
--- includes/acm/acm_memory.php (revision 9588)
+++ includes/acm/acm_memory.php (working copy)
@@ -281,6 +281,7 @@
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
$hash = md5($query);
+ $time = time();
// determine which tables this query belongs to
// Some queries use backticks, namely the get_database_size() query
@@ -308,8 +309,12 @@
{
$temp = array();
}
+ else
+ {
+ $temp = array_filter($temp, array('acm_memory', '_expiration_filter'));
+ }
- $temp[$hash] = true;
+ $temp[$hash] = $time + $ttl;
// This must never expire
$this->_write('sql_' . $table_name, $temp, 0);
@@ -331,6 +336,11 @@
$query_result = $query_id;
}
+ function _expiration_filter($expires)
+ {
+ return (time() < $expires) ? true : false;
+ }
+
/**
* Ceck if a given sql query exist in cache
*/
Re: ACM Modules
ToonArmy wrote:The modules in SVN should work fine with 3.0.5, you will need acm_xcache.php and acm_memory.php.davidyin wrote:Anyone knows which version of acm_xcache.php works with phpBB 3.0.5?ToonArmy wrote:Chris also forgot to press submitnaderman wrote:Chris started an article on caching: http://wiki.phpbb.com/Cache
Thank you very much.
Re: ACM Modules
PHP is not the strongest of my languages, but isn't _expiration_filter a class method? In which case shouldn't this be coded as follows?ToonArmy wrote:Code: Select all
+ else + { + $temp = array_filter($temp, array('acm_memory', '_expiration_filter')); + }
Code: Select all
+ $temp = array_filter($temp, array($this, '_expiration_filter'));
Forum Admin OpenOffice.org User Groups
Re: ACM Modules
Yes, that looks correct. I guess Chris would have noticed once he tried running his code 