Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Can't flush just one vhost's cache without "UsePerVHostStatistics on" #662

Open
GoogleCodeExporter opened this issue Apr 6, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

1. Configure Apache with mod_pagespeed and multiple vhosts
2. Each vhost should have it's own FileCachePath or CacheFlushFilename
3. Don't have UsePerVHostStatistics turned on

If you touch the cache flush file for one cache, only that cache should be 
flushed.  Instead all caches are flushed.

This happens because in SystemServerContext there's a statistic
kCacheFlushTimestampMs which is, with UsePerVHostStatistics disabled, shared by 
all vhosts.

It's actually worse that this, in that the cache is only over-flushed 
sometimes.  FlushCacheIfNecessary either checks the mtime of the cache flush 
file or the contents of the kCacheFlushTimestampMs (depending on elapsed time 
since the last check of the filesystem) but not both.  This means that if you 
only get in a request every 10s and have a 5s CacheFlushPollIntervalSec then 
you'll never see this problem because you'll only ever use the on-disk mtime.  
If you start getting requests every 1s, however, you'll use the statistic 
4/5ths of the time and if another virtual host is being flushed often then 
you'll be flushed with it.

Why do we need a statistic for this?  Why can't each process just check the 
timestamp itself?

Original issue reported on code.google.com by jefftk@google.com on 1 Apr 2013 at 10:14

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant