1

I have a website with LOTS of nodes and LOTS comments. I have lesser space in the hosting plan and don't wont to buy more. The cache_field table of the site keeps on growing due to caching.

I disabled "Cache pages for anonymous users" in admin/config/development/performance and kept "Cache blocks" enabled. The current performance and load time with the current settings and after a cache clear is at an OK level. But still the cache_field grows. Same with the "Cache blocks" disabled.

Due to the size of the site I feel that caching of nodes and comment are not necessary.

How to stop cache_field table from growing?

More:

  1. I'm ok with coding
  2. I have a VPS with 20GB Disk, and 60% filled when cache is cleared. Once I cleared the cache when it was 75% filled and growing (with the cached data).
  3. Sorry for the late data I have 512MB ram.
5
  • What are the limitation of your current host? DB size, HD space, etc...
    – mikeytown2
    May 5, 2014 at 6:41
  • I have a VPS with 20GB Disk, and 60% filled without caching and I once cleared the cache when it was 75% filled with the cache. May 5, 2014 at 6:45
  • Can't you just kick that into a memory cache? Do you have enough RAM and control to use APC or memcached?
    – Mołot
    May 5, 2014 at 6:56
  • 512MB RAM for a site with a lot of comments? Typical installation profile will easily require 128MB just to install, and then 16-32MB per uncached client. So even if your OS does not need memory at all (idealistic case) your server could possibly be crashed by mere 16 people. Have you tested actual memory usage before you decided you do not need so much caching?
    – Mołot
    May 5, 2014 at 7:51
  • @Molot Thanks a lot for the pointing out. I actually have not done testing much. I cleared the cache when there are lot of people and at that time the load time was OK. I'm waiting for more traffic and then planning to go for a VPS plan with better resources. May 5, 2014 at 12:24

2 Answers 2

0

You could switch that cache bin so it uses something like file cache https://drupal.org/project/filecache

Also look into using memcache as that will evict the older cache data so that memcache stays within the parameters you give it.

Also consider optimizing the database; it should help to reduce the overhead http://dominiquedecooman.com/optimize-mysql-tables-gives-35-drop-disk-usage-drupal-7-performance-tip

Finally if you really want to disable that cache you can use the DrupalFakeCache backend for those cache bins https://drupal.org/node/797346

2
  • Thanks @Mikeyton2. But It will also cache and use my remaining space. Is there a way to stop the caching? May 5, 2014 at 6:39
  • Thanks @Mikeyton2, drupal.org/node/797346 seems to disable the cache. Thanks! May 5, 2014 at 12:12
0

If it's VPS, then you probably have enough control over it to use APC or memcached. Modules that may help with it:

And probably more. But they all are based on the same philosophy:

  1. Keep data in RAM, as disk access is slow
  2. Have a limited amount of storage, that never can be crossed
  3. If there is too much data, silently delete the least used elements

So just move cache_field bin to RAM and all your problems should be solved.

1
  • 1
    I already use Memcache Storage. But the cache_field is still written to the mysql database. Is there any option I forgot?
    – schulle877
    Jun 18, 2014 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.