incubator-pagespeed-ngx icon indicating copy to clipboard operation
incubator-pagespeed-ngx copied to clipboard

Values on statistics page not updated

Open dennisjac opened this issue 6 years ago • 3 comments

I've enabled the file and lru caches but it seems the values on the statistic page are not updated:

cache_time_us:                                46517690574
cache_hits:                                       1004351
cache_misses:                                      168951
cache_backend_hits:                               1058961
cache_backend_misses:                              114341
cache_fallbacks:                                     3028
cache_expirations:                                   9816
cache_inserts:                                     376839
cache_deletes:                                          0
...
file_cache_bytes_freed_in_cleanup:                      0
file_cache_cleanups:                                    0
file_cache_disk_checks:                                 0
file_cache_evictions:                                   0
file_cache_skipped_cleanups:                            0
file_cache_started_cleanups:                            0
file_cache_write_errors:                                0
file_cache_deletes:                                     0
file_cache_hits:                                        0
file_cache_inserts:                                     0
file_cache_misses:                                      0
lru_cache_deletes:                                      0
lru_cache_hits:                                         0
lru_cache_inserts:                                      0
lru_cache_misses:                                       0

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)

dennisjac avatar Apr 02 '19 13:04 dennisjac

Is the LRU cache configured? E.g. something like

ModPagespeedLRUCacheKbPerProcess   1024
ModPagespeedLRUCacheByteLimit      16384

jmarantz avatar Apr 02 '19 13:04 jmarantz

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.

jmarantz avatar Apr 02 '19 13:04 jmarantz

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.

dennisjac avatar Apr 02 '19 13:04 dennisjac