Post4VPS Forum | Free VPS Provider
Build virtual RAM in Linux"Debian" - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: Geek World (https://post4vps.com/Forum-Geek-World)
+--- Forum: Hardware & Technology (https://post4vps.com/Forum-Hardware-Technology)
+--- Thread: Build virtual RAM in Linux"Debian" (/Thread-Build-virtual-RAM-in-Linux-Debian)



Build virtual RAM in Linux"Debian" - hamed - 10-28-2019

Hi all friends.
I did not find a good result in Google in my own language.
That's why I created this thread to get an answer and training.
I was wondering if you could create a virtual Ram on Linux using hard disk space? Ugh I've heard that this is possible in Windows so I said so in Linux it should.
Thanks for sharing any tutorials on this topic
And one more question. For example, how much 50 GB of space does the virtual ram create?


RE: Build virtual RAM in Linux"Debian" - rudra - 10-29-2019

what is virtual ram ? are you talking about swap space??

page file concept in Windows and swap partition (which you could do on a virtual drive saved as file on a drive partition) under Linux is same idea.

it is just there to help run system when there is not enough ram. it does not speed up your system.

it is os managed and even though you could do it manually, it is better to let Windows do it. in case of Linux, just set a swap partition equal to the size of your ram (or some use double).

that's all you need to do.


RE: Build virtual RAM in Linux"Debian" - Mashiro - 10-29-2019

The so called virtual memory also known as Swap on Linux or Pagefile on Windows (as already mentioned by @rudra) is simply either a file or partition on the disk of the computer or server. It acts as fake RAM to let the system unload rarely used information from real RAM to make space for new information. And of course as also already mentioned by @rudra it allows the operating system to function once the real RAM has been fully used up.

However since a HDD or even most SSDs are a lot slower than real RAM the performance of a system that is using virtual memory to survive is horrible. The disk cannot keep up with the CPU and the CPU has to wait for it and this in return causes very high CPU usage. We all know what that means... a very laggy system with bad response times and horrible performance. Not even NVMe SSDs are fast enough to compare to real RAM (2 - 3 GB/s on NVMe SSD vs easily 15 GB/s or much more on real RAM).

There is no performance or speed gain from using virtual memory! It actually only makes things worse the more you use of it as explained above. Talking about SSDs. Don't use SSD space for virtual memory. If you use virtual memory very often you will kill your SSD because the writes to the virtual memory will wear down the SSD a lot quicker than normal usage such as storing the OS and important programs.


Back to the main question. I can somehow remember you asking this in the past already somewhere (probably in the support forum). I even remember that I pointed you to tutorials that explained how to enable and add Swap on a already installed Linux OS.

See here: https://help.ubuntu.com/community/SwapFaq (go down to How do I add a swap file?).

You cannot really add Swap to OpenVZ VPSs! Only the provider can enable and add vSwap from their side. You need atleast a KVM VPS. Don't bother around with OpenVZ in this regard.

P.S.: The Ubuntu (Community) Wiki is one of the greatest resources to learn things about Linux. Many things you learn there can be applied to many Linux distributions outside of Ubuntu or Debian.


RE: Build virtual RAM in Linux"Debian" - hamed - 10-29-2019

(10-29-2019, 06:04 AM)Hidden Refuge Wrote: The so called virtual memory also known as Swap on Linux or Pagefile on Windows (as already mentioned by @rudra) is simply either a file or partition on the disk of the computer or server. It acts as fake RAM to let the system unload rarely used information from real RAM to make space for new information. And of course as also already mentioned by @rudra it allows the operating system to function once the real RAM has been fully used up.

However since a HDD or even most SSDs are a lot slower than real RAM the performance of a system that is using virtual memory to survive is horrible. The disk cannot keep up with the CPU and the CPU has to wait for it and this in return causes very high CPU usage. We all know what that means... a very laggy system with bad response times and horrible performance. Not even NVMe SSDs are fast enough to compare to real RAM (2 - 3 GB/s on NVMe SSD vs easily 15 GB/s or much more on real RAM).

There is no performance or speed gain from using virtual memory! It actually only makes things worse the more you use of it as explained above. Talking about SSDs. Don't use SSD space for virtual memory. If you use virtual memory very often you will kill your SSD because the writes to the virtual memory will wear down the SSD a lot quicker than normal usage such as storing the OS and important programs.


Back to the main question. I can somehow remember you asking this in the past already somewhere (probably in the support forum). I even remember that I pointed you to tutorials that explained how to enable and add Swap on a already installed Linux OS.

See here: https://help.ubuntu.com/community/SwapFaq (go down to How do I add a swap file?).

You cannot really add Swap to OpenVZ VPSs! Only the provider can enable and add vSwap from their side. You need atleast a KVM VPS. Don't bother around with OpenVZ in this regard.

P.S.: The Ubuntu (Community) Wiki is one of the greatest resources to learn things about Linux. Many things you learn there can be applied to many Linux distributions outside of Ubuntu or Debian.

Oh shit i want it for openvz ;( sry but i have another questin . How can i set a program on debian 8 64bit when the program was closed he open it automatic . Can i??
He need write a command to open program . Like down command . For example :
sudo .xmrig --user (username) --pass (password) --donatelevel 1 --tls
Please help me i need it


RE: Build virtual RAM in Linux"Debian" - Mashiro - 10-29-2019

Check: https://www.danieblog.com/technology/tutorials/how-to-install-xmrig-cpu-miner-in-centos-7-239.html

Go to the area starting with "Make XMRig run as a service". Depsite the actual guide being for CentOS 7 you can probably do the part to run it as a service on pretty much every systemd Linux distribution.


RE: Build virtual RAM in Linux"Debian" - hamed - 10-30-2019

(10-29-2019, 06:13 PM)Hidden Refuge Wrote: Check: https://www.danieblog.com/technology/tutorials/how-to-install-xmrig-cpu-miner-in-centos-7-239.html

Go to the area starting with "Make XMRig run as a service". Depsite the actual guide being for CentOS 7 you can probably do the part to run it as a service on pretty much every systemd Linux distribution.

This training does not work and in addition does not support command.
Please tell me if you have any further training. But with the command