Jump to navigation Jump to search


2,112 bytes added, 15:58, 10 March 2015
Mod_pagespeed Caches
Pretty simple right? Just make sure that the device that's storing the cache has enough free space. Now that the FileCache has been configured, we can move on to the next mod_pagespeed cache, which is even more awesome than the FileCache!
===In-Memory LRU Cache===
In addition to the FileCache, mod_pagespeed can be configured to allow for a small in-memory write-through LRU cache which runs in each Apache process. If you use Prefork, this could mean many processes, which could mean a lot of memory usage per process. You shouldn't use Prefork anyway because Event is way better, so I won't cover how to configure the LRU cache for Prefork, only for Event.
To figure out the best size of the LRUCache you should look at how you've configured Apache. Most of the time the Event MPM will have a ServerLimit of 16, which means that up to 16 Apache processes could run at the same time. If we set '''ModPagespeedLRUCacheKbPerProcess''' to 1024 (1MB) then under the worst case ontario the LRU cache would use 16MB total, (16 Apache Procs x 1MB). Each LRU Cache is limited to serving only the Apache process it was created in, the threads in that process can use the same cache, but threads from other processes will have to stick with their own cache (unlike the shared metadata cache which is covered next).
So, if we have a server with 1GB of memory, and we plan on keeping Apache's ServerLimit under 10, we could set the LRU cache size to 10240 (10MB) and if we had 10 apache processes running at all times the total LRU cache size would be 100MB between all 10 processes. Obviously if we set this to something crazy, like 100MB and we started up 10 Apache procs, the server could run out of memory quickly so be careful with these values.
The '''ModPagespeedLRUCacheByteLimit''' is the limit on how large a cache entry the LRU cache will accept. Unlike the ModPagespeedLRUCacheKbPerProcess value, this setting is in BYTES, not KB. A value of 16384 is 0.015 MB. Generally you want to keep the max size down low to avoid wasted space in the LRU cache. If you set this to say, 1MB then all the LRU caches might be constantly removing items like images because nothing else can fit in the LRU, this cache should be for small stuff, not large stuff.
ModPagespeedLRUCacheKbPerProcess 1024
ModPagespeedLRUCacheByteLimit 16384
==How to install mod_pagespeed Apache module on Ubuntu 14.10==

Navigation menu