Operate in a swap-free environment

Asked 2 years ago, Updated 2 years ago, 56 views

I'd like to run the application with vps (os is centos) where swap space is not available, but
I run out of memory and it will fall off soon.

I also tried file management swap, but when I hit the swapon command, it says I don't have permission (even if I run it on root), so I'm in a state of confusion.

Is there a way to operate in this environment?

By the way, the memory is 1G, and the application itself works fine in a swap environment.

linux centos

2022-09-30 21:18

1 Answers

Perhaps they are using containerized VPS such as OpenVz and Virtuozzo.

These VPS only provide "no other users" functionality on a single OS, but to put it simply, "shared hosting with great chroot functionality" is not designed to change the configuration of the OS itself.It is also more likely to be affected by other users.(Instead, it's cheaper because it packs a lot of users into a single piece of hardware.)

The only way to keep the application running in this state is to develop and configure it to run within the allocated memory range (and, more importantly, within the guaranteed range).

This may not be the answer you're looking for, but I think it's better to switch to the services provided by full virtualization and paravirtualization.


2022-09-30 21:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.