HowTo Improve system responsiveness [tweak] (liquorix)

Write tutorials and howtos in here
More tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please, Before you post please read this

HowTo Improve system responsiveness [tweak] (liquorix)

Postby kwevej on Tue Apr 05, 2011 5:47 am

Under high I/O loads, this seems to improve the desktop reactions:

Code: Select all
 su
echo 'vm.swappiness=10' >> /etc/sysctl.conf
echo 'vm.vfs_cache_pressure=1000' >> /etc/sysctl.conf
echo 'vm.dirty_background_ratio=10' >> /etc/sysctl.conf
echo 'vm.dirty_ratio=30' >> /etc/sysctl.conf
sysctl -p


You can invoke high hdd activity by:
Code: Select all
dd if=/dev/zero of=tmp bs=1024k count=1024

Don't forget to delete the tmp file.


Try to interact with your desktop under high HDD act. before applying the 'tweak' and after. (needs reboot)

It worked for me.
It is intended for liqorix users, but it could help vanilla kernel users as well, I guess


Source: http://forums.debian.net/viewtopic.php? ... 20#p313472

EDIT: A good test seems to be just opening the home folder in Nautilus during the load.
Last edited by kwevej on Tue Apr 05, 2011 12:04 pm, edited 2 times in total.
User avatar
kwevej
Level 5
Level 5
 
Posts: 624
Joined: Mon Mar 22, 2010 3:35 pm
Location: Delft / Prague [@ LMDE]

Linux Mint is funded by ads and donations.
 

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby Halzen on Tue Apr 05, 2011 11:27 am

Interesting. I noticed no slowdown on my machine with that HDD load script, but I am using a particularly modern laptop. This could be very helpful for those running older systems. Thanks for posting. :)
Acer TimelineX: 13" LED, Intel Core i3 2.53Ghz dual-core, 4GB DDR3 RAM, Intel HD GMA graphics
Arch Linux + Openbox
User avatar
Halzen
Level 1
Level 1
 
Posts: 42
Joined: Wed Feb 23, 2011 1:03 pm
Location: Florida, USA

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby wyrdoak on Fri Jul 22, 2011 9:17 pm

Seems to have sped up my Chrome browser on my netbook, pages seem to be loading faster. It's been a pain on some web sites. Using cable broadband I know it's not a slow ISP.
-Dell Mini Netbook-Atom CPU-N270-1.60ghz; 16gbs mini ePCI PATA SSD
RAM- 1gbs-(Maya-Xfce) LInux 3.2.0.57-generic(i686)
SolydX (32bit)
User avatar
wyrdoak
Level 6
Level 6
 
Posts: 1310
Joined: Thu May 19, 2011 1:32 pm
Location: USA

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby LifeInTheGrey on Sat Jul 23, 2011 12:42 am

While I've only done limited testing, seems to work pretty well. I ripped a movie with Handbrake and CPU usage was around 85-90% the whole time, but the system was still very responsive. No slowdown, no stuttering graphics, so far so good.

I should mention I'm on the stock .39-3 kernel, not on liquorix. Thanks for the tip!
the beauty of linux is that the rabbit hole goes as deep as you want it to go.
LifeInTheGrey
Level 3
Level 3
 
Posts: 145
Joined: Thu Apr 28, 2011 4:38 pm
Location: Seattle

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby wyrdoak on Sat Jul 23, 2011 1:55 am

Just watch a mkv movie with no stuttering on my netbook.

BTW, I'm running an Atom N450 CPU 1.6ghz 2gbs of RAM on a stock 2.6.39-3 64bit kernel.
-Dell Mini Netbook-Atom CPU-N270-1.60ghz; 16gbs mini ePCI PATA SSD
RAM- 1gbs-(Maya-Xfce) LInux 3.2.0.57-generic(i686)
SolydX (32bit)
User avatar
wyrdoak
Level 6
Level 6
 
Posts: 1310
Joined: Thu May 19, 2011 1:32 pm
Location: USA

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby Brian49 on Sat Jul 23, 2011 6:04 am

kwevej - These look like good tweaks, but it would be helpful if you could explain some of the technical terms, please. What exactly are the "dirty ratio" and "dirty background ratio"? Many thanks.
Brian49
Level 5
Level 5
 
Posts: 601
Joined: Thu Oct 29, 2009 2:27 pm

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby LifeInTheGrey on Sat Jul 23, 2011 11:43 am

Brian49 wrote:kwevej - These look like good tweaks, but it would be helpful if you could explain some of the technical terms, please. What exactly are the "dirty ratio" and "dirty background ratio"? Many thanks.


after some googling, I found http://artipc10.vub.ac.be/wordpress/2011/05/27/linux-performance-improvements/ on VM dirty ratio

By default the VM dirty ratio is set to 20% and the background dirty ratio is set to 10%. This means that when 10% of memory is filled with dirty pages (cached data which has to be flushed to disk), the kernel will start writing out the data to disk into the background, without interrupting processes. If the amount of dirty pages raises up to 20%, processes will be forced to write out data to disk and cannot continue other work before they have done so.

By increasing these values, more data will be cached into memory, and data will be written out in larger I/O streams. This can be a good thing on servers with fast storage and lots of memory.

To increase these values, create a file /etc/sysctl.d/dirty_ratio.conf with these contents:

vm.dirty_ratio = 40
vm.dirty_background_ratio = 15

Then with the command sysctl -p /etc/sysctl.d/dirty_ratio.conf you make these settings become in effect immediately.

On desktop systems, the default dirty_ratio of 20 and dirty_background_ratio of 10 should be reasonable. You do not want a too high dirty_ratio on desktop systems, because applications will stall for too long if they have to write out all these dirty pages at once.

I'm going to fiddle around with these settings, see if it really makes a difference.
the beauty of linux is that the rabbit hole goes as deep as you want it to go.
LifeInTheGrey
Level 3
Level 3
 
Posts: 145
Joined: Thu Apr 28, 2011 4:38 pm
Location: Seattle

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby linuxviolin on Sat Jul 23, 2011 12:01 pm

I agree with things like swappiness, although I always set up it on my systems at 0, not 10, as on a desktop computer, you want swappiness to be as close to zero as possible. But vfs_cache_pressure = 1000? :shock: Hmm, mine is always at 50 and no problem with "the desktop reactions", at the contrary. :D To increase the speed of browsing files and folders again and again, we should decrease vfs_cache_pressure. Not sure there is a real need to touch to dirty_background_ratio and to dirty_ratio. You can find good advices here: Tales from responsivenessland: why Linux feels slow, and how to fix that

Problem, bug, with Liquorix kernel(s)? :roll: In the link you give, we read:

There are a lot of complaints about the system being unresponsive when copying large files

Maybe also something to see with the file system. Try XFS and/or JFS instead ext4. I use them exclusively for a long time now and never had a problem like this one whatever the distro... At the contrary.

Just one example. On my 'test' PC, I use Mageia Cauldron (future Mageia 2). It is setup as I always do with vm.swappiness = 0 and vm.vfs_cache_pressure = 50. The / partition is JFS and /home is XFS. Well, there is absolutely no problem of "desktop reactions", system responsiveness or some problem copying large files. At the contrary. E.g. when I'm browsing files and folders, the system is quite fast and when I copy a large file like a 4 GB or more ISO or a quite big MKV file, more 5 GB at least, from a folder to another, well, the copy just takes some seconds... :D
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
User avatar
linuxviolin
Level 8
Level 8
 
Posts: 2055
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby Brian49 on Sat Jul 23, 2011 5:18 pm

Thanks for the pointers. The value of 1000 for cache pressure has to be a typo; as far as I know, all these VM parameters are on a scale of 0 to 100.
Brian49
Level 5
Level 5
 
Posts: 601
Joined: Thu Oct 29, 2009 2:27 pm

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby linuxviolin on Sun Jul 24, 2011 2:36 am

Brian49 wrote:Thanks for the pointers. The value of 1000 for cache pressure has to be a typo; as far as I know, all these VM parameters are on a scale of 0 to 100.

Maybe, probably. But 100 is the defaults for vfs_cache_pressure. So, if you want the defaults, there is no need for adding something about them in sysctl.conf... You must add a line just if you want to change them.
K.I.S.S. ===> "Keep It Simple, Stupid"
"Simplicity is the ultimate sophistication." (Leonardo da Vinci)
"Everything should be made as simple as possible, but no simpler." (Albert Einstein)
User avatar
linuxviolin
Level 8
Level 8
 
Posts: 2055
Joined: Tue Feb 27, 2007 6:55 pm
Location: France

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby Smiff2 on Sun Jul 24, 2011 7:15 pm

i think numbers of 1000 are valid, but probably a bad idea

you can test these by typing e.g.
Code: Select all
sudo sysctl -w vm.vfs_cache_pressure=50

no need or even dangerous to add to your .conf immediately, where it'll be permanent..
Smiff2
Level 3
Level 3
 
Posts: 118
Joined: Sat Jan 16, 2010 11:53 am

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby LifeInTheGrey on Sun Jul 24, 2011 8:42 pm

Smiff2 wrote:i think numbers of 1000 are valid, but probably a bad idea

you can test these by typing e.g.
Code: Select all
sudo sysctl -w vm.vfs_cache_pressure=50

no need or even dangerous to add to your .conf immediately, where it'll be permanent..


I must admit I'm having more success now after removing the dirty components and reducing vfs_cache to 50.
the beauty of linux is that the rabbit hole goes as deep as you want it to go.
LifeInTheGrey
Level 3
Level 3
 
Posts: 145
Joined: Thu Apr 28, 2011 4:38 pm
Location: Seattle

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby sanda on Tue Dec 20, 2011 4:48 am

old thread? The OP mentions liquorix and nautilus, neither of which are present in the LMDE I recently installed.
The tip regarding swappiness tweak is relavent to any kernel?

After decking out my xfce with plugins, I'm not finding it to be "remarkably" lighter than the other, heavy-hitter, DEs

Every "launcher" item added to an xfce panel (scuse me if I'm using the wrong term)(xfApplet-}launcher) seems to act like a TSR process, each adding 1.5Mb RAM overhead... and, after having FINALLY gotten my sound working under LMDE (3rd install, no clue what the problem was previously) I'm noticing stutters during audio playback.

My system startup is blazingly fast, but immediately after starting an xfce session, 250Mb+ RAM is already consumed. Toward troubleshooting, I've already pruned (toggled off) most of the startup daemons/services.

I have disabled the xfce effects (shadows, etc) and I still need to check how much friendlier xRenderer vs openGL would be for my Radeon GT240... but, as is, I can't envision sticking with xfce unless I can *at least* overcome the audio stuttering (a hiccup which seems to occur every 10-15 seconds or so, happens in various audio player apps)

so thanks, in advance, for any further tips/suggestions
sanda
Level 1
Level 1
 
Posts: 46
Joined: Mon Dec 19, 2011 5:05 pm

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby ej64 on Tue Dec 20, 2011 6:30 am

^ try
Code: Select all
sudo echo 0 > /sys/module/snd_hda_intel/parameters/power_save
= disable audio power saving. If it doesn't help enable it again by echoing the number of seconds until power saving (eg. echo 10 > ...)
Another reason can be a wireless controller/driver causing (or even any other driver/hw) bad latencies. Check dmesg for any quirks. Try sound with wireless disabled.

xRenderer will come with a severe performance hit. your 250 MB are somewhat unavoidable with a 3rd party closed source graphics driver. Do you really worry? Maybe you've installed something that pulls large dependencies (eg. a Qt = KDE app) ? Get rid of the launcher and configure keyboard shortcuts like Meta+w for the webbrowser. Keep your installation clean and simple ... :wink:
Thinkpad X220 with Samsung SSD running Xubuntu 13.04
I'm getting old gladly -- I don't like to die young ...
ej64
Level 4
Level 4
 
Posts: 326
Joined: Tue Nov 24, 2009 7:43 am
Location: somewhere in Germany

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby midnight gypsy on Fri Dec 23, 2011 6:27 pm

i registered on the account of this post and the fact I'm impressed with LMDE. But, i'm very confused with the terminology. Could someone please speak in layman(redneck) terms. And explain in a understanding way. I have googled this quite a bit. If it helps, I have four gigs of ram. What I want to accomplish is to speed up the programs( apps). That I normally click on and use often. (ie home, firefox, control-center etc...). one of the terms I do not understand is dirty page. I think this means an app that was open. But now is closed. if this is true, wouldn't it make since to have a high dirty page ratio. To keep your normal everyday apps in ram. I hope someone can explain this to my understanding..... Thank you, Russ

If it helps, This is my settings are now. I do not have a swap partion in my hard-drive.

vm.swappiness=0
vm.vfs_cache_pressure=2000
vm.dirty_background_ratio=2
vm.dirty_ratio=20

These settings seem to be slower when I first open a page(app) ( ie home, firefox etc.) If closed and reopen seem to be faster.
midnight gypsy
Level 1
Level 1
 
Posts: 14
Joined: Fri Dec 23, 2011 5:37 pm

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby ej64 on Tue Dec 27, 2011 7:59 am

midnight gypsy wrote:What I want to accomplish is to speed up the programs( apps). That I normally click on and use often. (ie home, firefox, control-center etc...).
install preload ("sudo apt-get install preload"), this loads your often used data and programs in advance. Boot time may suffer, though.

I do not have a swap partion in my hard-drive.
vm.swappiness=0
vm.vfs_cache_pressure=2000
vm.dirty_background_ratio=2
vm.dirty_ratio=20
If you don't have a swap partition these parameters are irrelevant to your system.

These settings seem to be slower when I first open a page(app) ( ie home, firefox etc.) If closed and reopen seem to be faster.
This has nothing to do with swapping. It's just when you once opened an app it has already read from your HD and is available now in the buffers (HD caching in spare RAM that is not used otherwise).
Thinkpad X220 with Samsung SSD running Xubuntu 13.04
I'm getting old gladly -- I don't like to die young ...
ej64
Level 4
Level 4
 
Posts: 326
Joined: Tue Nov 24, 2009 7:43 am
Location: somewhere in Germany

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby midnight gypsy on Tue Dec 27, 2011 4:46 pm

I do run preload and readahead. Which helps load apps faster. I have tried quite a few settings. And you are right on those settings. They work that way on mine. I'm just a little confused. All the googling I've done.. Is always explainded in an unclear way. It reminds me of a union contract talking in circles..lol. I was hoping someone could explain it a lil better or easier... Russ
midnight gypsy
Level 1
Level 1
 
Posts: 14
Joined: Fri Dec 23, 2011 5:37 pm

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby ibm450 on Fri Jun 08, 2012 7:26 am

would this work on mint 13 & ubuntu 1204

cheers
Image
Asus UL50VT laptop ~ LM10 - Unity 12.04 - Win 7
Image
User avatar
ibm450
Level 5
Level 5
 
Posts: 604
Joined: Sun Jan 11, 2009 6:56 am
Location: Kwinana, Western Australia

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby craigevil on Fri Jun 08, 2012 2:05 pm

ibm450 wrote:would this work on mint 13 & ubuntu 1204

cheers


Probably more or less.
my /etc/sysctl.conf
Code: Select all
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
kernel.printk = 4 4 1 7

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Ignore ICMP broadcasts
net.ipv4.icmp_echo_ignore_broadcasts = 1
#
# Ignore bogus ICMP errors
net.ipv4.icmp_ignore_bogus_error_responses = 1
#
# Do not accept ICMP redirects (prevent MITM attacks)
net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
# The contents of /proc/<pid>/maps and smaps files are only visible to
# readers that are allowed to ptrace() the process
# sys.kernel.maps_protect = 1

#sidux tweaks
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0

net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_ecn = 0


# swap/ram tweaks
vm.vfs_cache_pressure=50
vm.swappiness=20
vm.dirty_background_ratio=10
vm.dirty_ratio=30

Debian Sid KDE4.8.4 Kernel 3.4 Thinkpad R40 CPU Pentium M 1.3MHz RAM 2GB ATI Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Giant Debian sources.list | Debian upgrade script smxi | sysinfo script inxi
craigevil
Level 5
Level 5
 
Posts: 559
Joined: Wed Sep 15, 2010 6:10 am
Location: down the rabbit hole

Re: HowTo Improve system responsiveness [tweak] (liquorix)

Postby ibm450 on Sat Jun 16, 2012 9:52 am

craigevil wrote:
ibm450 wrote:would this work on mint 13 & ubuntu 1204

cheers


Probably more or less.
my /etc/sysctl.conf
Code: Select all
# /etc/sysctl.conf - Configuration file for setting system variables
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
kernel.printk = 4 4 1 7

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Ignore ICMP broadcasts
net.ipv4.icmp_echo_ignore_broadcasts = 1
#
# Ignore bogus ICMP errors
net.ipv4.icmp_ignore_bogus_error_responses = 1
#
# Do not accept ICMP redirects (prevent MITM attacks)
net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#
# The contents of /proc/<pid>/maps and smaps files are only visible to
# readers that are allowed to ptrace() the process
# sys.kernel.maps_protect = 1

#sidux tweaks
net.core.rmem_default = 524288
net.core.rmem_max = 524288
net.core.wmem_default = 524288
net.core.wmem_max = 524288
net.ipv4.tcp_wmem = 4096 87380 524288
net.ipv4.tcp_rmem = 4096 87380 524288
net.ipv4.tcp_mem = 524288 524288 524288
net.ipv4.tcp_rfc1337 = 1
net.ipv4.ip_no_pmtu_disc = 0

net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_ecn = 0


# swap/ram tweaks
vm.vfs_cache_pressure=50
vm.swappiness=20
vm.dirty_background_ratio=10
vm.dirty_ratio=30




thankyou, and yes :mrgreen: made a notable difference to general responsiveness when opening up apps (libre, browsers and general operations)
Image
Asus UL50VT laptop ~ LM10 - Unity 12.04 - Win 7
Image
User avatar
ibm450
Level 5
Level 5
 
Posts: 604
Joined: Sun Jan 11, 2009 6:56 am
Location: Kwinana, Western Australia

Linux Mint is funded by ads and donations.
 
Next

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 3 guests