Page 1 of 1

Are you using cumuluswebtags.php?

Posted: Wed 27 Jan 2016 1:20 pm
by mcrossley
If so, you may be interested in the following...

On my shared web host (actually Steve's server) I started getting warnings in the PHP error log along lines of "PHP Warning: Unknown: Unable to allocate memory for pool." when including PHP scripts within the main script.

This was traced to the Alternative PHP Cache (APC) module on the server, which caches PHP scripts in memory, this was running out of memory, and the memory usage was really badly fragmented.

Increasing the memory allocation relieved the situation, but I noticed that the cumuluswebtags.php file was being cached multiple times - often with zero hits.

Caching the web tag file is a bad idea, as it frequently changes, it is re-cached every time a modified version is accessed. This can actually slow down the access time. It is better if fast changing files such are these are excluded from the cache altogether.

The solution was to add an exclusion to the apc.ini configuration file, the entry we used was as follows...

Code: Select all

apc.filters="cumuluswebtags.*php"
This excludes the standard cumuluswebtags.php file, and also two additional files I use on my website; cumuluswebtagsRealtime.php and cumuluswebtagsMonthly.php.

Since doing this the APC memory usage has dropped, and the cache fragmentation has dropped to virtually zero (well actually zero so far!). And no more warnings in the error log.

If you use the cumuluswebtags.php file and your server uses APC for PHP caching I strongly recommend you look into implementing an exclusion filter.

Re: Are you using cumuluswebtags.php?

Posted: Sat 06 Feb 2016 11:07 pm
by jdc
Interesting. I can't recall seeing any errors but will have a hunt around. My whole site runs on phptags.
Thanks.

Re: Are you using cumuluswebtags.php?

Posted: Sun 07 Feb 2016 9:36 am
by laulau
mcrossley wrote:
The solution was to add an exclusion to the apc.ini configuration file, the entry we used was as follows...

Code: Select all

apc.filters="cumuluswebtags.*php"
"*" should be before ".php" i think ?

Code: Select all

apc.filters="cumuluswebtags*.php"

Re: Are you using cumuluswebtags.php?

Posted: Sun 07 Feb 2016 7:18 pm
by steve
Laurent, that's what I said when Mark asked me to add it. But I was wrong, and Mark is right, of course, because it's a regular expression.

Re: Are you using cumuluswebtags.php?

Posted: Sun 07 Feb 2016 9:59 pm
by laulau
:oops: :oops: :oops: