Swap Settings
How to configure swap space for your Lagless server
Swap Settings
This guide explains what swap space is, how it's used in Lagless, and how to configure it for your server.
Most users (99%) do not need to modify the default swap settings. If your server is performing well, there's no need to change anything.
What is Swap?
Swap is virtual memory stored on disk rather than in physical memory (RAM). It functions as a memory extension but operates significantly slower than physical RAM.
How Lagless Uses Swap
By default, all Lagless servers are allocated 512MB of swap space. This allocation helps cover Java's overhead requirements, particularly when using optimized settings like Aikar's flags, with minimal performance impact in most scenarios.
However, there are specific situations where you might want to disable swap, which is why we provide this option.
When to Modify Swap Settings
The primary reason to consider disabling swap is when running memory-intensive applications like Forge modpacks. These modpacks require substantial memory during startup, and with certain optimization flags, the server might experience performance degradation due to excessive swapping.
Disabling swap might provide:
- Slightly improved performance
- Better tick rates (MSPT)
- Support for more concurrent users
How to Enable or Disable Swap
You can manage swap settings in your server control panel:
Navigate to the Settings section in your Lagless dashboard
Scroll down to the bottom of the page to find the "Swap Settings" section
Toggle the switch to enable (on) or disable (off) the 512MB swap space
Click the "Save" button to apply your changes
Important Considerations
Memory Overhead
If you disable swap, your server needs adequate memory overhead for the Java Virtual Machine (JVM). Without swap, servers using optimization flags may fail to start due to insufficient overhead.
When swap is disabled:
- You may need to adjust your startup RAM allocation percentage (typically to around 70%)
- The exact percentage varies between servers and applications
- If your server freezes, it might indicate insufficient overhead
- "Out of memory" errors in logs indicate the JVM itself is out of memory
Troubleshooting
Summary
At Lagless, we aim to provide you with complete control over your server environment. The swap configuration option gives you another tool to optimize your server's performance for your specific needs. For most users, the default setting works well, but power users running specialized workloads may benefit from customizing this setting.