Linux SWAP

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 11:33, 24 May 2008 (edit)
Switch (Talk | contribs)
(Introduction)
← Previous diff
Revision as of 11:53, 24 May 2008 (edit) (undo)
Switch (Talk | contribs)
(Requirements)
Next diff →
Line 16: Line 16:
== Requirements == == Requirements ==
 +
 +If order to use [http://en.wikipedia.org/wiki/Swap_space paging], you first need an external storage. This means that users with neutered routers (like the WRT54G v5) that only have 2MB of flash and run the Micro build of DD-WRT ''cannot'' enable swapping in any way. It's recommended to usb-attached HDDs or SSDs for swap space, as opposed to SD/MMC/flash disks. The reason is that swap is read/write intensive and will lead to [http://en.wikipedia.org/wiki/Flash_memory#Memory_wear flash wear].
 +
 +The utilities required to enable swapping require your router to have [[Optware]] support. Follow the tutorial on installing ''ipkg-opt''. Once you have ipkg-opt ''properly'' installed, connect to the router via telnet/ssh and issue the following commands (be advised as you may have problems if you didn't install optware support correctly!):
 +<pre>
 +/opt/bin/ipkg-opt update
 +/opt/bin/ipkg-opt install busybox
 +</pre>
== Enabling swap == == Enabling swap ==
== Checking swap == == Checking swap ==

Revision as of 11:53, 24 May 2008

Contents

Introduction

What is SWAP?

Swap space is an auxiliary storage, such as a portion of a hard-disk, which can be used as memory by the operating system when system RAM is insufficient. This is especially useful on systems with very little system RAM, such as most DD-WRT compatible routers, as it helps prevent the system from running out of memory when multiple background processes are installed.

Do I need SWAP?

Swap can be helpful in situations where dd-wrt:

  • runs memory intensive applications (Optware)
  • runs multiple background processes (again, Optware)
  • runs on a router with less than 32 MB of RAM

Swap won't really be needed if:

  • you only use the router for it's basic gateway/AP functions
  • you only run a few additional services or applications with modest memory requirements
  • your system has a lot of RAM (such as 64+ MB)

Requirements

If order to use paging, you first need an external storage. This means that users with neutered routers (like the WRT54G v5) that only have 2MB of flash and run the Micro build of DD-WRT cannot enable swapping in any way. It's recommended to usb-attached HDDs or SSDs for swap space, as opposed to SD/MMC/flash disks. The reason is that swap is read/write intensive and will lead to flash wear.

The utilities required to enable swapping require your router to have Optware support. Follow the tutorial on installing ipkg-opt. Once you have ipkg-opt properly installed, connect to the router via telnet/ssh and issue the following commands (be advised as you may have problems if you didn't install optware support correctly!):

/opt/bin/ipkg-opt update
/opt/bin/ipkg-opt install busybox

Enabling swap

Checking swap