Fix/Reduce lags on 1.1.0.3x (Update 9)
As mentioned in the update 9 the UI can stutter in low memory situations. As I am a heavy multitasking user I stumbled upon and wanted to provide me a fix for this.
This fix works for me as it reduces the amount of stutter noticeably. However this might be not the ideal solution for every user.
Basically what I did was tweaking the vm.swappiness handling. The default value is set to 30 which is around half of the default value of the linux kernel and in easy terms means swap out not too early . The problem I encountered that this value seems to low as it swap outs too late which causes stutter in the ui. So I just simply raised the value to 100 which in easy terms means swap out as early as possible. Of course this makes overall system performance a little less fast but there I don't suffer from long lags due to full running ram anymore.
In easy terms. Its just like on modern gaming consoles. A 60 FPS rate is nice to have (like the default vm.swappiness 30) but it is noticeable when the framerate drops drastically on fast actions or many stuff being rendered. Reducing to a healthy 30 FPS (vm.swappiness 100) makes performance a little slower but the system is more able to render this framerate constantly and a big break down of the framerate is not observed.
If you want to try it out I recommend to do a backup of the file /etc/sysctl.d/vm.conf . You need developer mode enabled and have to edit this file with devel-su rights. Change the vm.swappiness=30 to vm.swappiness=100 . To apply the change either reboot or enter sysctl -p /etc/sysctl.d/vm.conf
Also for all still running the older 1.0.x version and having zram module installed (from warehouse). This change should be ideal as swapping out early onto a compressed swap is much faster than onto a swap partition/file on the internal flash.
Would be interesting if testers could provide feedback for this.
When user becomes heavy multitasker with Jolla?
I typically have 3 to 7 open apps such as Mitäkuuluu, Jolla Message app, Jolla browser, Jolla email with three accounts activated, Phone app, Persons app and Settings App
Is this already heavy multitasker situation from Jolla point of view?
I have not updated yet to 1.1.0.3x (Uitukka) due to low memory warnings, but I have to say that also the SF OS 1.0.8.21 Tahkalampi seem to have similar issues continuously. I don't have applied the ZRam module either - Should I do that before trying this fix?
If I would proceed with the fix, how to edit the designated file with terminal app?
Kari ( 2014-11-12 16:12:21 +0200 )editYeah I would say all above 4 apps (also depending on the apps mostly also) falls into the category of heavy multitasker. But of course multitasking also implies switching between open apps often and doing parallel jobs in them.
If you didn't already tried the zram module and zram config package on 1.0.x I would recommend trying it first with the defaults and then with the vm.swappiness change and see it for yourself if it improves your workflow.
For editing text files in terminal I personally use vi . But the vi text editor is not for everyone. I don't think there is any other text editor preinstalled on SailfishOS that works in the command line. So here a link for a vi in 10 minutes documentation: http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html
Step by step:
leszek ( 2014-11-12 16:23:27 +0200 )editopen terminal
type in devel-su
enter your password (password set in settings development mode)
type in vi /etc/sysctl.d/vm.conf
Use arrow or j key to navigate cursor down to the 3 of 30
Press c followed by w (means replace word)
Type in 100
Press ESC
Type in :wq (means write and quit)
Thank you very much for the instructions to make the update of the VM.conf file
I wonder would it be good to make the swappiness change before the Zram installation?
Less tinkering for the inexperienced user ;)
Kari ( 2014-11-12 16:30:22 +0200 )editI would recommend first installing zram. (but that module only works on 1.0.x) As for inexperienced users. All those changes are more targeted for advanced users who are able to undo all changes without a guide to help them.
All in all zram is the solution that will come in update 10 most probably so I would recommend testing it if you have the chance. Together with the vm.swappiness it could make a good pair when it comes to multitasking.
leszek ( 2014-11-12 16:35:42 +0200 )editKudos for the initiative of tweaking things and sharing your findings, however, there might be a pretty unpleasant side effect to setting the vm.swappiness to 100.
Although I am not an expert on this topic, my first thought when thinking about "swapping as early as possible" is the fact that it is done on flash memory which has a limited number of writes in its lifetime. The default value of 30 might have had this aspect taken into consideration by the sailors at Jolla.
Some related articles on this topic:
http://unix.stackexchange.com/questions/88693/why-is-swappiness-set-to-60-by-default/88820
http://unix.stackexchange.com/questions/34034/what-is-the-appropriate-value-of-vm-swappiness-when-using-zram
Drekkarian ( 2014-11-12 23:33:31 +0200 )edit