Add swap file under linux
web hosting directory web hosting dedicated server colocation hosting web hosting services servers web hosting company web hosting article web host news web host news

web hosting
Cheap web hosting
Windows web hosting
Linux web hosting
Unrestricted hosting
Ecommerce web hosting
Virtual server VPS
Reseller hosting
by US State
by US City
Web Hosting coupons
VPS coupons

Cheap dedicated servers
Best dedicated servers
Windows dedicated servers
Linux dedicated servers
Unrestricted server
dedicated managed server
dedicated server unmetered
by US State
by US City
Dedicated server coupons

Cheap colocation hosting
Unrestricted Colocation
by US State
by US City
Coupons Promotion

Domain Registration
SSL Certificate
Website Statistics
Merchant account
Control panel
WebSite monitor

Intel Servers
AMD servers
SCSI Servers
Cheap Servers

Web hosting company
Dedicated Hosting
Colocation hosting
Web Hosting Services
Server manufacturer

So you want to know how you decide what web host is best!

What is 1Mbps 95th percentile ?

Top 10 Dedicated servers May 2010

Westmere Dedicated server the best deal

Using CMS to create Websites

Top 10 Dedicated Servers March 2010

Control Panel Benefits

Top 10 Dedicated servers January 2010

More Articles

Ring the Christmas Bells with Infrenion Networks 50% Discount!

WebHost.UK.Net: offering web hosting great deals this Christmas.

Action Web Group Introduces The All New RubberBand Plan To Take The Place Of Unlimited Web Hosting!

Vision Helpdesk Christmas Madness is back! HO-HO-HO Huge Discounts!

Codero Names Jonathan Ewert as President and CEO

Lunarpages Boosts Reseller Plan

More News

Add swap file under linux

Add swap file under linux

Add swap file under linux

If you are adding more memory on your dedicated server, you will need to add more swap space. You have two choices: add or upgrade a swap partition or create a swap file. Because changing the size or create a new swap partition is not easy, the best solution is to create a new swap file. Since the 2.6 Linux kernel, the swap files are just as fast as swap partitions.


  • 1 GB RAM ---> 2 GB of Swap file
  • 2 GB RAM ---> 4 GB of Swap file
  • 4 GB RAM ---> 8 GB of Swap file
  • 8 GB RAM ---> 12 GB of Swap file
  • 16 GB RAM ---> 24 GB of Swap file
  • 32 GB RAM ---> 32 GB of Swap file

  • Create a swap file

    To create a swap file, use the "dd" command to create an empty file. Next you need to use mkswap command to set up a Linux swap area on a device or in a file

    1) Login as the root user

    2) Create and Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks.You can do this with the linux command "dd". For example, the block size of a 1GB swap file is (1024 * 1024MB = 1048576 block size). Type following command to create 1GB swap file

    # dd if=/dev/zero of=/swapfile bs=1024 count=1048576

    Note: "swapfile" is the name of your swapfile.

    3) Setup the swap file with the command: mkswap. Type following command to setup your swap file:

    # mkswap /swapfile

    4) To enable the swap file immediately but not automatically at boot time. Type:

    # swapon /swapfile

    5) To enable the new swap file automatically at the boot, you need to edit the file /etc/fstab and add the following line.

    /swapfile swap swap defaults 0 0

    The swap file will be enabled at each time the system boots.

    6) You can verify the swap file is working fine with these commands:

    # cat /proc/swaps
    # free

    This article has been written for AskWebHosting. Each day, you will find the best dedicated servers deals on Don't miss the Best dedicated servers selected by AskWebHosting.

    Related Articles

    Related special offers

    TOP 10 Best Dedicated Servers January 2011 recommends real time web statistics for tracking your visitors.

    SingleHop Review
    Codero Review
    1&1 USA Review
    DedicatedNOW Review
    TurnKey Review
    iWeb Review
    ServerPronto Review

    iPage Review
    JustHost Review
    FatCow Review
    CoolHandle Review
    midPhase Review
    HostMonster Review
    BlueHost Review
    Hostgator Review

    ERRORQuery Error