Editing Compcache
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | Compcache or Ramzswap, hitherto referred as ramz is a method for | + | Compcache or Ramzswap, hitherto referred as ramz is a method for using a chunk of 'normal' ram and using it as a compressed virtual memory(VM) swap space. That is, we use ram as virtual ram by compressing the contents on the fly. This is in order to squeeze as much from the ram space as possible. |
=== N8x0 === | === N8x0 === | ||
- | + | ||
To be added by a wild N8x0 user... | To be added by a wild N8x0 user... | ||
- | |||
- | |||
- | |||
- | |||
- | |||
=== N900 === | === N900 === | ||
Line 16: | Line 11: | ||
====The problem==== | ====The problem==== | ||
---- | ---- | ||
- | Lack of | + | Lack of ram is seen as one on the main performance bottlenecks an N900 user has to contend with. In it's stock set up the N900 is prone to having massive swap space coronary. This can leads to poor performance, diminished user sexual function and in the worst cases, a reboot due to watchdog timers becoming ignored. This is generally alleviated in 1 of 4 ways. |
+ | |||
==== The solutions==== | ==== The solutions==== | ||
+ | <br> | ||
+ | =====Install 'swappolube'===== | ||
---- | ---- | ||
- | |||
- | + | [[Swappolube]] is a set of VM tweaks initially dreamed up by the user Hawaii. For MOST users the installation of swappolube from the repositories and applying the default settings will suffice to alleviate the problem. | |
- | [[Swappolube]] | + | |
=====Swap on micro SD card(uSD)===== | =====Swap on micro SD card(uSD)===== | ||
- | + | ---- | |
It has been found that an easy way to alleviate eMMC contention is to move the swap space to the uSD card[http://wiki.maemo.org/Swap_on_microSD]. | It has been found that an easy way to alleviate eMMC contention is to move the swap space to the uSD card[http://wiki.maemo.org/Swap_on_microSD]. | ||
Line 35: | Line 31: | ||
=====Swap de-fragmentation===== | =====Swap de-fragmentation===== | ||
+ | ---- | ||
- | + | It has been found that as the swap space fills up the OS is unable to allocate continuous space on the swap space. This leads to poor performance. The package [[ereswap]] was created to try and alleviate this. | |
- | It has been found that as the swap space fills up | + | |
=====Compcache===== | =====Compcache===== | ||
+ | ---- | ||
+ | The articles namesake. The use of compcache has been a contentious issue. Most users have found it to cause extremely poor system performance as soon as the ramz space gets filled, which is pretty quick. It has been suggested that by some users that the 'extreme' settings of swappolube that most users run are utterly wrong for ramz. Swappolube sets the VM to swap little bits rarely. This does not work for ramz. The opposite approach for ramz must be taken, the device must swap a lot, all the time. AS the swapping is to ram, there will be little penalty in speed. Although it has been suggested that there will perhaps be a slight penalty in processor use (de/compression of ramz) and thus battery life. | ||
- | |||
- | |||
- | |||
Line 52: | Line 47: | ||
---- | ---- | ||
<br> | <br> | ||
- | |||
'''''Caveats!''''' | '''''Caveats!''''' | ||
- | *While ramz does work on kernel power version 49 (KP49) | + | *While ramz does work on kernel power version 49 (KP49) it is highly recommended that you use KP50! |
*Ramz requires a disksize that is specified in KB in powers of 2. Acceptable sizes are: | *Ramz requires a disksize that is specified in KB in powers of 2. Acceptable sizes are: | ||
- | |||
{| border="4" cellspacing="4" cellpadding="2" | {| border="4" cellspacing="4" cellpadding="2" | ||
- | ! | + | ! Ramzsize |
- | ! English | + | ! English mofo |
|- | |- | ||
|2048 | |2048 | ||
Line 81: | Line 74: | ||
|65536 | |65536 | ||
|64MB | |64MB | ||
- | |||
- | |||
- | |||
|- | |- | ||
|131072 | |131072 | ||
Line 89: | Line 79: | ||
|- | |- | ||
|} | |} | ||
- | |||
- | * | + | *You MUST have swap enabled on a physical disk before enabling ramz or your n900 WILL insta-crash potentially taking your file system with it! |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | *''Compcache is still considered experimental! It may not work, assplode your n900, rip you **** clean off. You have been warned.'' | ||
====How to enable compcache==== | ====How to enable compcache==== | ||
+ | ---- | ||
- | + | To enable compcache you must enter the following command, the following will create a ramz disk of 64MB: | |
- | To enable compcache you must enter | + | |
<source lang="bash"> | <source lang="bash"> | ||
Line 109: | Line 93: | ||
</source> | </source> | ||
- | + | Once enabled you must tell the system to use the ramz disk: | |
<source lang="bash"> | <source lang="bash"> | ||
Line 115: | Line 99: | ||
</source> | </source> | ||
- | For any of this to be any benefit | + | For any of this to be any benefit the ramz disk needs to have a higher priority than the 'physical' swap space. Make sure ALL applications are closed and disable then re-enable your physical swap. On a stock setup (swap on eMMC) you can do this: |
<source lang="bash"> | <source lang="bash"> | ||
Line 121: | Line 105: | ||
</source> | </source> | ||
- | For other setups | + | For other setups i.e. when you have swap on uSD you must substitute 'mmcblk0p3' with the location of your swap space. (If you swap partition is the second partition on the uSD then it will be 'mmcblk1p2'). |
You can now check you have the appropriate partitions with: | You can now check you have the appropriate partitions with: | ||
Line 134: | Line 118: | ||
You can see ramzswap is 64MB AND with a higher priority than mmcblk0p3. | You can see ramzswap is 64MB AND with a higher priority than mmcblk0p3. | ||
- | Now you must change | + | Now you must change you VM settings to effectivly use the new ramz setup. The following settings have been found to work with 32MB, 64MB and 128MB ramz sizes. They are a work in progress and will be updated as they are tuned to the authors workload (heavy user, treating n900 as a pocket laptop as oppose to merely a phone). |
- | + | ||
- | + | ||
<source lang="bash"> | <source lang="bash"> | ||
- | echo | + | echo 3 > /proc/sys/vm/dirty_ratio |
- | echo | + | echo 3 > /proc/sys/vm/dirty_background_ratio |
- | echo | + | echo 100 > /proc/sys/vm/dirty_writeback_centisecs |
- | echo | + | echo 100 > /proc/sys/vm/dirty_expire_centisecs |
- | echo | + | echo 32 > /proc/sys/vm/min_free_kbytes |
+ | echo 95 > /proc/sys/vm/swappiness | ||
echo 200 > /proc/sys/vm/vfs_cache_pressure | echo 200 > /proc/sys/vm/vfs_cache_pressure | ||
echo 0 > /proc/sys/vm/page-cluster | echo 0 > /proc/sys/vm/page-cluster | ||
- | echo | + | echo 4 > /sys/block/mmcblk0/queue/nr_requests |
- | echo | + | echo 4 > /sys/block/mmcblk1/queue/nr_requests |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
</source> | </source> | ||
+ | |||
+ | |||
====How to do this all at once==== | ====How to do this all at once==== | ||
Line 163: | Line 140: | ||
<source lang="bash"> | <source lang="bash"> | ||
- | + | insmod /lib/modules/current/ramzswap.ko disksize_kb=65536 && sleep 1 | |
- | + | swapon /dev/ramzswap0 && sleep 1 | |
- | + | swapoff /dev/mmcblk0p3 && sleep 1 && swapon /dev/mmcblk0p3 && sleep 1 | |
- | + | echo 3 > /proc/sys/vm/dirty_ratio | |
- | + | echo 3 > /proc/sys/vm/dirty_background_ratio | |
- | + | echo 100 > /proc/sys/vm/dirty_writeback_centisecs | |
- | + | echo 100 > /proc/sys/vm/dirty_expire_centisecs | |
- | + | echo 32 > /proc/sys/vm/min_free_kbytes | |
- | + | echo 95 > /proc/sys/vm/swappiness | |
- | + | echo 200 > /proc/sys/vm/vfs_cache_pressure | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | echo | + | |
- | + | ||
- | + | ||
- | echo | + | |
- | + | ||
- | + | ||
- | echo | + | |
- | + | ||
- | + | ||
- | echo | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | echo | + | |
- | echo 200 > /proc/sys/vm/vfs_cache_pressure | + | |
echo 0 > /proc/sys/vm/page-cluster | echo 0 > /proc/sys/vm/page-cluster | ||
+ | echo 4 > /sys/block/mmcblk0/queue/nr_requests | ||
+ | echo 4 > /sys/block/mmcblk1/queue/nr_requests | ||
+ | </source> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ==== | + | ====Making all this happen automatically==== |
---- | ---- | ||
- | There is a package called swapset[http://maemo.org/packages/view/swapset/], | + | There is a package called swapset[http://maemo.org/packages/view/swapset/], it claims to setup swaps and the ramz module automatically. The author of this article has not used it and thus cannot vouch for it's effectiveness. Using swapset AND putting the above settings into swappolube would probably cause all of the above to work automatically. |
- | |||
== N9/50 == | == N9/50 == | ||
Line 237: | Line 168: | ||
[[Category:Power users]] | [[Category:Power users]] | ||
- | [[Category: | + | [[Category:fremantle]] |
- | + |
Learn more about Contributing to the wiki.