You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a swap memory option in web UI to mitigate low memory situations.
(This proposal is a modification of #204.)
Background
Currently, NanoKVM easily reaches 100% memory usage when Tailscale is enabled and disk operations are performed. In such cases, the Out-Of-Memory (OOM) Killer terminates processes, potentially leading to server shutdowns or loss of network access. (See #89) To address this issue, Linux swap memory can be utilized. Swap memory leverages disk space as extended, albeit slower, memory.
Using an SD card as the backend storage for swap memory can be slow, and frequent I/O read and write operations may shorten the SD card’s lifespan due to the nature of NAND flash. However, in certain cases, the swap can still be preferable as 'functioning slowly' is better than complete failure.
Additionally, reducing memory space of the media area has clear limitations and cannot accommodate future scenarios involving increased memory allocation due to feature additions. Swap memory can act as an effective safeguard in such cases.
Use Case
I have deployed NanoKVM in a remote overseas location where manual firmware updates are not feasible. My NanoKVM device still operates with 128MB of user memory space and suffers from high memory pressure when using Tailscale to bypass firewalls. To mitigate these issues until updates are possible, I have manually enabled swap memory, which has proven to be highly effective.
Workaround
I have configured approximately 768MB of swap memory, though swap usage has never exceeded 32MB. A swapfile size of around 64–128MB should suffice. Since the root partition lacks sufficient space, I created the swapfile in the /data partition used for storage.
Below is the workaround to configure swap memory:
fallocate -l 128M /data/swapfile
mkswap /data/swapfile
swapon /data/swapfile # (Needs to be executed at every boot or added to /etc/fstab)
I propose implementing an option to do similar in the Web UI for NanoKVM.
The text was updated successfully, but these errors were encountered:
Thanks for posting this! I didn't manage to get it to load using fstab for some reason but dropping
swapon /data/swapfile into my rc.local file worked. It's enough to get me out of trouble until I can access the KVM and put 1.3.0 on it (or there is a way to update the firmware remotely)
Proposal
Add a swap memory option in web UI to mitigate low memory situations.
(This proposal is a modification of #204.)
Background
Currently, NanoKVM easily reaches 100% memory usage when Tailscale is enabled and disk operations are performed. In such cases, the Out-Of-Memory (OOM) Killer terminates processes, potentially leading to server shutdowns or loss of network access. (See #89) To address this issue, Linux swap memory can be utilized. Swap memory leverages disk space as extended, albeit slower, memory.
Using an SD card as the backend storage for swap memory can be slow, and frequent I/O read and write operations may shorten the SD card’s lifespan due to the nature of NAND flash. However, in certain cases, the swap can still be preferable as 'functioning slowly' is better than complete failure.
Additionally, reducing memory space of the media area has clear limitations and cannot accommodate future scenarios involving increased memory allocation due to feature additions. Swap memory can act as an effective safeguard in such cases.
Use Case
I have deployed NanoKVM in a remote overseas location where manual firmware updates are not feasible. My NanoKVM device still operates with 128MB of user memory space and suffers from high memory pressure when using Tailscale to bypass firewalls. To mitigate these issues until updates are possible, I have manually enabled swap memory, which has proven to be highly effective.
Workaround
I have configured approximately 768MB of swap memory, though swap usage has never exceeded 32MB. A swapfile size of around 64–128MB should suffice. Since the root partition lacks sufficient space, I created the swapfile in the
/data
partition used for storage.Below is the workaround to configure swap memory:
I propose implementing an option to do similar in the Web UI for NanoKVM.
The text was updated successfully, but these errors were encountered: