Open dennisjac opened 5 years ago
Is the LRU cache configured? E.g. something like
ModPagespeedLRUCacheKbPerProcess 1024
ModPagespeedLRUCacheByteLimit 16384
and actually the reason it might not be configured is that for most applications, you shouldn't use it, and should instead use the shared-memory cache, so it's not replicated per apache child process.
See https://www.modpagespeed.com/doc/system for details.
This is what my configuration looks like:
Options
AvoidRenamingIntrospectiveJavascript (aris) True
BeaconUrl (bu) /ngx_pagespeed_beacon
EnableRewriting (e) 1
FileCacheCleanIntervalMs (afcci) 3600000
FileCacheInodeLimit (afcl) 500000
FileCachePath (afcp) /var/cache/nginx/ngx_pagespeed_cache
FileCacheSizeKb (afc) 10485760
LRUCacheByteLimit (alcb) 32768
LRUCacheKbPerProcess (alcp) 16384
RespectXForwardedProto (rxfp) True
RewriteLevel (l) Core Filters
StatisticsPath (nsp) /ngx_pagespeed_statistics
The documentation says that if no explicit shared-memory cache is specified there is a default one that will be used. What are the appropriate values for the cache sizes? The file cache directory is currently 7GB in size but the default shared-memory cache in only 50MB which seems tiny. On the other hand if I would increase this to say 5GB (the server has 16GB of RAM) then the snapshotting would probably cause massive disk i/o when all of this is written out.
For some reason pagespeed is causing around 200 write IOPS for no apparent reason and my hope is that by configuring the in-memory caching correctly that I can fix this issue. It seems unlikely that pagespeed is updating so many files all the time so I suspect it might have something to do with metadata.
I've enabled the file and lru caches but it seems the values on the statistic page are not updated:
As a result I have no idea if the LRU cache even works. (I'm trying to debug an issue with pagespeed generating large amount of write IOPS for no apparent reason)