Memory

Caching products vary greatly in how they use RAM. Some caches, notably Squid, keep a number of indexes in memory. The indexes have an entry for every cache object, such that index memory requirements are proportional to cache size. Most caching products also use memory to store popular or recently requested objects. Storing popular objects entirely in memory results in a performance improvement. Caches also use memory to pass data to and from the network. The amount of memory used for network buffers is proportional to the load on the system.

Memory starvation can be a serious problem. It is certainly serious for Unix-based solutions, such as Squid. When the application needs more memory than is physically available, some of the process memory is written to disk. Performance degrades very quickly when swapping occurs.

If you’re thinking about an appliance-based solution, you probably don’t have to worry about memory configurations. The product should come with an appropriate amount of memory, based on the particular software and other hardware components. If additional memory is available for your product, it may boost the cache’s performance by holding extra objects in memory.

If you’re using a software-based product, you’ll need to find out the amount of memory the vendor recommends. Current versions of Squid require a lot of memory compared to other products (including appliances). For Squid, I typically recommend 1MB of RAM for every 32MB of disk capacity. A significant ...

Get Web Caching now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.