Joomla web development, eMarketing and training
Home Joomla 1.5 Web Development sh404sef 1.5 Sh404 URL Cache memory size
sh404sef 1.5
Sh404 URL Cache memory size
Friday, 26 September 2008 12:44

Question: Today my website says the following. Help.

Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 11796480 bytes) in /public_html/components/com_sef/cache/shCacheContent.php on line 17285

Answer:
To help speed up the site, SH404 caches the sef urls. This is good. It keeps the sefs and related dynamic urls in "cue" so the pages load faster. This is an important function. There is nothing worse than a slow site.

However, the default memory size for the cache is quickly maxed out and you may come to your site one day and see an error like the above.

To rectify this, set the memory size to 100,000 in components > sh404 > Configuration > Advanced > Cache Size.

We also found a cron job that someone wrote to automatically purge the cache once a week.

05 00 * * 1 /bin/rm /www/vhost/lacuruxa.es/public_html/components/com_sef/cache/shCacheContent.php

That means: "Delete shCacheContent every moonday at 05:00 a.m."

Additionally, we suspect part of the problem may be the parameter to record "duplicate urls". We will test further and update this post if need be.

Note: In Joomla 1.0, Virtumart also had memory problems. Technically, it was not Virtumart, but the server itself. The solution was to add this line at the top of the Joomla configuration file.

ini_set("memory_limit","12M");

 
Comments (2)
default 10000 urls
2 Wednesday, 29 October 2008 11:05
Marco
Hi,
Sometimes the counter will go up 10000 and php will end in not entough memory.I have disable the file cashing, only database cashing
Comments
1 Thursday, 02 October 2008 08:40
Yannick Gaultier
Hi Michael,
1 - if you are experiencing such memory issues, you should DECREASE the cache size. The default value is 10 000. You should try 5 000 for instance. Do no increase the size to 100000, this is way too much. Remember this is expressed in number of urls, not kilobytes, as clearly expressed in the tooltip next to the parameter
2 - sh404sef does already delete the cache every week. There is actually a param under the Very adv. tab to decide how often you want the cache cleared. Most people don't have cron access anyway.
3 - The problem is not in the "duplicate url". There is actually no problem. You only need to make sure you use the memory available on your server, but not more. Please also note that we are talking about memory consumption. The cache in sh404sef uses memory, Joomla uses memory, Virtuemart and every extension you use need memory, and an error occurs when the combined amount of memory exceeds the one made available to php by your server settings.
The default 10000 urls stored in the cache will be OK for most users, but not all, depending on what extensions you use on your site.

Add your comment

Your name:
Subject:
Comment:
  The word for verification. Lowercase letters only with no spaces.
Word verification:



+ Suggested tags