12 years ago
How do I make my Ubuntu - Mint faster. (Applies for Desktop, Laptop and Note Book)
By default, Ubuntu, unfortunately too much tendency to start using the swap (virtual memory on the hard disk). Useful for servers, but not for normal use.
This speaks Ubuntu, especially with 512 MB of RAM or less, the swap too quickly. Who writes on the hard drive slow ubuntu considerably. Virtual memory on the hard disk is simply much slower than the "real" RAM.
The swap tendency may have a value of 0 (fully off) to 100 (swap is constantly used).
First check the current tendency of your Ubuntu swap:
Applications> Accessories> Terminal window:
Tap (copy and paste):
Press Enter. Probably the tendency to swap 60, which is only for servers is a good value. For normal home use is far too high.
Reduce the swap tendency therefore as follows:
Applications> Accessories> Terminal Window
Copy and paste.
gksudo gedit /etc/sysctl.conf
Now start Gedit little notebook with a specific text file.
Add at the bottom of that text file, the following lines (copy and paste):
# Reduce the swap tendency
vm.swappiness = 10
Save the text file and exit Gedit little notebook.
Restart Your Computer: And now it's done at 10.
Home rule is a workable example Ram = 1 GB or more 10.
Less than 1 GB Ram = 1.
So I gave him 10 standing.
This is not working for me. It says " 'gksudo' not found
Am I missing something??
Is that still working honey
It always works. Also add this line underneath the "vm.swappiness=10"
Will increase the speed of your file transfers.
The Swap partition is a "scratchpad on the side" to keep copies of memory on the disk - but on a separate partition, because experience show that writing these to places in the regular file system cause fragmented allocations on the disk, giving poor performance.
I have optimised squeaking systems by moving the swap partition to the middle of the disk, to minimise head movement. Use and access pattern is very different by the "swapper application" than by eg. "VLC".
"Swapping" is making disk copies of what should have been in RAM, but is not. It assumes that the RAM size is a fraction of what you use - see Denning´s description of "Working Set". These models assume that the RAM is divided into "pages", and the "pages" that are not used are written back to the disk if they have been changed, or just reclaimed the space. Today´s memory usage is very different: old systems were compiled and code,data, heap and stack are "segments" that the "paging algorithm" considered. Interpreting say Java is where some code: the Java VM, reads a file - with code, data,heap and stack all mixed. This creates different demands on memory. The second is media: a movie or sound is played once and the "Working set" is what you see on the screen for a brief moment , because you will seldom stop and rewind and play slowly again. But still the entire file is kept in memory until the movie ends - with "swappiness" of 100. You tell the system to not push what you work with to the disk. At 60, the swapper can dispose of it - but will look at last time the page was used only. The swappiness of 10 is better, because you will never see that part of the file ever again - flush it to the disk - and since it has not been modified, "forget it". If "swappiness" is set to high, you will see the movie fine, but a sudden call on Skype will be an issue. Have problems with the screen not responding? - Lower the "Swappiness" so there is buffer space for a new screen that needs to be painted. When you have all the memory in your RAM that you will need - disable swapping with "Swappiness" at 100. "Pressure" sets the interval to find victims, and if you use a lot of large media, the pressure may be high. If you use "office" - spreadsheet, email and Skype, play music in the background the pressure can be low, and all your spreadsheets with the last 10 minutes of music is in memory. If the system "freeze" - the pressure is too low, and increase this, will cause less of your music to stay in RAM but more of what you work on. The time to find space for a new window and thus your perception of responsiveness will be better at a higher pressure, but background CPU and swapping overhead bigger. It is all about a balance, and the 4GB limit is rubbish. A movie takes 3GB - or say 2GB per hour but there is absolutely no benefit in the viewing of this by keeping it all in memory for two hours. There is an overhead for managing memory, and the statement can be that 4GB of RAM is so much memory that you will seldom be able to use all of it between two reboots and can turn off swapping.
If you have more than 4 GB ram, the whole concept of reserving a swap partition becomes a moot point.
Remember: the swap partition was once "invented" as virtual ram solution.
Great Tut. And yes, it works ,-)
yeap it works, i had also read about this on another site. but didn't try it till today. thank you for the clear explenation and tip.
i seriously needed a swap-setting of 10 instead of 60 with 6Gb of RAM :)
thanks for the info
it works, on my LM 16 cinnamon
I've yet to reboot and see if this works
why cgroups, or the package ulatencyd its not installed by default, or even get a mention on this tutorials??
Massive improvement doing desktop tasks alongside with large IO operations..
1) sudo apt-get install ulatencyd ulatency
3) reboot if u get a blank screen for too much time (its correct this? or is a kpanic?)
Iv tryed it.And it gave me a boost performance by almost a half on my dell inspirion 15.Thanks
Merci, très utile!
Top tip - thank you. My sluggish laptop is now purring along nicely!
Thanks made it soldier proof!
Worked for me. Thanks
Nice tutorial. I've followed it.
I wish I had followed it when I was using KDE. It was very slow so I had to switch to xfce. :(
But I love KDE.
Good. Very helpful.
Awsm, especially the swap tendency bit. really helped my netbook.
Vielen dank mann ;) and i add you as a friend :) OmG!
Thanks :) it works
The more value I set the faster programs start. I started Firefox, Thunderbird, LibreOffice, Skype, Stardict, Banshee, Totem, gThumb, Ubuntu Tweak together. When the value is 0 it took about 5 minutes all the programs to get started. When the value is 100 - 1:40.
Linux Mint 11 Katya, Intel Pentium Dual CPU E2200, 1GB RAM
Can anyone explain?
Very cool! Thanks for the tutorial.
Great tut, thanks!
thanks a lot wanda for such tutorial. :)
Nice job. Will have to try that.
The last install I did I didn't include a swap file in the partition and increased the computer's performance.
Thank you, this is very interesting!
Great tip :-)
good info! i like your info, thanks for your info! im sorry when i have incorrect words because i cant speake english, im indonesian
great tutorial, its work on LMDE to.
Thanks, my pleasure.
Thanks for this, was nice and simple.
I'm useing LinuxMint julia and supouse that this tecnik doesent work here.
Read about the Kernel 2.6 swapping behavior to find out that swap_tendency = mapped_ratio/2 + distress + vm_swappiness; Swappiness is a global parameter and it affects every process on the system in the same way.
I thought that swap space was only used when "real" RAM was full (or near-full). What exactly is the role of this "tendency" ?
Good tip, thank you.