How to get a more responsive system?

Asked by Uqbar

I'm running Kubuntu 9.04 desktop with kernel 2.6.28-15-generic.
Despite I have plenty of CPU power (T7500) and a reasonable amount of RAM (2GB) I cannot get a responsive KDE system.
Simple example. When I copy a DVD ISO image within the main file system or to a USB external HD, the whole system becomes unresponsive. I cannot even edit a text file with VI. HTOP is showing no more than 10% CPU usage and no more than 4% memory.
The same happens with optical media burning or a grep over huge files.
I've tried to disable as many services as possible (even sshd), I've tried LXDE, I have tried to ionice the offending process. No luck at all. Even if I switch off the whole X11+KDE I don't get any enhancement.
I've been told that I could have a buggy or poorly designed I/O chipset.
Even so I would expect the Linux kernel to cope properly with interactive processes.
On the other side, when I run PostgreSQL with my rather heavy queries I get almost server grade performances.
Is there any hint on how to get a moer responsive system? I don't mind if the non interactive applications get slowed down by 10%.
But I do care when I cannot edit source code text files.
Is there any kernel scheduler tewak I can use for this?
Many many thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Uqbar
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Have you installed video drivers?

KDE is the slowest DE but on your system should be fine.

Revision history for this message
Uqbar (uqbar) said :
#2

I'm running nvidia-180.44.
As far as I've seen so far, LXDE looks like it is the fastest. KDE is faster than GNOME but slower than XFCE.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

FLWM is lighter than LXDE but has a lot less features and doesnt look too pretty at all.

http://flwm.sourceforge.net/screenshot.png

on low endsystems it runs very well.

Revision history for this message
Uqbar (uqbar) said :
#4

Is there any relationship between the nvidia driver and the bad responsiveness?
From different sources it looks like it's only me to have this problem ...

Revision history for this message
Uqbar (uqbar) said :
#5

FLWM is a window manager (or little more). A desktop environment is closer to what I'm looking for, though.
http://www.xwinman.org/ is a rather complete list of WMs and DEs.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

What is the output of:

lspci | grep -i vga

You may be able to use the 185 driver which is a lot better, or if you fell brave the Beta 190. I use the 190 on my 6150 and it runs well.

Revision history for this message
Uqbar (uqbar) said :
#7

01:00.0 VGA compatible controller: nVidia Corporation GeForce 8600M GT (rev a1)

~$ lsmod | grep nv
nvidia 8123768 38
nvidiafb 56832 0
fb_ddc 10752 1 nvidiafb
i2c_algo_bit 15364 1 nvidiafb
vgastate 19200 1 nvidiafb

Is there any relationship between the nvidia driver and the bad responsiveness?
Is there's any, I can think about testing different drivers, even framebuffer can be OK if I get a responsive system.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

sudo apt-get install nvidia-glx-185

This will remove the 180 for you (nice). After its done, give the X server a reboot (Alt + printscrn + K)

Here is a giude for the 190 if you like:

http://www.ubuntugeek.com/howto-install-nvidia-190-25-beta-drivers-in-ubuntu-jauntyintrepidhardy.html

The nvidia range is VERY supported (albeit with proprietary drivers) so should be very nippy and responsive. You could try running:

gksudo nvidia-settings

and playinig with stuff there to see what you can achieve. Remember to write the changes to xorg.conf to make them apply to bootup and login screen.

Revision history for this message
Uqbar (uqbar) said :
#9

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package nvidia-glx-185

Revision history for this message
Uqbar (uqbar) said :
#10
Revision history for this message
Douglas Moyes (aragorn-stellimare) said :
#11

You can get a more responsive system if you recompile the kernel. Ubuntu sets options more inline with that to be used on a server, not a desktop.

Do the following:

find out what kernel version you're using with:
uname -r

Now get the headers for your current kernel with:

sudo apt-get install linux-headers-YOUR-VERSION-HERE-generic
Example: sudo apt-get install linux-headers-2.6.24-24-generic

sudo apt-get install linux-kernel-devel fakeroot kernel-wedge build-essential

Get the latest stable kernel source code from kernel.org (might as well get the latest code). Also, visit nvidia,com and get the latest kernel drivers for your video card.

Extract the files in the latest kernel archive to /usr/src

Copy the .config file from the linux-headers-*-generic folder to your kernel source folder.

Print out a hardcopy of the output of lspci, or keep a screen open with it's output.

enter your kernel source folder and type:

make menuconfig

Configure your kernel to work specifically on your processor type (AMD/Intel/VIA -- there's slight differences). This will be under "Processor type and features". Find "Timer Frequency" and set that to 1000 HZ. Find "Preemtion Model" and set it to "Preemptible Kernel (Low-Latency Desktop)"

Since we won't be using the initial ramdisk, we will need to make sure some things are build into the kernel (*) instead of compiled as a module for later inclusion (M).

Go to Device Drivers and make sure both "ATA/ATAPI/MFM/RLL support " and "Serial ATA (prod) and Parallel ATA (experimental) drivers" are checked.

Enter ATA/ATAPI/MFM/RLL support and make sure "generic ATA/ATAPI disk support", "ATA disk support" is checked if you have ATA/PATA hard drives as opposed to SATA.

In both "ATA/ATAPI/MFM/RLL support" and "Serial ATA (prod) and Parallel ATA (experimental) drivers" find your chipset, which you discovered with lspci, and select thsoe to be installed in the kernel, as opposed to being installed as a module.

Since we don't need it anymore, go to "Block Devices" and find "RAM block device support" and disable it... or change "Default number of RAM disks" to something reasonable like 2, and the default ramdisk size to something like 4096 (4 megs) instead of 64 MB.

Now, exit of of "Device Drivers", and find "File systems." Make sure ext2 and ext3 are set to be compiled into the kernel (*) instead of as a module (M), otherwise the kernel won't be able to read your hard drive.

I also like to install "Kernel .config support" and check "Enable access to .config through /proc/config.gz" in the "Generlal Setup" section so, if I ever need to recompile my kernel, I'll have a known-good .config file readily available.

Next, build a new kernel with:

sudo make && sudo make install && sudo make modules_install

Now, enter /boot/grub and edit menu.lst to add your new kernel as a boot option. Copy an existing entry, but remove the initrd line.

run grub-install hd0.

Reboot your computer, press 'e' on the boot line for your new kernel. Add 'single' at the end to boot into single user mode.

Log in using your password, and find wherever you downloaded your NVIDIA driver. Run the NVIDIA*.run file with:

sh NVIDIA-Linux-*.run

Answer it's questions, and wait for it to go.. if it looks like it hangs, it hasn't, it's just taking a while to think.

Enter mutli-user mode by issuing

init 5

You're now all done.

FYI:

some of your drives that were callled sdaN sdbN that were really IDE/ATA/PATA drives and not SATA/SCSI/SCA/USB drives will now be called hdaN hdbN, etc. You may need to edit your kernel boot line to reflect this as well as your /etc/fstab.

Revision history for this message
Uqbar (uqbar) said :
#12

Changing the nvidia drivers to 185 didn't brought any news.
A 2.5GB file copy still kills everything: editing a file is impossible as well as watching an AVI file with mplayer.
Recompiling the kernel fits well my skills and this is what makes the most sense to me.
But ... how is it possible that people claims they can work with responsive systems with Jaunty desktops like mine with stock kernels? Are they liars or is there something I'm missing?
I've chosen Jaunty 64bits desktop, not server. If what Douglas says is true, then Canonical is making some mistake in kernel module packaging ...
Anyway, I'll try the recompilation path and will post the results. Thanks so far to everyone.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#13

Then you may need the repo I gave you in the link. That has the 185 driver on.

Revision history for this message
Uqbar (uqbar) said :
#14

@Douglas: linux-kernel-devel doesn't exist!

Revision history for this message
Douglas Moyes (aragorn-stellimare) said :
#15

Spiffy, they changed the package names again. I love it when they do that...

Well, installing the development packages should put all of the required utilities you need in for compiling. Here are some other packages that you'll likely want to have installed, although many of them were likely installed as part of installing GCC on your system:

binutils
bzip2
coreutils
fileutils
libncurses-dev
ncurses-dev
kernel-package
libqt3-dev
gcc
make

Also, installing nasm and bin86 would be a good idea.

Revision history for this message
Uqbar (uqbar) said :
#16

I've done the compilation but have not installed (and run) the kernel yet.
This because I'm wondering whether there's something wrong in all this and because I'd like to review the configuration choices (which are a lot).
I mean, I installed Kubuntu desktop. Why on earth I'm not running a desktop-oriented kernel?
Why should I recompile the kernel myself if I chose a packaged distribution?
If I installed a server edition, then I would understand. But this is supposed to be a desktop distribution!
Moreover, in cazse of kernel version advancement I should re-do everything again!
On the other hand I could take the decision (and the risks) for a LinuxFromScratch.ORG approach!

@Douglas. Almost all those tools are either useless for the kernel compilation or are already installed by default,

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#17

Purely because you want a "more responsive system". The stock kernel will work but Linux is VERY flexible unlike windows which has no where near the configuration or customization of Linux.

With Linux and the apps in the distribution yuo can compile and configure the software exactly as you wish. You could compile zsnes to not have sound if you so fancied or you could take half the functionality out of gedit if you wanted to to make it more compact and closer to your needs.

Windows has nothing like tis as it is closed source so you buy the OS and have to live with what you are given.

So in reply to the kernel compilation question, the Ubuntu kernel is compiled to be as all encapsulating as it can. Ubuntu compared to many other distros is not hugely fst and could easily be optomised but most Ubuntu users are new to Linux and want a system that works. As they develop a familiarity with the OS they start optomising and wil be compiling kernels to get a better system.

Revision history for this message
Uqbar (uqbar) said :
#18

Responsiveness is among the few things that differentiate a "server" kernel from a "desktop" one.
Of course the stock kernel works. But it's unsuitable, IMHO, for a desktop.
I would say the reverse. If you have a desktop and you really need a workhorse kernel, then you have to recompile it.
But if you choose desktop, it should have a desktop profile.
I could agree when they squeeze as many things as possible inside a stock kernel.
But the (I/O) scheduler policy (and thus the responsiveness) is compile time, AFAIK. And this makes th stock kernel not really suitable as a desktop kernel.
This is not optimisation. This is user profile. IMHO.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#19

or system settings. You could try a lighter DE. Ditch gnome / metacity (and definately NOT compiz) and switch to LXDE or fluxbox which is made to be fast and responsive. Here is a screenshot of both:

LXDE:
http://upload.wikimedia.org/wikipedia/commons/4/4c/LXDE_desktop_full.png

Fluxbox:
http://damnsmalllinux.org/dsl-2.0RC2-fluxbox.jpg

I personally use LXDE but there are better choices for DE /. WM if you like a faster system

Revision history for this message
Uqbar (uqbar) said :
#20

I already tried both LXDE and XFCE. But the problem seems to be in the scheduler: I've also tried to switch completely off the GUI (sudo /etc/init.d/kdm stop) and the run the file copy and the VI on the console.
Again, I think there's a major misunderstanding on the meaning of "desktop" distribution. Maybe "general purpose" would be better also because the kernel itself is labelled as "generic" and not "desktop".

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#21

It is a "desktop" system as there is a Desktop UI. The server is a server system and NOT a desktop as there is no desktop UI, only command line and web interfaces. yes it is possible to install a desktop on the server release but this is generally not advised as there are reasons the server release does not come with a desktop b default. You could label every single OS "general purpose", it is very ambiguous.

If you believe there is an issue with the scheduler then I suggest you log a bug so that the developers can investigate.

Revision history for this message
Uqbar (uqbar) said :
#22

I don't think it's a bug.
Simply, the compile-time kernel options of a desktop distribution looks not suitable for a desktop usage.
And the re-compilation of the kernel is risky as both the .config and the possible patchset applied by the packager seems not to be publicly available. Thus the possibility to break something is high as it is the amount of work needed to do it.
So, for what I undesrtand so far, there's no solution (definitive) to my question. Only a possible workaround (to be re-applied at every kernel upgrade).

Revision history for this message
Douglas Moyes (aragorn-stellimare) said :
#23

If you want to speed up drive access, you can remove "realtime" from /etc/fstab -- however, you better be sure to shut down your system properly! If removing realtime leaves a blank column in fstab, add "default" in it's place.

I'd keep "realtime" in place till you are sure your new kernel is stable and working properly for you.

The compilation options I told you to use for your kernel will actually give you a more responsive system that Windows or Mac OS X. By responsive, in this case, it means it'll respond to user input before any other event. That means no stop-and-go mouse movements on high load, but don't expect your windows to pop-up right away.

Another trick I like to use is rencie. Setting a high priority (lower/less nice value) to X11 will allow it to respond faster than other parts of your system. Other apps you don't care too much about, you can give them a lower priority using renice.

I've done this a few times, it works pretty well, but often the hassle isn't worth it.

Some Window Managers allow you to set an option to use pretty effects. In Gonme, you'll find these under Preferences >Appearance > Visual Effects (tab). If you want your system to respond like Windows Vista, select "Extra", if not, select "None" :D

I love FVWM... it was my first window manager on Slackware... it doesn't work too well with my dual displays being on separate X servers... sniff..

Revision history for this message
Uqbar (uqbar) said :
#24

I think the core of my issue is the kernel.
When I switch off X11 and KDE I still get the low responsiveness.
Is there any repository with a responsive amd64 kernel than can be used to replace the stock "-generic" kernel?
I am still in troubles in choosing the correct configuration parameters in the kernel for the recompilation.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#25

The -generic kernel is 64bit, Ubuntu strives to work on the most systems possible so has a tonne of fluff compiled into the kernel to maximise possible audience compatiility.

Unfortunately you will have to websearch for what you need and do not need and compile approriately.

Revision history for this message
Uqbar (uqbar) said :
#26

There's no way to have an official desktop-oriented kernel for Ubuntu. That's it.