So I’ve begun trying out some of the optimizations I’ve been using on my Debian machines for the past 8 or 9 years, on my N900. While I would have loved to see 512MB or more, the size we have is very usable as is. So in order to help you maximize the performance of your N900 I’ve compiled a list of simple (and completely reversible) optimizations that I’ve been using for a while that are relatively safe, but I’m not responsible for anything malafashion that happens. I’m using the Community Power-Kernel by Tom Tanner that I discussed in my previous article. It’s patched to the hilt already, but the changes listed below are extremely noticeable.
Most tweaks consist of tuning caches controlled by the kernel VM and I’m using values that are optimized for perceived performance. What happens in the background, happens, but I want my UI to be as fluid and responsive as possible. No more screen tearing, no more jagged responses. So sit down, strap in and let’s give our penguins some wings…
echo 30 > /proc/sys/vm/swappiness - The N900 is notoriously slow when doing multiple disk reads or writes. So I lower the “desire” for it to swap out pages. Less paging means more data will be stuck in RAM, so adjust it accordingly if you find yourself running out of memory. I run a cronjob that drops buffer cache containing pagecache, dentries and inodes, to clear out unused dirty pages (sync; echo 3 > /proc/sys/vm/drop_caches).
echo 0 > /proc/sys/vm/page-cluster - When it does swap out, I don’t want it doing huge operations and temporarily freeze the UI due to slow IO bus coupled with the use of CFQ scheduler instead of NOOP.
echo 1 > /proc/sys/vm/laptop_mode - But I do want it to smartly schedule when it’s going to write, so I’m not trying to write to disk when my device is in sleep mode. This might also help with reducing sporadic writes and saving the flash module.
echo 1 > /proc/sys/vm/oom_kill_allocating_task – Instead of killing “lower” priority or idle processes, I’d prefer whichever application tripped an Out-Of-Memory error, to be killed. The tasks I have in background are there for a reason.
echo 0 > /proc/sys/vm/dirty_expire_centisecs – This tells the kernel how often to look for modified/dirty pages in RAM that needs to be written to disk.
echo 0 > /proc/sys/vm/dirty_writeback_centisecs – This tells the kernel how old modified/dirty pages need to be, before they can be considered for flushing.
echo 60 > /proc/sys/vm/dirty_background_ratio – This is the lowest (percent) amount of memory where a dirty page flush can stop.
echo 95 > /proc/sys/vm/dirty_ratio – This is the highest (percent) amount of memory that can be stored before a force flush happens.
echo 0 > /proc/sys/net/ipv4/tcp_timestamps – I disable timestamps so the processor has less data to deal with when traffic comes in. Packets can be resent if they’re OOB or clocked wrong.
echo 1 > /proc/sys/net/ipv4/tcp_no_metrics_save – I also disable saving threshold metrics. Just ‘cause I’m gangster like that.
So that’s a couple of relatively safe and stable steps you can take to significantly boost your N900 performance and response time. Feel free to call me a fool for some of the values I’m using. I’ll consider your argument.
The heavy-hitters in the Android community have been tuning their kernels for quite a while and giving users awesome experience with their full customized and pre-cooked ROMS. It’s about time we catch-up to their supremeness dontchathink?