on running Firefox for a day...


Galaxis

Member
Joined
Aug 30, 2010
Messages
318
Yesterday, I was at a conference, and used my Pandora a whole day for the first time (uptime in the end was about 9 hours, with maybe 6 hours out of standby, and a nick below 20% battery left). Now I'm probably not a typical user, because I was just using two applications - a Terminal (with several ssh sessions), and Firefox for web browsing on the conference wireless, with the system booting off an SD card.


Terminal and ssh are unintrusive, and I could probably use as many of them as I wanted (although Terminal is not exactly lightweight for what it does). Firefox on the other hand - well, it's still my favourite browser, but it's just not made for devices with relatively little memory. Maybe things get better with the memory optimizations in FF7.


For example, when accessing Google+ (couldn't find a way to the mobile version with a fully fledged browser), it absolutely needs swap, and you can practically see the system burning through battery. At one point, I had to wait for about 30 seconds until Linux found out of it's memory starvation - yes, swapping to SD cards is slow - but it didn't crash, and afterwards, things were usable until the end of the day.


Some statistics I did get in the afternoon (not as useful as I thought they might be, but hey):


Disk I/O stats. mmcblk0p1 is a small FAT partition for autoboot.txt, 0p2 is an ext3 partition with the system (and PND directories), 0p3 is swap space.


It's usually said that swap gets lots more reads than writes - there's some indication of that (7441 reads vs. 5274 writes - and the number of sectors read is actually lower than those written), but not really as big a difference as I thought. Seems that most of the stuff the kernel has thrown out of RAM actually isn't used all that much (and so swapping is particulary effective, as memory is freed for data that's in use). Also note that the system partition has more than three times the writes of swap, which I assume is mostly FFs disk cache. So it's definitely not the swapping that's going to kill my SD card :)



Code:
# fgrep mmcblk0 /proc/diskstats

179	0 mmcblk0 27449 28314 1025650 710343 24970 156924 1450136 99032289 87 2397937 100090695

179	1 mmcblk0p1 109 495 2056 1164 0 0 0 0 0 890 1164

179	2 mmcblk0p2 19897 4924 780882 435351 19696 127679 1173840 36291304 87 2345859 37039046

179	3 mmcblk0p3 7441 22880 242576 273453 5274 29245 276296 62740984 0 670875 63050109

(On diskstats fields, see here - although the kernel documentation doesn't seem 100% correct, partition fields are the same as for the device.)



Snippet of top output - about 110M of swap used:





Code:
top - 16:13:20 up  6:38,  4 users,  load average: 0.18, 2.09, 2.04

Tasks:  96 total,   1 running,  95 sleeping,   0 stopped,   0 zombie

Cpu(s): 11.2%us,  5.2%sy,  0.0%ni, 78.7%id,  4.7%wa,  0.2%hi,  0.1%si,  0.0%st

Mem:	248844k total,   222540k used,	26304k free, 	1432k buffers

Swap:   500248k total,   114208k used,   386040k free,	62460k cached

  PID USER  	PR  NI  VIRT  RES  SHR S %CPU %MEM	TIME+  COMMAND              

1130 root  	20   0 31660  14m 2804 S  9.5  5.9   4:41.45 X                    

1300 user 	20   0 46588 7704 5664 S  1.9  3.1   0:31.62 Terminal              

2209 user 	20   0  451m 130m  30m S  0.0 53.8  44:40.64 firefox-bin          

2535 user 	20   0 82736  13m  10m S  0.0  5.6   1:45.53 plugin-containe


In the end - yay: No more lugging the notebook around. Sad: Several people asked about the Pandora and I could only tell them they may register for a preorder, to possibly get one in january.
 
Last edited by a moderator:
I stuck my OS on an old 2GB SD card, so I'm not too bothered about SWAP burning through the write cycles and wearing it out.


I also seem to only have 90mb free on boot, so after running a browser it's not unusual to find that no PNDs will mount because they can't allocate memory.


I've been using Midori over FF. I don't think in this day and age of heavy websites there can really be such a thing as a low memory browser. Suffice to say; unless I'm explicitly downloading something to the Pandora, I keep my browsing on the iPad.
 
Awesome report! Battery life, mini form factor and usb host are the best selling points for myself
I really need an adapter cable for the OTG port though, as having to connect the RS232 dongle to a fat USB hub on the main port is just so undignified.


(Several afternoons with the Pandora attached to the console ports of switches and firewalls has been my other main use up to now.)
 
Last edited by a moderator:
When using swap, try setting swappiness to 10, I find it makes the system much more usable when swap usage is high. I usually exceed 150 mb of swap usage and 190 mb of ram usage.


With swappiness on default it is absolutely unusable, but with it on its fine.
 
I really need an adapter cable for the OTG port though, as having to connect the RS232 dongle to a fat USB hub on the main port is just so undignified.

Likewise, I'm going to have to attempt to buy one without accidentally getting the wrong thing.


I imagine it wont solve my midi-keyboard-needs-USB-hub problem, though.

When using swap, try setting swappiness to 10

how you do that?


Default is 60 ( for posterity ).


sudo sysctrl vm.swappiness=10


If you're happy with the resulting responsiveness of your system, you can then:


sudo vi /etc/sysctrl.conf


and add vm.swappiness=10 to the top to make it permenant.


Found here: https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it.3F


After reading up on it, I'd tend to agree that the default value of 60 would seem a little high for a portable system swapping to slow SD cards.
 
Last edited by a moderator:
I have actually set vm.swappiness=5 on my system. Don't really know why the post turned out mentioning swap so often, though. Guess that's what you get interested in when running Firefox :)
 
Back
Top