Jump to content

inodes limit exceded


flash760

Recommended Posts

I just (about a month ago) installed v6.2 with a new hosting company. Then suddenly it stopped working. I found that my Apache inodes limit was reached at 250,000. When looking in the ./cache folder, all the entries are from CubeCart 6. Is this as a result of having to clear cache after every update? It has shut my site down, which is unacceptable. Is this a problem y'all have identified and have a fix? Can this folder be emptied without affecting the operation of the site? 

Here is a typical file name: a6005.sql.4c7082ec64ab2c24bf242509af3d7806.cache

Here is the contents of the file:

a:2:{s:4:"time";i:1532111718;s:6:"expire";i:86400;}
-- CubeCart Cache Split --
b:1;

These seem to be calls to sql for product update for something similar. OR are these calls to the database to retrieve product information and this will happen over and over...?

Number if files on my site:

129410 ./cache
  94436 ./cube
  16261 ./images
   3232 ./hisstaff.com
   1793 ./wp
   1694 ./papasknives.com
Link to comment
Share on other sites

There seem to be reports from a handful of sites of vast numbers of cache files but this is an unusual situation and the cause hasnt been discovered.

You can certainly delete all of the cache files but these will simply be recreated and while that is happening your site will be much slower and if a lot of cache files are created very quickly it could have a serious impact on the server file system

A different cache method would certainly prevent this from happening and either memcached or redis would store all of these in memory - the problem is that almost no hosting company will install REDIS and very few even install memcached - we have both of these available on our CubeCart hosting servers if you are interested

Ian

Link to comment
Share on other sites

I had a similar issue recently, but was at the OS level. Use some form of memory caching instead and you'll be fine. Alternatively increase the configured limit of nodes. some hosting providers will limit the number and not allow it to be changed, in which case grab a VPS or managed VPS and configure it as needed.

https://support.cubecart.com/Knowledgebase/Article/View/235/41/how-do-i-enable-apc-memcached-redis-or-xcache

On the flip side, I have noted that there does appear to be a much larger cache being built than I would expect which makes me suspect some kind of cache system issue. The longer you leave the cache uncleared, the worse it gets. I suspect new cache files are created in place of older ones, yet the older ones never clear and thus over time things build up to excessive levels if not cleared frequently. 

I assume that if the same page, with the same content is cached multiple times, its should re-use the same cache file. I don't think it does this.

 

Link to comment
Share on other sites

I suspect that the frequent clearing of cache in earlier versions masked an issue, and with the recent change it's made that issue more notable. I've not checked into it and it's just a gut feeling / theory, but it ties in with some reports I've had as well.

Link to comment
Share on other sites

Just now, Noodleman said:

I suspect that the frequent clearing of cache in earlier versions masked an issue, and with the recent change it's made that issue more notable. I've not checked into it and it's just a gut feeling / theory, but it ties in with some reports I've had as well.

The cache is going to get big. Imagine 50 SQL queries cached on product detail page multiplied by 750 items. Well thats 37,500 files for just that bit of the catalog. 

I suppose the test is to clear the cache and refresh certain pages and see how much it grows. 

Link to comment
Share on other sites

So I just did a basic test on my site and it makes me think that the cache is per session (again, just a theory).

if I go to my homepage in Chrome, the cache size increased with an additional 11 SQL cache files. if I reload the page, no more files. I then load the same page in Edge, and it reached and built another set of 11 cache files. the only difference is browser, thus session. The content is the same and should be using the cache built from the previous browser load. 

Over time, this will increase/build up excessive cached items. Shouldn't the existing cached items be reused?

this appears to only be caused by SQL cache. page cache is working OK

 

Link to comment
Share on other sites

Just now, Noodleman said:

So I just did a basic test on my site and it makes me think that the cache is per session (again, just a theory).

I'd be very surprised if that was the case as there is no session data tied to cache storage at all. 

Link to comment
Share on other sites

From the original post, what directory structure are we looking at? I do not recognize it.

CubeCart will use a folder located within its own structure for the caching of its SQL queries and compiled skin templates. It is at:

/public_html/subfolder/cache/ and the /skin/ folder within that.

Where /public_html/ is the typical name of the web site "docroot" folder, and /subfolder/ may or may not be present - depending if there is some other application at docroot (WordPress, maybe?).

For a short duration experiment, in admin, Store Settings, Advanced tab, disable the Cache. After a few days, run your inode report. Compare the results. (Yes, your site will almost imperceptively run slower, and the hits to the database will dramatically increase.)

Link to comment
Share on other sites

  • 2 weeks later...

I'm still of the opinion something isn't correct... a mid-size store, 3500 products across an estimated 100 categories generates this in 48 hours

image.png.187f2371270ce268c95b80f5e2318eea.png

 

almost 700,000 cached objects. This makes the "clear cache" button not work as it just can't clear this many files before throwing an error. 

Link to comment
Share on other sites

It could potentially be debugged by changing the way the cache file name is stored or a flat file could be written to with each cache write to store the SQL query. 

CubeCart caches by default so it might be worth checking 3rd party extensions too. The code in CubeCart has a lot of SQL queries.. multipied by 3,500 products could be massive. 

Let me know if you find anything. I got back from a stag do in Bournemouth last night so a little hazy still today. 

Link to comment
Share on other sites

11 minutes ago, Al Brookbanks said:

It could potentially be debugged by changing the way the cache file name is stored or a flat file could be written to with each cache write to store the SQL query. 

CubeCart caches by default so it might be worth checking 3rd party extensions too. The code in CubeCart has a lot of SQL queries.. multipied by 3,500 products could be massive. 

Let me know if you find anything. I got back from a stag do in Bournemouth last night so a little hazy still today. 

that seems reasonable. I'll probably go with a cache log. would you mind giving a couple pointers on the correct location for it? Would save me some trial and error :)

Link to comment
Share on other sites

Just set this up and I immediately see a problem coming from some modules. SQL queries which have specifically been run to NOT cache are being written to cache.

$GLOBALS['db']->query($sql, false, 0, false);

Based on around 5 minutes of collecting data, I'm already seeing 3,500 of these non-cached queries being written to cache.

 

Link to comment
Share on other sites

1 minute ago, Noodleman said:

Just set this up and I immediately see a problem coming from some modules. SQL queries which have specifically been run to NOT cache are being written to cache.


$GLOBALS['db']->query($sql, false, 0, false);

Based on around 5 minutes of collecting data, I'm already seeing 3,500 of these non-cached queries being written to cache.

 

Great. Sounds like progress. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...