5

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.

6
  • you need to be more specific about what you mean by 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 7, 2015 at 2:49
  • @shellter Thanks for quick reply. While copying, mouse freezes for few seconds at place while hovering on screen. Even opening home folder takes lots of time. I'm not sure, is it problem of software or hardware. And as you said pointing out less significant processes is really tough. If you want I can post a snapshot of output command 'top'. But I don't think background processes are responsible for it as it has been just a week since I installed the OS. Jan 7, 2015 at 15:57
  • Post it to paste.ubuntu.com and provide a link back here...
    – Fabby
    Jan 7, 2015 at 23:50
  • @Fabby Here is the link: paste.ubuntu.com/9693008 Jan 8, 2015 at 14:36
  • What kind of Internet connection are you using? Were you downloading a bunch of files while doing this? A ton of tabs open in Chromium?
    – Fabby
    Jan 8, 2015 at 14:49

3 Answers 3

1

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.

2
  • can you elaborate what is happening? what are those values and what do they do? Jul 24, 2016 at 14:17
  • 1
    vm.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: major.io/2008/08/07/reduce-disk-io-for-small-reads-using-memory
    – R.k. Anand
    Aug 13, 2016 at 11:25
0

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:

  1. chromium.
  2. compiz

The cheap solution:

  1. Easiest to solve. Chromium is known to be a memory hog: uninstall it and use FireFox instead.
  2. 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). :-(

1
  • 2
    I 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. Jan 11, 2015 at 4:02
0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .