|This article applies to the following ZCS versions.|
The message cache is an in-memory cache that stores the MIME structures of recently-accessed messages. By caching the MIME structures, we avoid having to reparse the blob on disk when a message is accessed multiple times. Since we're only caching the structure of the message and not the content, the size of each cache entry is small, usually 4k or less. The maximum number of messages in the cache is set by the zimbraMessageCacheSize server attribute. The default size is 2000. Message content is always read from disk. The expectation is that we cache the structure to avoid reparsing, and let the operating system's filesystem cache take care of caching the content.
The file descriptor cache allows us to use a bounded pool of file descriptors when accessing message bodies. It also limits the number of times that a file descriptor to a blob is opened and closed
The uncompressed file cache stores uncompressed versions of blobs on disk. The first time a compressed blob is accessed, we write the uncompressed version to /opt/zimbra/data/tmp/uncompressed. When the file descriptor is closed or aged out of the file descriptor cache, we remove the associated blob from the uncompressed cache. The cache is cleared during server startup and shutdown.
In ZCS 5.0, the message cache stored not just the message structure, but also the content of messages less than 1MB. Messages larger than 1MB were streamed from disk and were estimated to take up 4k of space in the cache. zimbraMessageCacheSize was specified in bytes, as opposed to the number of messages. There was no uncompressed file cache in 5.0, so compressed blob content was read completely into memory, regardless of the file size.
In ZCS 6.0 through 6.0.6, the uncompressed file cache had its own limits: zimbraMailUncompressedCacheMaxFiles and zimbraMailUncompressedCacheMaxBytes. These attributes are no longer used as of ZCS 6.0.7. The uncompressed cache is now managed by the file descriptor cache, as described above. See bug 43497 for details.