How to understand & configure Compression
This article provides details about compression.
When compression is enabled, the LoadMaster only compresses files it believes it can compress.
There is a list of filename extensions that are not compressible (.mp4, .jpg, and so on). Compression is not attempted on these files. For more information on file extensions, refer to this link: Compression File Extension Permissions.
Compression is also not attempted if a file is too big. The Content-Length header is used to verify this. The LoadMaster checks to see if the memory currently available is enough for the file to be compressed. (Small files less than 512 bytes are also not compressed).
The compression engine on the LoadMaster is a store and forward model. It loads the whole response into memory, compresses it and then sends the compressed file on. Provided there is enough memory, then this is fine.
There are two potential caveats with this:
- The Content-Length field is not set - the content may be in chunked format or non-chunked data until connection close (HTTP/1.0 style). In this case, the LoadMaster assumes that it can compress the file (it even converts chunked format into a linear file, since compressing a chunked file is non-trivial).
- Lots of large compression requests come in at the same time.
One or both of these conditions can occur at the same time. This is fine until the memory required for the responses (before compression and after compression) fills the available memory. (Memory is taken from the cache memory pool, so caching files will also have an influence on the amount of memory used).
When Memory Runs Out
This could be a mixture of cached files, uncompressed files being collected before compressing, and compressed files being sent. (Memory is not released until the transmission of the compressed file completes).
If the LoadMaster does not have enough available memory to compress a file you may see the following log message:
"Out of memory for compressing - connection dropped (file size 46374912 total size 943723412)"
Solution
You can increase the available cache. In most cases this should resolve this issue.
In the main menu of the LoadMaster Web User Interface (WUI), go to System Configuration > Miscellaneous Options > AFE Configuration > Cache Configuration > Maximum Cache Size.
Here you can set the Maximum Cache Size to be 1/5 of your total Memory.
Your total memory can be found under Statistics > Real Time Statistics. Here we have a total of 8GB, so one 1/5 would equal a Max Size of 1638MB.