EVE-SECURE / evedev-kb

Automatically exported from code.google.com/p/evedev-kb
0 stars 0 forks source link

Enhancement: cache/portraits should use hashed directory scheme #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What is the problem?

Take a killboard for a large alliance. Over time the number of cached portraits 
can grow quite large. 
The problem is that with a large number of files, stat()'s on the directory can 
slow down 
dramatically.

I suggest moving to a hashed directory scheme based on the character id like 
(assuming character 
id is 123456789):

cache/portraits/12/34/123456789_64.jpg

Original issue reported on code.google.com by twe...@gmail.com on 26 Sep 2009 at 2:51

GoogleCodeExporter commented 9 years ago
A reasonable enhancement. I looked at expected directory sizes. There is a 
large skew 
toward IDs starting with 1. With 200k pilots with an external ID set and 2 
digit name 
single depth folders the maximum sizes would be 10 10k folders, 2 5k folders 
and the 
rest 1-2k. With no cache clearing a likely maximum size would still be half 
that. 2 
digit names and a depth of 2 gives a max of 1500 and an average of 240 files in 
each 
folder. Most boards will be a tenth that but the cost of traversing the extra 
directory 
shouldn't be significant since those boards will also be used less and cached 
better.

Original comment by kovellia on 27 Sep 2009 at 3:59

GoogleCodeExporter commented 9 years ago

Original comment by kovellia on 16 Oct 2009 at 10:43