https://issues.apache.org/bugzilla/show_bug.cgi?id=57416
Bug ID: 57416
Summary: htcacheclean thinks the cache is smaller than it
actually is
Product: Apache httpd-2
Version: 2.5-HEAD
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mod_cache_disk / mod_disk_cache
Assignee: [email protected]
Reporter: [email protected]
Created attachment 32347
--> https://issues.apache.org/bugzilla/attachment.cgi?id=32347&action=edit
Sum physical sizes rather than logical sizes in htcacheclean
When running htcacheclean on a large disk cache directory, it uses the logical
sizes of the files instead of the physical size. Since the header and vary
files are almost always below the block size of the filesystem, the size on
disk of the cache directory can grow to be drastically more than what
htcacheclean thinks. In my testing, I got "du -hs" to report that the cache
directory was 12G, while "htcacheclean -v" reported around 3G.
It seems like there's an easy fix for this, since apr_stat() reports the
physical size as well as the logical size; this leaves me wondering whether
this was a deliberate choice. However, I think using the logical size is
counterintuitive - after all, the user's intention is generally to limit the
physical size of the cache directory, and doesn't care about the logical size
of the files.
The attached patch changes htcacheclean to sum files' physical size, instead of
their logical size. There's still a problem in that hcacheclean still does not
add the sizes of the directory nodes themselves, which can also be significant;
however, this change at least brings the size closer to what a user would
expect.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]