32649 inodes / Files in my current gallery - This is a problem

Mr_Parsons

Joined: 2005-04-01
Posts: 28
Posted: Tue, 2008-07-29 15:08

Hi Guys,

I got an email from my host today saying I have exceeded my inode/file allowance. upon investigation it appears a small galler at www.leeandlou.co.uk is using 32649 inodes / files!

This is a massive amount and i cannot beleive that this has created this amount of files when I am storing only 1 copy of each photo, not keeping the original (at least the tick box is not ticked for 'keep original image').

does anyone have any ideas on whats causing this silly amount of files?

I'm currently awaiting details of which directory has all the files in.

Thanks in advance.

 
casacki

Joined: 2007-01-28
Posts: 16
Posted: Tue, 2008-07-29 15:41

From what I remind with the last installation a full install of Gallery is of somewhat 12 to 17 thousand files. So maybe you ran a second installation for test reasons and there you are.

From what I saw language files contribute much to this file count. If I had to reduce the files on my server, I would try to get rid of all the language files.

From what I read about Gallery 2.3 which is in RC1 status and therefore maybe only a couple of weeks away, there is another language handling implemented. Maybe by just waiting your problem might be solved soon.

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Tue, 2008-07-29 17:49

Gallery generates two cache files for each derivative: so two for the thumbnail, and two for each resize. It also caches lots of other stuff because generally disc access is faster than db access. I did a quick check on one of my gallery installations:

cache/derivative directory has 23558 files & directories
cache/entity has 30844
cache/module has 578
cache/repository has 51
cache/theme has 134

albums has 6331 files & directories (that's about right - there are 6247 photoItems in the Gallery.)

So most of the inodes are being used in the cache directory - it builds up. The good news is that you can completely delete it - wipe /cache out - and Gallery will rebuild it on-the-fly.
However all your thumbnails etc are stored there. Or you could just delete cache/entity. Alternatively, go to site admin -> maintenance and delete the database cache, which does the same thing.

 
Mr_Parsons

Joined: 2005-04-01
Posts: 28
Posted: Wed, 2008-07-30 08:20

Thanks for the replies guys.

When you say the thumbnails are stored in the cache directory, are you talking about the actual thumbnails that appear on my site?

Does anyone know how the cache builds up? Is it from users browsing it or only from uploading content? It turns out my host are more concerned with lots of changes to the files which would cause file system corruption (potentially anyhow).

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2008-07-30 09:14
Quote:
When you say the thumbnails are stored in the cache directory, are you talking about the actual thumbnails that appear on my site?

Yes. The thumbnails are jpgs (or gifs) derived from the original via the code in whichever Toolkit you have installed. That's computationally intensive, so they're cached as separate files once they're created, to save processing them again and again. It's much faster just to load them from disc. Ditto for resized versions and watermarked versions.

Quote:
Does anyone know how the cache builds up? Is it from users browsing it or only from uploading content?

Depends on whether you configure gallery to build thumbnails at upload time or not. Otherwise, when the thumbnail is viewed for the first time. Entities (other gallery items of data) are cached on the fly.

Quote:
It turns out my host are more concerned with lots of changes to the files which would cause file system corruption (potentially anyhow).

Thanks for providing today's entry in my list of 100-stupidest-things-ever-told-to-a-customer-by-an-ISP! That makes about as much sense as your landlord asking you to receive all your visitors for the year on January 1 because repeatedly opening and closing the door causes wear on the hinges. You'd be better off finding a new ISP.