I have a site that does wildcard virtual hosting, such that I have a
VirtualHost with:
ServerAlias *.
example.com
... and the web application that powers the site interprets the
hostname to determine what content to serve, in this case, pages for
the numerous users of the site. E.g.
person.example.com.
As a result, thousands of cache directories are created under /var/www/
mod_pagespeed/cache. Cache cleanup seems to work as intended, and
removes old regular files from these directories. However, it does
not remove the empty directories for the various virtual hosts. As a
result, the inode count on the server becomes pretty high after a few
days (greater than a million).
Example:
/var/www/mod_pagespeed/cache/http,3A/,
2Fusername.example.com/css
... will be empty
Ideally, in my case, where not all of these sites get visited that
often, these directories would be deleted. I am wondering if the high
directory count is contributing to higher i/o latency than one would
normally like to see on this server. On this server, the inode count
on the relevant partition can get above 1.5 million in a few days. It
seems that when I completely purge the cache directory (via shutdown,
mv directory, restart, delete old directory), iowait drops for a day
or two and the inode count drops to the tens of thousands.
Is it safe for me to run a script that periodically removes empty
directories from /var/www/mod_pagespeed/cache?
Should I fill out an issue in the issue tracker to request that old
cache subdirectories be removed?
Thanks in advance!