Make your ubuntu 10 times faster

Hussam Bebars hus1007 at live.com
Wed Nov 24 15:02:54 UTC 2010


*Make your ubuntu 10 times faster
*

*
*

*Source *
<http://www.networkworld.com/community/node/68739>

http://www.networkworld.com/community/node/68739


Want to speed up your Linux desktop without compiling a new kernel? You
don't need a 200-plus line patch for the Linux kernel when a couple of lines
of Bash will do the
trick<http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html>
.

A few days ago a kernel developer posted a patch to the Linux
kernel<http://www.phoronix.com/scan.php?page=article&item=linux_2637_video&num=1>that
changes the way the Linux "scheduler" works. For non-geeks, this is
the
way that the kernel hands off tasks to the CPU. This has been a topic of a
lot of debate over the years, with kernel developers proposing dueling
schedulers and sometimes storming
off<http://en.wikipedia.org/wiki/Completely_Fair_Scheduler>when their
proposal was rejected.

So there was a lot of buzz and excitement when the patch from Mike
Galbraith, clocking in around 225 lines of code, showed a dramatic
improvement in desktop latency. All is well and good that the patch works,
but it would be a long time before most Linux users would see an update. It
won't be for a few weeks before it makes it into the mainline kernel, and
six or seven months before it trickles down to users. Some users are willing
and able to recompile their kernel, or willing to install patched kernels
from third-party sources, but most users don't fall into those categories.

Turns out, users don't *have* to wait if they're willing to make a few small
modifications to their systems involving a few lines of Bash
code<http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html>added
to a system configuration file (/etc/rc.local) and a user's login file
(.bashrc). That comes from Red Hat's Lennart Poettering.

See the post on Web
Upd8<http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html>for
instructions on Fedora and Ubuntu machines. I've tried the second
method
on a machine running Linux Mint 10 (which is Ubuntu 10.10 based). In
decidedly unscientific testing, it seems to produce an improvement in
several areas — particularly when using Firefox or Chrome. I haven't yet
tried the kernel patch yet, but according to Markus
Trippelsdorf<http://lkml.org/lkml/2010/11/16/392>,
the user-space changes reduce latency more.

The immediate effect may be a speedup on the desktop for Linux users based
on Poettering or Galbraith's approach. But even better, maybe this will kick
off a new round of competing ideas on speeding up the Linux desktop.

*Source

*http://www.webupd8.org/2010/11/alternative-to-200-lines-kernel-patch.html*

To use Lennart's solution in Ubuntu (not tested - thanks to Lsh for this),
you have to replace "/sys/fs" with "/dev"*. So you would have to add the
following commands in your */etc/rc.local* (open it with: *sudo gedit
/etc/rc.local*) file,* above the "exit 0" line*:

mkdir -p /dev/cgroup/cpu
mount -t cgroup cgroup /dev/cgroup/cpu -o cpu
mkdir -m 0777 /dev/cgroup/cpu/user
echo "/usr/local/sbin/cgroup_clean" > /dev/cgroup/cpu/release_agent


and make it executable:

sudo chmod +x /etc/rc.local


And then add the following to your *~/.bashrc* file (to open it: *gedit
~/.bashrc*):

if [ "$PS1" ] ; then
   mkdir -p -m 0700 /dev/cgroup/cpu/user/$$ > /dev/null 2>&1
   echo $$ > /dev/cgroup/cpu/user/$$/tasks
   echo "1" > /dev/cgroup/cpu/user/$$/notify_on_release
fi


Run the following command:

sudo gedit /usr/local/sbin/cgroup_clean


And paste this:

#!/bin/sh
if [ "$*" != "/user" ]; then
rmdir /dev/cgroup/cpu/$*
fi


then save the file and make it executable:

sudo chmod +x /usr/local/sbin/cgroup_clean


And finally, restart the computer or manually run the /etc/rc.local file ("sudo
/etc/rc.local").



-- 
Hussam Bebars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-eg/attachments/20101124/afdae335/attachment.html>


More information about the Ubuntu-eg mailing list