
04-29-2011, 09:47 AM
|
|
WHT Addict
|
|
Join Date: May 2005
Location: Toronto / New York
Posts: 154
|
|
When I asked why my managed VPS was configured with no swap, and that it please be configured I was told this by my VPS provider:
Its not possible to add swap partition on a VPS, and there is no need to create separate swap file. You can keep track of the memory usage in power panel under resource alerts. If the VPS is using up the memory allocated, you can see the alerts there.
I realize that it's "best" to never start swapping a lot, but my understanding was that if memory was low, some virtual memory would keep you going at least, to avoid services from crashing or worse.
Thoughts?
|

04-29-2011, 09:51 AM
|
|
Premium Member
|
|
Join Date: Jan 2011
Location: Varna, Bulgaria
Posts: 1,165
|
|
If it is an OpenVZ VPS there is simply no such thing as swap.
If it is Xen you can easily add swap yourself.
|

04-29-2011, 09:55 AM
|
|
WHT Addict
|
|
Join Date: May 2005
Location: Toronto / New York
Posts: 154
|
|
Quote:
Originally Posted by rds100
If it is an OpenVZ VPS there is simply no such thing as swap.
If it is Xen you can easily add swap yourself.
|
What about Parallels Virtuozzo?
I'm coming from a Xen VM, so the information about OpenVZ is new to me. Can someone explain?
|

04-29-2011, 09:58 AM
|
|
Premium Member
|
|
Join Date: Jan 2011
Location: Varna, Bulgaria
Posts: 1,165
|
|
Virtuozzo is OpenVZ so there is no swap. OpenVZ has "guranteed RAM" and "burst RAM".
|

04-29-2011, 10:04 AM
|
|
WHT Addict
|
|
Join Date: May 2005
Location: Toronto / New York
Posts: 154
|
|
Quote:
Originally Posted by rds100
Virtuozzo is OpenVZ so there is no swap. OpenVZ has "guranteed RAM" and "burst RAM".
|
Ok interesting, so if I'm down to 0MB free what will I see on my VM? Will the amount of memory change when it "bursts"? Here is what I'm seeing now in free -m. Also what about the typical "cached" RAM that Linux would reserve, right now I'm seeing none.
Code:
[root@host ~]# free -m
total used free shared buffers cached
Mem: 768 80 687 0 0 0
-/+ buffers/cache: 80 687
Swap: 0 0 0
Thanks!
|

04-29-2011, 10:08 AM
|
|
Premium Member
|
|
Join Date: Jan 2011
Location: Varna, Bulgaria
Posts: 1,165
|
|
No, the maximum memory you can burst to is 768MB. How much of that is guranteed cannot be seen this way.
cat /proc/user_beancounters to see various OpenVZ limits and statistics. And then look at http://wiki.openvz.org/UBC to see what they mean.
Also there is not cached memory because the VPS doesn't do any caching, it doesn't even have its own kernel. There is only one kernel on the hardware node, and your VPS just has processes isolated in a container. The chaching is done at the hardware node level.
|

05-11-2011, 07:46 PM
|
|
Temporarily Suspended
|
|
Join Date: May 2011
Location: N/A
Posts: 116
|
|
How can we?
Quote:
Originally Posted by rds100
If it is an OpenVZ VPS there is simply no such thing as swap.
If it is Xen you can easily add swap yourself.
|
Under Xen how can we add swap?
|

05-11-2011, 07:47 PM
|
|
Web Hosting Master
|
|
Join Date: Apr 2008
Location: United States, MI
Posts: 553
|
|
Quote:
Originally Posted by stardust_x7
Under Xen how can we add swap?
|
Create a partition on your disk and format it to be swap?
IE: The same way you add swap on all Linux systems.
|

05-23-2011, 09:03 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Feb 2010
Location: Evanston, IL
Posts: 53
|
|
Most hosts don;t like to offer swap because of the load it generates on the SANs, I/O from alot of random reads and writes.
If swap is something you really need you can create a swap file, adjust to following to suit your needs:
1) Create a file to use as swap:
-this command will create 1GB file
dd if=/dev/zero of=/swapper bs=1M count=1024
2) Create a swap are in the file:
mkswap /swapper
3) Turn the swap on:
swapon /swapper
4) To make the swap area persistent on reboot add the following line to /etc/fstab:
/swapper swap swap defaults 0 0
5) Run:
free -m
You should now see your available swap space.
|

05-30-2011, 04:16 PM
|
|
WHT Addict
|
|
Join Date: Mar 2011
Location: florida
Posts: 155
|
|
Openvz swap file install works perfect
[root@s1 ~]# free -m
total used free shared buffers cached
Mem: 512 325 186 0 0 0
-/+ buffers/cache: 325 186
Swap: 1024 0 1024
[root@s1 ~]#
i only have 512mb ram
now i have a swap as seen in root also as seen in webmin running proc
Display : PID | User | Memory | CPU | Search | Run..
Real memory: 512 MB total / 186.25 MB free Swap space: 1024 MB total / 1024 MB free
i dont run outa memory no more
OpenVZ does not support Swap. If you have a program that requires swap, then you can create and use a fake swap.
1) Log into your vps as root.
2) Download fake-swap.sh shell-script.
wget XXhttpX:X/X/service.welcome2inter.net/downloads/fake-swap.sh
3) Make script executeable
chmod u+x fake-swap.sh
4) Run script to create fake swap ...
... with 512MB (default)
./fake-swap.sh
Enjoy
... with 1024MB
./fake-swap.sh 1024
|

07-05-2011, 05:11 AM
|
|
WHT Addict
|
|
Join Date: Oct 2010
Posts: 129
|
|
Quote:
Originally Posted by Dig1
Openvz swap file install works perfect
...
i dont run outa memory no more
|
The swap is fake. It is used to fool applications so that they think there is swap space available but in actual fact there is none. You will still run out of memory if you use that fake-swap.sh.
|

07-18-2011, 04:36 AM
|
|
Newbie
|
|
Join Date: Jul 2011
Posts: 6
|
|
my vps too have the same problem
|

07-18-2011, 02:13 PM
|
|
WHT Addict
|
|
Join Date: Jun 2010
Location: Java Island
Posts: 139
|
|
virtuozzo/openvz vps doesn't support swap, if you need swap for your development move your app to Xen box!
|

07-20-2011, 12:50 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Jul 2011
Posts: 88
|
|
Yes and shared between other boxes too.
Kind Regards
.
.
Quote:
Originally Posted by rds100
Virtuozzo is OpenVZ so there is no swap. OpenVZ has "guranteed RAM" and "burst RAM".
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|