I have a lenovo laptop with ubuntu 14.04 (64 bit) installed on it. It has Intel® Core™ i3-3110M CPU @ 2.40GHz × 4 processor, 4 GiB ram and Nvidia 635 M graphics card. The system works fine under normal operations but it lags, stuck a lot during copying files. Earlier I was using 13.10 and no such problem was with with. Any help would be appreciated.
3 Answers
Just do these things
sudo -H gedit /etc/sysctl.conf
Now add these lines at the end of this file
vm.dirty_background_ratio = 5
vm.dirty_ratio = 10
Now save and exit
Then again type in terminal:
sudo sysctl -p
Press enter and whoaaa! It's done: no more lag.

- 197,895
- 55
- 485
- 740

- 131
- 6
-
can you elaborate what is happening? what are those values and what do they do? – Surya Teja Karra Jul 24 '16 at 14:17
-
1vm.dirty_ratio – The highest % of your memory that can be used to hold dirty data. If you set this to a low value, the kernel will flush small writes to the disk more often. Higher values allow the small writes to stack up in memory. They’ll go to the disk in bigger chunks.
vm.dirty_background_ratio – The lowest % of your memory where pdflush is told to stop when it is writing dirty data. You’ll want to keep this set as low as possible. Read more here: https://major.io/2008/08/07/reduce-disk-io-for-small-reads-using-memory/
– R.k. Anand Aug 13 '16 at 11:25
Looking at the top
output you provided in the comments you have one problem (not enough cache memory) that can be divided into two sub-problems:
- chromium.
- compiz
The cheap solution:
- Easiest to solve. Chromium is known to be a memory hog: uninstall it and use FireFox instead.
A bit more complex to solve.
a. Make a system backup! If you don't know how, read What's a good backup strategy for 1 PC (You've now officially become user type 4 instead of being user type 3)
b.
sudo apt-get install compizconfig-settings-manager
(aka CCSM)c. Go to the dash and type "Compiz" and the CCSM icon should come up.
d. And now it's up to you: turn off anything you don't use! E.g. if you don't use multiple desktops, turn off "Expo" and "Desktop wall" (and that's why you have to take a back-up: you're on your own here; I don't know what you use and what not)
The expensive solution
Buy more RAM. Double it (at least). :-(
-
2I started to use firefox and one more thing that I did seem to resolve the problem. I updated the kernel to 3.16.0-28-generic and copied bunch of heavy files and things went fine. I'll try CCSM too, it may improve performance further. Cheers. – Sunil Kumar Jan 11 '15 at 04:02
I found that disabling the transparent huge pages feature does help.
Check if it is enabled:
cat /sys/kernel/mm/transparent_hugepage/enabled
- enabled: [always] madvise never
- disabled: always madvise [never]
To disable do:
sudo su -c 'echo never >/sys/kernel/mm/transparent_hugepage/enabled'
To [re]enable do:
sudo su -c 'echo always >/sys/kernel/mm/transparent_hugepage/enabled'
More info at: https://access.redhat.com/solutions/46111

- 136
lags
. Also, did you look at what processes are running on your system. I'm no expert, but it seems that each new version of Ubuntu adds more and more background processes that are "features". You may have to do some research to decide which, if any processes, you can do without. (Not easy I know!), Good luck. – shellter Jan 07 '15 at 02:49