• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Add Swap or Virtual Memory on Rackspace Cloud Server (Ubuntu)

By Abhishek Ghosh August 13, 2014 11:18 am Updated on August 13, 2014

Add Swap or Virtual Memory on Rackspace Cloud Server (Ubuntu)

Advertisement

Here is how to add Swap or Virtual Memory on Rackspace Cloud Server Instance running Ubuntu 14.04 LTS. Swap can save instance from complete failure. However, on Rackspace Cloud, it is not recommended to use Swap or Virtual Memory to fight with RAM crisis. This guide to add Swap or Virtual Memory on Rackspace Cloud Server is for “increasing” RAM for temporary period – like that, while upgrading a system. Swapping is a terminology which is used for of Computer Hardware System Components, but here the phrase Swap refers to Virtual Memory. Official documentation about Swap can be found here :

Vim
1
https://help.ubuntu.com/community/SwapFaq

 

Why We Do Not Suggest To Add Swap or Virtual Memory on Rackspace Cloud Server?

 

People can still create swap partitions within their VM, but basically for the sake of Multi-Tenancy, Swappiness of VM is kept to 0 (zero) :

Vim
1
http://www.rackspace.com/knowledge_center/article/changes-to-swap-on-cloud-servers

To make the system more faster, smoothly running, we need to plan for any way of scaling. We can use OpenStack Heat templates ( read Rackspace Deployments ) to get a scalable infrastructure. Rackspace is never a budget saving option – it is for higher quality and higher redundancy. If we increase the RAM, our Networking, virtual cores also will get increased proportionately. A 2 GB server can perform better than an 1 GB server performance 1 flavor. Furthermore, Rackspace uses PVHM virtualization mode.
We can not give warranty whether Auto Scaling, Automated Image Building will work rightly on Rackspace after adding Swap or Virtual Memory.

Advertisement

---

Practically, this option is for web hosts like Digital Ocean where increasing RAM is kind of linear. There, if one uses a 1 GB server, adding 500 MB can do better as simply the cost will remain down and increasing to 2 GB will not provide any better virtual processor. Hostgator like web hosts with no own Data Center can use the infrastructure of Rackspace, possibly they do not use Swap.

One can monitor Swap memory on Cloud Intelligence Graph (beta at the time of publishing this guide). Cloud Intelligence Graph supports Swap’s tracing, but actually we need not use it. 1 GB server will outperform a 512 MB server on Rackspace. This is, in the same way true for Amazon, Azure, Fujitsu etc. leading A grade Cloud IaaS providers. Shared Hosting is also required – we do not need all our domains to have a bigger infrastructure. But basically adding Swap to a 512 MB Instance on Rackspace will not do any good – the cost of 1 GB is not huge, the cost of bandwidth is same for all. Where horizontal scaling with five 1 GB will perform better than one 4 GB server, we can not tell it – you need to talk with Rackspace. It depends on many parameters.

Also, increasing RAM might hide a defect – it is abnormal if a WordPress site demands a 32 GB server. The infrastructure is either not optimized or the Application Server’s instance has issues – like database might need a repair. For high load, we obviously server with cache. Caching at front end can bring disaster. That theory is for old servers, Bare Metal and Dedicated Server.

When we will need to detach the device ( like for going to rescue mode, adding more SSD storage device ), this Swap might create problem. So at least take a Server Image snapshot if you are going to do it for production server.

Add Swap or Virtual Memory on Rackspace Cloud Server (Ubuntu)

 

How To Add Swap or Virtual Memory on Rackspace Cloud Server

 

So the space on the hard drive will be used when RAM is no longer sufficient for running the instance. There are many ways to add Swap. You can read Rackspace’s guide ( read the comments too ) :

Vim
1
http://www.rackspace.com/knowledge_center/article/create-a-linux-swap-file

By default there is no Swap, so if we run :

Vim
1
sudo swapon -s

it will return a blank table :

Vim
1
Filename                Type        Size    Used    Priority

You will get response if you run :

Vim
1
fallocate -l 4G /swapfile

Verify :

Vim
1
ls -lh /swapfile

Proceed :

Vim
1
2
3
chmod 600 /swapfile && ls -lh /swapfile
# run this command separately
sudo mkswap /swapfile

You will get return like “Setting up swapspace version 1, blah blah blah…”. Now you can enable and check :

Vim
1
sudo swapon /swapfile

You can check by running :

Vim
1
sudo swapon -s

This is temporary swap. It will go away on reboot. This is what actually need for emergency.
If you want to make this Swap permanent, you need to follow these steps :

Vim
1
2
3
4
5
6
7
8
9
10
11
sudo nano /etc/fstab
# add this, use tab key to separate properly
/swapfile   none    swap    sw    0   0
# write out with ^ + O , Exit with ^ + X
# check swaminess
cat /proc/sys/vm/swappiness
# it should return a value closer to 0
# this command can change the value
sudo sysctl vm.swappiness=10
# swappiness=10 is set in /etc/sysctl.conf file, we can manually open it
nano /etc/sysctl.conf

Another parameter is cache_pressure, in the same way :

Vim
1
2
3
4
5
6
cat /proc/sys/vm/vfs_cache_pressure
# will return something
# changes the value
sudo sysctl vm.vfs_cache_pressure=50
# vfs_cache_pressure=50 is set in /etc/sysctl.conf file, we can manually open it
nano /etc/sysctl.conf

You should stop where we wrote “This is temporary swap” for production server. With wrong value or even if this Swap is eaten up and for some reason you need to go to rescue mode, you’ll probably forget your fathers’ name. Fix your RAM consumption. VMs are not for adding more virtual…

Tagged With can you increase ram on shared servre in rackspace , optimized memory swamp ububtu , rackspace cloud server memory increase , what is swap for cloud
Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Add Swap or Virtual Memory on Rackspace Cloud Server (Ubuntu)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • sysctl.conf Tweaking In OpenVZ Virtual Server Instance

    OpenVZ Kernel Offers A Conservative and Stable Kernel. Here Is Some Information On sysctl.conf Tweaking In OpenVZ Virtual Server Instance.

  • Changing Data With cURL for OpenStack Swift (HP Cloud CDN)

    Changing Data With cURL For Object is Quite Easy in OpenStack Swift. Here Are Examples With HP Cloud CDN To Make it Clear. Official Examples Are Bad.

  • Steps To Install Nginx Plus on Ubuntu Server (HP Cloud)

    Here Are the Steps To Install Nginx Plus on Ubuntu Server Running on HP Cloud. Nginx Plus is the Paid Version of Nginx with Extra Features.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy