What is TurboRAM?
TurboRAM gives a server more usable memory without adding any. It compresses memory pages that have gone cold and keeps them in RAM, instead of writing them out to the swap file on disk. Reading a compressed page back costs microseconds; reading a page back from disk costs milliseconds - a difference of a thousand times.
TurboRAM is on by default on every TurboStack server. You do not configure it.
Why it matters
A server under pressure has to move something out of memory. Without TurboRAM the only place to put it is the disk swap file, and a process that touches a swapped page then waits on storage. That is what "the server started swapping" means to a visitor: the site is technically up, and slow.
With TurboRAM the same page is compressed and stays in memory. The result is more room before the server has to touch disk at all, and more room again before it runs out of memory entirely.
Typical compression is around 2 to 3 times, so the memory that TurboRAM manages holds roughly two to three times what it would uncompressed.
A measured example
These are the figures from one production server, at one moment. Your own will differ.
It helps to see where that extra 9 GB comes from, because it is not free memory appearing out of nowhere. On that server, TurboRAM was holding about 13 GB of application data inside about 4 GB of physical memory. The other 28 GB was ordinary, uncompressed RAM. Add the 28 GB and the 13 GB together and you get the 41 GB the graph reports.
So the trade is: give up roughly 4 GB of ordinary memory, get roughly 13 GB of storage for cold pages in return. The busier the server, the more that difference is worth.
What compresses, and what does not
The ratio is not a platform setting. It is a property of your data, which is why the same feature gives one server 3 times and another barely 2.
A storefront serving pages built from a database is close to the ideal case. A media library streaming video is close to the worst, and gains little. Most real servers sit somewhere between the two, which is where the 2 to 3 times figure comes from.
What it costs
Compressing a page and reading it back is work for the processor, so TurboRAM trades a little Central Processing Unit (CPU) time for a lot of memory headroom. That trade is deliberately made cheap:
-
On the way in, pages are compressed with a fast method, so the cost lands on the write path where it is least noticeable.
-
Pages that then stay cold are re-compressed more densely later, on idle cycles, rather than while a visitor is waiting.
-
A page that is read back is decompressed once and released, so nothing pays the cost twice.
This is why the feature is on everywhere rather than offered as an option: the processor time it costs is small next to the storage wait it avoids.
How it fits with disk swap
TurboRAM does not replace the swap file - it sits in front of it as a faster first tier.
Pages move to TurboRAM first. Only when TurboRAM is full does the server fall back to the swap file on disk. Only when both are exhausted does the server run out of memory.
Reading it in the monitoring
The memory graphs on a host's Health tab show TurboRAM alongside physical memory, which is why a 32 GB server can report an effective capacity higher than 32 GB. That is not an error in the graph.
Important
TurboRAM filling up is normal, not a warning sign. It is designed to be used. What matters is whether the server is slow: sustained disk-swap activity, or memory pressure that keeps rising. A full TurboRAM with a quiet disk is a server doing exactly what it should.
The capacity that TurboRAM reports is the amount of uncompressed data it will accept, not memory it has taken away from your applications. The physical memory it actually uses depends on how well your data compresses, is allocated only as pages arrive, and is released again as soon as a page is read back.
When it is not enough
TurboRAM buys headroom; it does not create memory that is not there. A server that is genuinely too small still needs more RAM. Signs that you have passed what TurboRAM can absorb:
- The disk swap file is in constant use, not just occasionally.
- Response times get worse as traffic rises, and recover when it falls.
- Processes are being stopped by the server to reclaim memory.
Tip
TurboRAM is also an early warning. A server that used to keep it half empty and now runs it full every afternoon is telling you the working set has grown. That is the moment to plan more memory, while the site is still fast, rather than after the first slow day.
See Server is out of memory for how to diagnose that, and Performance tuning for what to look at first.
Related
- What is TurboKernel? - the other half of the platform performance work
- Health - where the memory graphs live
- Monitoring
- Server is out of memory
- Performance tuning