Notifications
Clear all

[Solved] 150,000 Cache Files - 6 bytes each

21 Posts
8 Users
7 Reactions
917 Views
Posts: 23
Topic starter
(@udpride)
Eminent Member
Joined: 6 months ago

Im running into a rather severe issue with almost 150,000 WPForo cache files being created. 

It looks like that around 150000 files are coming from /home/mydomain/public_html/wp-content/uploads/wpforo/cache/item directory, more specifically, its subdirectories: ---

110416 ./reaction

34240 ./url

6399 ./topic

3357 ./avatar

In looking at the files in /reaction folder all files are 6bytes and contain this string: a:0:{}

I did a "DELETE ALL CACHES" and "CLEANUP" in WPForo main area, but it did not seem to have any real effect.  I did not do a "DELETE USER CACHE" yet.

Thats really secondary however to the endless files being created. They are being created infinitely and indefinitely to the point where you cant delete them fast enough.  In an hour or two they just hit my hosting maximum of 200,000 files.  Something is out of whack. But I need a pretty expedient fix.

Sample file: 125874_en_US

20 Replies
2 Replies
Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

Posted by: @udpride

Im running into a rather severe issue with almost 150,000 WPForo cache files being created. 

It looks like that around 150000 files are coming from /home/mydomain/public_html/wp-content/uploads/wpforo/cache/item directory, more specifically, its subdirectories: ---

110416 ./reaction

34240 ./url

6399 ./topic

3357 ./avatar

 

Hi @udpride,

Cache files allow you to have many times better performance and keep small amount of requests to the database. Please note that running a not-small forum on a shared hosting is not a good idea.

1. Shared Hosting: Shared hosting providers limit the number of files (also known as inodes) you can have. This can range from 100,000 to 500,000 files, depending on the provider and plan. So if yours allows 200k files then this is one of the bad shared hosting service.

2. VPS (Virtual Private Server): On a VPS, the number of files is generally limited by the amount of disk space.

3. Dedicated Hosting: With dedicated hosting, there are no specific limits on the number of files as well.

4. Cloud Hosting: Cloud hosting often offers more flexibility and there are no limits as well.

 

However you can still use your shared hosting service by disabling the reactions and URL cache. It's the 90% of all your cache files. Just use Code Snippets plugin to add this code or add this code directly in the functions.php of your child theme:

add_filter('wpforo_cache_url', '__return_false' );
add_filter('wpforo_cache_avatar', '__return_false' );
add_filter('wpforo_cache_reaction', '__return_false' );

 

Then use your FTP client or some File Manager plugin to delete the /cache folder in this directory:

wp-content/uploads/wpforo/

The /cache folder will be re-created by wpForo for topic and posts caches, but the number of those files will be small.

 

Reply
(@udpride)
Joined: 6 months ago

Eminent Member
Posts: 23

@robert OK thanks for the tips. I may try this. But long-term I may ultimately change my hosting plan to unlimited inodes. If 20M cache files a year would be considered a normal function of the Foro caching system, is there an expiration term on these cache files/folders?  Do files older than 30 days get auto purged or something? Or will they build up in perpetuity until the end of time?

When creating a backup archive of the entire node (web site) I will probably exclude these folders.

Reply
Posts: 23
Topic starter
(@udpride)
Eminent Member
Joined: 6 months ago

I was able to delete over 100,000 cache files in File Directory of CPanel, but the files just keep continuously generating at an alarming rate.

For instance in the /url cache folder its generating 30 files a second!

Reply
Posts: 23
Topic starter
(@udpride)
Eminent Member
Joined: 6 months ago

WPForo is creating roughly 5,000-7,000 cache files an hour among the aforementioned directories. Obviously something is wrong. This cannot be normal??  I would think there'd be some sort of WPForo cron to run and clean these up as well? Otherwise they would just pile up indefinitely. Help.

Reply
Posts: 23
Topic starter
(@udpride)
Eminent Member
Joined: 6 months ago

I turned caching off on WPForo for a couple days, then turned it back on this evening. In 2.5 hours it created over 6,000 cache files in the aforementioned directories. I had to turn caching back off as the increase would likely go in perpetuity.  This cannot be normal.  I assume there is something in the plugin that regulates and keeps the cache files to a sensible amount?

Is there anything that can be done about this?

Reply
Posts: 9
(@levelbest)
Active Member
Joined: 2 years ago

I'm about to launch a similar sized forum and this makes me a bit nervous.  Is anyone from WPForo able to explain what's going on?  I'm converting from Vbulletin.

Reply
Page 1 / 3