Results 1 to 19 of 19
Thread: No SWAP memory on a VPS?
-
04-29-2011, 09:47 AM #1WHT Addict
- Join Date
- May 2005
- Location
- Toronto / New York
- Posts
- 166
No SWAP memory on a VPS?
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 #2Web Hosting Master
- Join Date
- Jan 2011
- Location
- Varna, Bulgaria
- Posts
- 1,276
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 #3WHT Addict
- Join Date
- May 2005
- Location
- Toronto / New York
- Posts
- 166
-
04-29-2011, 09:58 AM #4Web Hosting Master
- Join Date
- Jan 2011
- Location
- Varna, Bulgaria
- Posts
- 1,276
Virtuozzo is OpenVZ so there is no swap. OpenVZ has "guranteed RAM" and "burst RAM".
-
04-29-2011, 10:04 AM #5WHT Addict
- Join Date
- May 2005
- Location
- Toronto / New York
- Posts
- 166
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
-
04-29-2011, 10:08 AM #6Web Hosting Master
- Join Date
- Jan 2011
- Location
- Varna, Bulgaria
- Posts
- 1,276
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 #7Temporarily Suspended
- Join Date
- May 2011
- Location
- N/A
- Posts
- 118
-
05-11-2011, 07:47 PM #8Web Hosting Master
- Join Date
- Apr 2008
- Location
- United States, MI
- Posts
- 769
-
05-23-2011, 05:05 PM #9Aspiring Evangelist
- Join Date
- Apr 2010
- Location
- North Carolina
- Posts
- 442
-
05-23-2011, 09:03 PM #10Junior Guru Wannabe
- Join Date
- Feb 2010
- Location
- Evanston, IL
- Posts
- 54
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 #11WHT Addict
- Join Date
- Mar 2011
- Location
- florida
- Posts
- 158
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 #12WHT Addict
- Join Date
- Oct 2010
- Posts
- 154
-
07-18-2011, 04:36 AM #13Newbie
- Join Date
- Jul 2011
- Posts
- 9
my vps too have the same problem
-
07-18-2011, 02:13 PM #14WHT Addict
- Join Date
- Jun 2010
- Location
- Java Island
- Posts
- 147
virtuozzo/openvz vps doesn't support swap, if you need swap for your development move your app to Xen box!
<<please see forum rules for signature formatting guidelines>>
-
07-20-2011, 12:50 PM #15Junior Guru Wannabe
- Join Date
- Jul 2011
- Posts
- 97
-
07-29-2011, 03:52 PM #16Temporarily Suspended
- Join Date
- Feb 2010
- Location
- East Coast
- Posts
- 410
Honestly the best way to remedy the problem of not enough ram is to upgrade the amount of ram that you have. :/ That is really the best way. Whether you are on OpenVZ or Xen, you NEVER want to start swapping. You are best off just putting up some more dough for the extra bit of ram. Most times it doesnt cost that much.
-
07-29-2011, 03:57 PM #17Aspiring Evangelist
- Join Date
- Jul 2011
- Posts
- 355
As others have said, OpenVZ does not use swap, that is why you have burst RAM on OpenVZ.
-
07-29-2011, 04:15 PM #18WHT Addict
- Join Date
- Mar 2011
- Location
- florida
- Posts
- 158
Clue 4 the Clueless
As stated on this forum in many articles
OpenVZ does not use swap!
OpenVZ does not Support swap!
OpenVZ is designed to use Burst Ram!
If you really need Swap Migrate to XEN!
Or buy more Ram if using OpenVZ!
-
09-08-2011, 05:13 PM #19Web Hosting Master
- Join Date
- Oct 2009
- Posts
- 590
Well I guess I may as well break the bad news to you all and muddy the waters. OpenVZ does now support swap with their new RHEL6 kernel that recently went into the stable branch.
It's not the same as real swap which is why they call it "vswap" but from inside the container it looks exactly the same. Oh and memory caching is now supported too. So now all memory inside a container behaves exactly the same as on dedicated hardware. Thankfully these new features supersede burst memory which was confusing to a lot of people and not useful for anything anyways.
http://wiki.openvz.org/VSwap
In my limited testing so far it seems to work well. It seems to have tamed Java behaviour which was an annoying problem with the old memory management model.Last edited by UnfinishedSentenc; 09-08-2011 at 05:20 PM.
Similar Threads
-
Swap memory/Physical Memory
By twinmom in forum Dedicated ServerReplies: 8Last Post: 03-22-2011, 08:23 PM -
[UK] Xen VPS November Special £3.50 - 192MB Memory, 384MB Swap, 8GB Disk, 200GB Data
By allsimple in forum VPS Hosting OffersReplies: 0Last Post: 11-23-2010, 08:18 AM -
Swap memory on Xen VPS
By lovelycesar in forum VPS HostingReplies: 13Last Post: 11-13-2010, 07:58 AM -
[UK] Xen VPS 10% OFF also 512M Memory, 1G Swap, 20GB Disk, 400GB Transfer for £9
By allsimple in forum VPS Hosting OffersReplies: 4Last Post: 10-02-2010, 05:07 PM -
[UK] Xen VPS 10% OFF or 512M Memory, 1G Swap, 20GB Disk, 400GB Transfer £9 Offer
By allsimple in forum VPS Hosting OffersReplies: 0Last Post: 10-02-2010, 04:34 AM