• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Anything wrong with making swap "too large?"  (Read 2387 times)
hungarianhc
Jr. Member
**

Karma: 2
Posts: 85


View Profile
« on: December 14, 2009, 07:35:57 AM »

I'm currently running a swapless debian squeeze install, but i'm going to add swap later (on my SDHC card). I have no need for storage on the SDHC card, as I'm using a USB disk for content / storage. It's an 8GB SDHC card. Any harm in setting the whole thing up as swap? If no, any advantages to NOT setting the whole thing up as swap? Thanks! Loving my sheevaplug  Grin
Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #1 on: December 14, 2009, 07:59:35 AM »

Well, I think flash is absolutely the wrong medium for swap space: could you tune your apps to reduce their virtual and real memory requirements?

If you insist on swapping on flash, why not format your card as a filesystem of your choice (say ext3) and then create a swap file within it?  You can unmount it, adjust its size and remount it, all at run-time, not so much as a reboot in sight.

That way you get greater flexibility with how you use the space, whereas swap is rather inflexible (how much tmpfs can cache do you really need).

I understand that the performance penalty of the extra indirection is minimal.

Rgds

Damon
Logged

pingtoo
Sr. Member
****

Karma: 15
Posts: 318


View Profile
« Reply #2 on: December 14, 2009, 10:42:20 AM »

I'm currently running a swapless debian squeeze install, but i'm going to add swap later (on my SDHC card). I have no need for storage on the SDHC card, as I'm using a USB disk for content / storage. It's an 8GB SDHC card. Any harm in setting the whole thing up as swap? If no, any advantages to NOT setting the whole thing up as swap? Thanks! Loving my sheevaplug  Grin
There is no harm will come from have a very large swap. Linux will not use it unless there is need. having this large swap you can create a large tmpfs for compilation of large package. you should set your swappiness to 10 to reduce OS urge to swap.
Code:
echo 10>/proc/sys/vm/swappiness
and perhaps in /etc/sysctl.conf
Code:
vm.swappiness = 10
for long term effect.

If you have lvm then partition your SDHC so you can expand your total storage is good too.

Good Luck Smiley
Logged

Good Luck Smiley

hungarianhc
Jr. Member
**

Karma: 2
Posts: 85


View Profile
« Reply #3 on: December 19, 2009, 01:45:19 AM »

Thanks for the info! What I actually ended up doing was making 2GB of my 500GB USB drive swap. It's working great - I enjoy using "top" to watch and see if the system swaps much. It rarely does.
Logged

Pages: [1]
Print
Jump to: