how to minimize amount of cache files

nemo2010

Joined: 2006-02-03
Posts: 84
Posted: Tue, 2009-07-14 20:40

Hi,

Hostmonster.com just sent me a friendly email asking to reduce number of files from 257,000 down to 50,000.
G2's data folder has 102,000 files, G2's main folder (core files) has 38,000 files.

Is there a way to reduce number of cache files created by G2? I can remove some albums but it may still be over 50,000 files overall.
I have over 43,000 pictures stored in albums, 2 intermediate images sizes in addition to full images.

Thank you

Gallery version = 2.3-svn core 1.2.34
API = Core 7.53, Module 3.9, Theme 2.6, Embed 1.4
PHP version = 5.2.9 cgi-fcgi
Webserver = Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
Database = mysqli 5.0.75-community-log, lock.system=flock
Toolkits = ArchiveUpload, NetPBM, Gd, Thumbnail, Dcraw, ImageMagick, Exif
Acceleration = none/900, none/1800
Operating system = Linux hostX.hostmonster.com 2.6.28-9.16.intel.BHsmp #1 SMP Sat Apr 18 11:41:59 MDT 2009 x86_64
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 (.NET CLR 3.5.30729)
Rows in GalleryAccessMap table = 125
Rows in GalleryAccessSubscriberMap table = 41050
Rows in GalleryUser table = 5
Rows in GalleryItem table = 41044
Rows in GalleryAlbumItem table = 479
Rows in GalleryCacheMap table = 1033

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2009-07-14 20:56

You can manually delete them but they will come back.
See discussion of file counts:
http://gallery.menalto.com/node/73277

If you want to reduce file count I would start with all the language files you don't need.
http://gallery.menalto.com/node/69621#comment-251089

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nemo2010

Joined: 2006-02-03
Posts: 84
Posted: Thu, 2009-07-16 16:20

floridave,

I uninstalled several modules and language files as suggested, but it didn't do much for 257k files. A big step was to remove 25k pictures and that helped. I am down to 189k files. Another step I took was to re-do old albums with just 1 intermediate picture (800px) and the full image.
I need to trim it down another 50k (for future expansions) by the way I explained the file situation to my host and they are OK with less than 200k files since most of them are cache files.

Can I remove cache files for all old albums and have it recreated when someone views the album? Perhaps I can remove/rename entire "cache" folder if it'd recreate once pictures are viewed.

For those people with large galleries and 25k-50k file limit - talk to your host and explain that for every 10k pictures you have 50k-60k temp files.

Thank you.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2009-07-16 18:50
Quote:
Can I remove cache files for all old albums and have it recreated when someone views the album?

Yes you can remove the cache files, at the expense of performance. If they have this kind of limitation you are surly to run into some other limit they have not told you about in the future, like the number of process or cpu useage to generate the thumbs and cache files again.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nemo2010

Joined: 2006-02-03
Posts: 84
Posted: Thu, 2009-07-16 19:47

floridave,

You're right they have CPU limitation in place and albums do open slower once I removed all cache files. However it does not affect me too much since I have only few visits per week, and most of them are over slow internet connections. For someone with heavy traffic that would not be acceptable, but this is not the case. my cache folder had close to 32k files that occupied 2.8GB

I'll keep removing the "cache" folder every 6 months of so to stay within allotted file limit, and will rebuild thumbs and intermediate files for latest albums only. That will keep everyone happy.

Thank you very much for your help.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2009-08-25 15:10

I am going through the exact thing with them right now. I started with 219194. I am now down to 117674. This is really bugging me. They should not advertise Unlimited Space if they really don't mean it. So it's ok for us to have 100 1gb files, but not 102400 1mb files. Geez. And they only have one plan for all, so upgrading is not an option. What a pain.

------------------------------------------------
Kris

Personal - http://www.littletechgirl.com
Business - http://www.caincreative.biz

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-08-25 16:35

I'm not defending HG, in fact I'd encourage anyone to not use HostGator or BlueHost or any host that advertises unlimited anything. DreamHost seems to be fine, so far, but I haven't read their TOS lately.

It is unlimited space, you can put up as big of files as you want. Very few hosts (if any, I'd need to read DreamHost's TOS) have truly unlimited files. Doing so severely impacts performance. They really do mean unlimited space, just not unlimited files, but I bet you'd run into issues if you tried to store a PetaByte of data there too. There is no truly unlimited anything, they are banking on the fact that only a fraction of their customers use the majority of the resources. The large majority of their users use very little resources (space, bandwidth, etc).
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2009-08-25 16:40

Yes I agree, there should be limits and they should just clearly state them. It seems like web "software" these days have tons and tons and tons of files associated, host a few domains for yourself and add some photos and it is very easy to hit the limits quickly.

My log also shows that most of my space is being used by Gallery in the cache folders. Another problem on that host is that mail forwarding has no options to only forward and not keep a local copy, it only forwards a copy. I NEVER check my mail via HG because it is forwarded to my gmail, so I had built up quite a bit of spam on their servers. I gave them permission to nuke it all, and the tech that I spoke to said that he would suggest they add the option of true forwarding. I hope they do that soon.

------------------------------------------------
Kris

Personal - http://www.littletechgirl.com
Business - http://www.caincreativememories.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2009-08-25 17:01

G3 will be much better in terms of numbers of files.

As for email, this isn't Gallery related, but I'd seriously look at just having Google host your email, no forwards. Email goes straight to Google. No separate gmail account needed :)
http://www.google.com/apps/intl/en/group/index.html
http://www.google.com/support/a/bin/answer.py?hl=en&answer=48237

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2009-08-25 17:07

I used to use Google Apps. I got away from it because I had to still maintain a regular gmail account as well to use all the "other" Google stuff (voice, picasa, etc.). It became confusing.
------------------------------------------------
Kris

Personal - http://www.littletechgirl.com
Business - http://www.caincreativememories.com

 
nemo2010

Joined: 2006-02-03
Posts: 84
Posted: Tue, 2009-08-25 17:57

I agree, there is no unlimited space anywhere on the internet. There is always a catch, either CPU usage, number of files or folders, file type or size. Any host advertising "unlimited" space should be avoided. When I opened up my account with HostMonster they were giving away 300GB or 500GB which worked for me. I was never a fan of "unlimited" space, unfortunately they upgrade was mandatory and I had no choice.

I had to remove all files in "cache" folder, kept only 1 intermediate file size and I am complying with the TOS. As floridave said "...Yes you can remove the cache files, at the expense of performance..." HM is paying with CPU time for less files on the server.

I will be shopping around for another server that offers 300GB of space and unlimited amount of files.

 
littletechgirl
littletechgirl's picture

Joined: 2005-03-15
Posts: 53
Posted: Tue, 2009-08-25 18:04

If you find a good one, please let me know. I am tired of moving hosts, but I will again because I can see this problem coming up again in a couple of months.

------------------------------------------------
Kris

Personal - http://www.littletechgirl.com
Business - http://www.caincreativememories.com

 
nemo2010

Joined: 2006-02-03
Posts: 84
Posted: Thu, 2009-11-12 15:36

littletechgirl:

I believe I found shared hosting that will hold 100GB+ of data and 300k+ files. Before I recommend it I want to transfer my domain ,and test drive it for a month. If you're interested send me a private message.