Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"my system is slower than it should be" Tip-Thread
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Tue Jul 27, 2004 8:11 pm    Post subject: "my system is slower than it should be" Tip-Thread Reply with quote

Hello,

many people are asking again and again why their system is too slow.
The first answers to such requests are nearly the same all the time and I never saw a generic thread about this topic here.

This is the reason why I want to collect possible reasons for a system being too slow, so that people can check them through, if they have problems.
Everyone is encouraged to post own suggestions here.

I'll start with the two tips, that are given most often:

Check for DMA-Mode
DMA means that data is transfered directly between RAM and harddisk without using the CPU too much.
A system is really slow when it doesn't work, what can happen if you hardware is too old, your chipset isn't supported or you have the wrong driver in your kernel.

To check for DMA-Mode, use this command:
hdparm -i /dev/hda
(if you want to check other disks, you have to change the part /dev/hda that it is fitting)
The command will print something out like:
Quote:

/dev/hda:

Model=ST3160023A, FwRev=3.06, SerialNo=3JS2C74Y
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
AdvancedPM=no WriteCache=enabled
Drive conforms to: ATA/ATAPI-6 T13 1410D revision 2:

* signifies the current active mode


Important is the line
Quote:

UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5

The * shows that I've UDMA5 enabled.
If you have the * two lines above beside one of the pio modes, your system has a good reason for being slow.

Checking your /etc/hosts if KDE is slow
The file /etc/hosts is used to resolve adressnames to IP-addresses.
If you are not working in a network, two lines are enough for a good configuration.
If they are missing or wrong, KDE needs long to resolve adresses, what can significantly slow down your Desktop.

Your /etc/hosts is okay when it looks like that:

Code:

127.0.0.1       localhost
192.168.2.4     name.domain     name


You can choose what you want for name and domain.


That's it from me, I hope many posts will follow.


Last edited by Jinidog on Tue Jul 27, 2004 10:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
kaloyer
n00b
n00b


Joined: 16 Jul 2004
Posts: 13

PostPosted: Tue Jul 27, 2004 10:28 pm    Post subject: Reply with quote

This is a good resource. Keep it up! :D

My Tip:

Edit /etc/conf.d/rc

Edit the following line:
Code:

RC_PARALLEL_STARTUP="no"

change it to
Code:

RC_PARALLEL_STARTUP="yes"


that allows multiple services to start at once.
_________________
Gentoo is the ONLY linux distribution that met every one of my ridiculous demands.

Gentoo's Adopt an Unanswered Post Initiative
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Tue Jul 27, 2004 11:07 pm    Post subject: Reply with quote

To the post above:
As I know parallel startup only works with processes that a started at bootime, but normally most of them are listed in the bootlevel default.
You can check this with the command rc-update -s .
Moving some processes in the boot-bootlevel helps, but it also might cause problems.
This is the (shortened) ut of my rc-update -s (and it works :) ):

Quote:

acpid |
alsasound | boot
bootmisc | boot
checkfs | boot
checkroot | boot
clock | boot
consolefont | boot
cupsd | default
distccd | boot
domainname | boot
hdparm | boot
hostname | boot
hotplug | boot
keymaps | boot
local | default nonetwork
localmount | boot
modules | boot
mysql |
net.eth0 | default
net.eth1 | default
net.lo | boot
netmount | default
nfs | boot
ntp-client | default
rmnologin | boot
samba | default
serial | boot
syslog-ng | default
urandom | boot
xdm | default
xfs | default


Use prelink
Prelinking is a featuere that does something with your shared libraries.
I don't pretend to have completly understand it, but it links files together staticly, what normaly is done in runtime when you call a program.
So it CAN improve startup-times, but it needn't.
(indeed I never notice a speedup, but others does)

Prelinking is a possibilty to speed up, it won't help you if your system is slow because of misconfiguration.

For using prelinking read the guide in http://www.gentoo.org/doc/en/prelink-howto.xml .
_________________
Just unused Microsoft-Software is good Microsoft-Software
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Tue Jul 27, 2004 11:37 pm    Post subject: Reply with quote

Use 2.6 Kernels
When you system feels a little bit slow in responsetimes, it might help to switch to the 2.6 Kernel series. (if you haven't already)
Beside other features it uses a new (better) CPU-scheduler, which can split the CPU-power better between the tasks that has do be done.
A full occupied system was a little bit slow with drawing windows and menues when I used the 2.4 Kernel, after switching I never notice any slowdown in my normal work, even if there are several compiles running in the background.

Switching costs some time because you might have to reconfigure some parts of your system (perhaps alsa), but it's doable quite easy.

Just make sure that you compile in devfs and pty.

If you don't know what kernel to emerge, use the gentoo-dev-sources.
They are stable and are using the gentoo-patchsets, which give a good performance.

Kernel-Option
Check Preemptible Kernel in the processor-feature site of menuconfig. It should make the system running smother as it allows the kernel to stop system-calls and continue with them later. (this improves responsivness)

I have heard of this causing trouble, so keep a kernel backup.

Kernel-Option
Make sure that MTRR (Memory Type Range Register) support is checked in the processor-feature site of menuconfig.
I don't know what this does (somebody might explain) but it slows down your system if it is not checked.
I haven't heard of getting into trouble using this option.

bennettp was so nice to explain this option:
Quote:

When used with your videocard, it allows multiple write operactions to be combined into one transfer, and then bursted over the agp (or pci) bus.

Basically, it speeds up your graphics a lot (2.5x or more). In fact, IIRC, the nvidia kernel drivers fail to compile if this is not enabled.

see Documentation/mtrr.txt (in the kernel docs) for more info.


EVIL: Use your own CFLAGS for the kernel
Some guys might blame me for giving this tip, but I'm using it and haven't run into problems on four PCs.

Normaly the kernel is compiled with very conservative CFLAGS and the CFLAGS in the make.conf are ignored.
If you use the enviromnent-variable CFLAGS_KERNEL, you use your own CFLAGS.
Do that by typing in this command each time you compile your kernel:
Quote:
export CFLAGS_KERNEL="<YOUR CFLAGS>"


Keep an update of your kernel ready for the case that this causes problems.


Little Helper
I've mentioned much about the kernel above.
If you have to compile the kernel often, then you will get tired of typing in the same commands over and over again.

The following command helps because it does things you normaly do with seperate commands.
It will call make and copy the new kernel to /boot/vmlinuz.
Before that it makes a backup of the old vmlinuz (if there is one name like that) and saves it in boot with a timestamp appended to the filename.


Quote:

make && make modules_install install

_________________
Just unused Microsoft-Software is good Microsoft-Software


Last edited by Jinidog on Thu Jul 29, 2004 8:13 pm; edited 3 times in total
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Wed Jul 28, 2004 11:06 am    Post subject: Reply with quote

Make sure, that net.lo has started
This goes onto the same direction as checking your /etc/hosts.
If net.lo isn't started, it can slowdown KDE.
You can check with rc-update -s wether it is loaded at a runlevel.
If it is not, add it to one.

Make sure that iftables don't block
If you are working with iptables a misconfiguration can cause that packets send to net.lo are dropped.
This can make KDE very slow, too.
When you don't know, what iptables are, you probably haven't installed them.
They are a kernelfeature that supports routing and firewall-functions.
You can check if they are installed and loaded again with rc-update -s | grep iptables .

CFLAGS
Again and again there is the topic about CFLAGS and CXXFLAGS.
CFLAGS are options that the compiler uses when it compiles a C-program (CXXFLAGS for C++).
The gcc-compiler supports various optimizations which you can access via CFLAGS.
I won't give any CFLAGS-recommandations here as it is a very difficult topic and is discussed again and again in this forum.
So, if you are new to this topic or want to know you did it right, search for your processor-typ together with CFLAGS.
You should get many hits.[/b]
_________________
Just unused Microsoft-Software is good Microsoft-Software
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Thu Jul 29, 2004 4:10 pm    Post subject: Reply with quote

Are there no other tips and tricks out there?
I hoped to read about some tricks I don't know.

If you know something but don't want to write an essay about it, send me a message with only a short description, I will post it in here as most understandable as I can make it.
_________________
Just unused Microsoft-Software is good Microsoft-Software
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Thu Jul 29, 2004 4:29 pm    Post subject: Reply with quote

Jinidog wrote:

Kernel-Option
Make sure that MTRR (Memory Type Range Register) support is checked in the processor-feature site of menuconfig.
I don't know what this does (somebody might explain) but it slows down your system if it is not checked.
I haven't heard of getting into trouble using this option.

When used with your videocard, it allows multiple write operactions to be combined into one transfer, and then bursted over the agp (or pci) bus.

Basically, it speeds up your graphics a lot (2.5x or more). In fact, IIRC, the nvidia kernel drivers fail to compile if this is not enabled.

see Documentation/mtrr.txt (in the kernel docs) for more info.
Back to top
View user's profile Send private message
Kioshen
Tux's lil' helper
Tux's lil' helper


Joined: 23 Sep 2003
Posts: 109
Location: Montreal, PQ

PostPosted: Thu Jul 29, 2004 5:37 pm    Post subject: Reply with quote

As for your little helper, it has been already impletented in the 2.6 kernel

Code:

make && make modules_install install


It will compile all that there is to do and will the current kernel as vmlinuz-<kernel-ver> and do a symlink as vmlinuz. If you have already this one up it will mv the old one as vmlinuz-xxx.old and make the new kernel as vmlinuz. It does the same thing for .config and System.Map.
_________________
-= United we share =-

Adopt an unanswered post today!
Why emerge -U will kill your Gentoo
Back to top
View user's profile Send private message
radonsg
Apprentice
Apprentice


Joined: 26 Jun 2004
Posts: 257
Location: Singapore

PostPosted: Thu Jul 29, 2004 6:36 pm    Post subject: Reply with quote

try running reiserfs or xfs instead of ext2/3 cos the former 2 offer better performance.
_________________
Athlon64 3000+ on a MSI Neo2 Platinum (nVidia nForce3)
1 Sata Hitachi (HGST) 7K250
1 Sata Samsung SpinPoint
2 x 512MB TwinMos DDR400 Dual Channel
Geforce 5200
Back to top
View user's profile Send private message
neurolabs
n00b
n00b


Joined: 16 Apr 2003
Posts: 13

PostPosted: Thu Jul 29, 2004 7:10 pm    Post subject: Reply with quote

if you have slow startup times only under x, your font cache might be broken/missing. A simple call of fc-cache fixes this. In a normal setup this is done automatically though...
Back to top
View user's profile Send private message
RealNitro
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2004
Posts: 98

PostPosted: Thu Jul 29, 2004 7:15 pm    Post subject: Re: "my system is slower than it should be" Tip-Th Reply with quote

Jinidog wrote:
Check for DMA-Mode
DMA means that data is transfered directly between RAM and harddisk without using the CPU too much.
A system is really slow when it doesn't work, what can happen if you hardware is too old, your chipset isn't supported or you have the wrong driver in your kernel.

To check for DMA-Mode, use this command:
hdparm -i /dev/hda

What is the command for SCSI devices? I have a SATA hd, and I would like to see how fast it is. (chipset: ICH5, the hd is sda)
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Thu Jul 29, 2004 7:33 pm    Post subject: Reply with quote

I'll collect your tricks and post it with your nickname in the first post.

Please post no questions here or start a long discussion, this blows up the thread so that nobody wants to read it in the end.
If you have questions, make a new thread somewhere else.
_________________
Just unused Microsoft-Software is good Microsoft-Software
Back to top
View user's profile Send private message
regeya
Apprentice
Apprentice


Joined: 28 Jul 2002
Posts: 270
Location: Desoto, IL, USA

PostPosted: Thu Jul 29, 2004 8:51 pm    Post subject: Reply with quote

If you use ext3 and have large directories (or at least dirs with lots of small files)

Code:

tune2fs -O dir_index /dev/hdXX


This enables btree hash dirs, which gives a significant performance boost when dealing with large numbers of small files.

And if you want to go ahead and "optimize" your old directories on those ext3 partitions, umount the partition (you might need to boot from a LiveCD or something) and do:

Code:

fsck -fvDy /dev/hdXX


I've done it, and I lost the bug to switch to reiser. 8)


Last edited by regeya on Fri Jul 30, 2004 1:42 am; edited 1 time in total
Back to top
View user's profile Send private message
Jinidog
Guru
Guru


Joined: 26 Nov 2003
Posts: 593
Location: Berlin

PostPosted: Thu Jul 29, 2004 9:01 pm    Post subject: Reply with quote

Do you mind to explain, what your tip does?
_________________
Just unused Microsoft-Software is good Microsoft-Software
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


Joined: 24 Apr 2003
Posts: 416
Location: @ ~

PostPosted: Thu Jul 29, 2004 9:56 pm    Post subject: Reply with quote

Schedual cron jobs for a better time. This one is for those late night freaks like me, who happen to be awake at 12:00 AM when the cron job would normally go off. So I set my nightly jobs to go off at 4:00. Edit /etc/crontab.
Code:
0  *  * * *     root    rm -f /var/spool/cron/lastrun/cron.hourly
1  4  * * *     root    rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6     root    rm -f /var/spool/cron/lastrun/cron.weekly
30 4  1 * *     root    rm -f /var/spool/cron/lastrun/cron.monthly
*  *  * * *     root    test -x /usr/sbin/run-crons && /usr/sbin/run-crons

_________________
jabber: MighMoS@jabber.org

localhost # export HOME=`which heart`
Back to top
View user's profile Send private message
mike4148
l33t
l33t


Joined: 09 Sep 2003
Posts: 641

PostPosted: Fri Jul 30, 2004 12:56 am    Post subject: Reply with quote

Quote:
What is the command for SCSI devices? I have a SATA hd, and I would like to see how fast it is. (chipset: ICH5, the hd is sda)

Same one. hdparm will test anything, but it only lets you tweak IDE HDs.
Back to top
View user's profile Send private message
RealNitro
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jul 2004
Posts: 98

PostPosted: Fri Jul 30, 2004 8:21 am    Post subject: Reply with quote

mike4148 wrote:
Quote:
What is the command for SCSI devices? I have a SATA hd, and I would like to see how fast it is. (chipset: ICH5, the hd is sda)

Same one. hdparm will test anything, but it only lets you tweak IDE HDs.

Code:
root@dell jens # hdparm -d /dev/sda
 
/dev/sda:
 operation not supported on SCSI disks
root@dell jens # hdparm -I /dev/sda
 
/dev/sda:
 operation not supported on SCSI disks
root@dell jens # hdparm -Q /dev/sda
 
/dev/sda:
 operation not supported on SCSI disks
root@dell jens # hdparm -i /dev/sda
 
/dev/sda:
 operation not supported on SCSI disks

The only thing that gives me a result is:
Code:
root@dell jens # hdparm /dev/sda
 
/dev/sda:
 readonly     =  0 (off)
 geometry     = 14589/255/63, sectors = 234375000, start = 0
Back to top
View user's profile Send private message
castorilo
Apprentice
Apprentice


Joined: 25 Dec 2002
Posts: 157

PostPosted: Mon Aug 02, 2004 12:16 am    Post subject: Reply with quote

I made a patch that improves boot times by avoiding running modules-update

Get it here
Back to top
View user's profile Send private message
BlindSpy
Apprentice
Apprentice


Joined: 20 Mar 2004
Posts: 263

PostPosted: Mon Aug 02, 2004 3:29 pm    Post subject: Reply with quote

1. Check /usr/portage/distfiles. You can delete everything in there as long as your not doing an emerge at the time.

2. Also, check out the cruft cleaner:
https://forums.gentoo.org/viewtopic.php?t=152618

That can clean your system up quite a bit too.

3. Something else I do to clean my system is '# emerge -av depclean' to clean up all the unneaded dependancies. After that run '# revdep-rebuild' to rebuild anything that depclean may have broken.
_________________
Symlinks to:
xorg.conf
Back to top
View user's profile Send private message
GenKreton
l33t
l33t


Joined: 20 Sep 2003
Posts: 828
Location: Cambridge, MA

PostPosted: Mon Dec 20, 2004 6:43 pm    Post subject: Reply with quote

regeya wrote:
If you use ext3 and have large directories (or at least dirs with lots of small files)

Code:

tune2fs -O dir_index /dev/hdXX


This enables btree hash dirs, which gives a significant performance boost when dealing with large numbers of small files.

And if you want to go ahead and "optimize" your old directories on those ext3 partitions, umount the partition (you might need to boot from a LiveCD or something) and do:

Code:

fsck -fvDy /dev/hdXX


I've done it, and I lost the bug to switch to reiser. 8)


This is an old thread but i recently stumbled across it and saw this trick posted.

Are there any reasons not to do this? I saw problems with corruptions in earlier kernels, are these all fixed now? Is there anything I should know before I try this?
Back to top
View user's profile Send private message
ahubu
Guru
Guru


Joined: 16 Aug 2003
Posts: 400
Location: Groningen, The Netherlands

PostPosted: Sun Jan 16, 2005 2:49 am    Post subject: Reply with quote

Well, I recently found out something NOT to do: changing your user nice value hard limit to -19. Reluctant to speed up my computer as I was, I was fiddling with these limits in /etc/security/limits.conf

Code:
myuser             soft    priority        -5
myuser             hard    priority        -19


Now, all your users processes will be started with priority -19, the highest. BAD THING, even a single browserclick will make movies stutter, games will slow down to a crawl (Americas army becomes unplayable, especially in the menus).

Anyway, what DID help was changing the hard priority back to 0, and soft to -19 (so you can make a process more important if you want to, not all the time):

Code:
myuser             soft    priority        -19
myuser             hard    priority        0


There, all responsive again :) took me a while to figure it out as I changed the value a while ago and didn't immediately mention the slowdown. Anyway, the -19 soft setting is not standard, but I think it's very useful.
Back to top
View user's profile Send private message
jamiethehutt
n00b
n00b


Joined: 04 Oct 2004
Posts: 66
Location: Scotland!

PostPosted: Sat Jan 22, 2005 3:57 pm    Post subject: Reply with quote

paulpach wrote:
I made a patch that improves boot times by avoiding running modules-update

Get it here

Erm I'm a little stuck as to what to do with this patch, I'd love to use it as modules-update is a good few seconds on my otherwise fast boot but I'm not sure how to apply it. Have I missed some documentation some place that covers this? :oops:
_________________
"Someday, he thought, it'll be mandatory that we all sell the McDonald's hamburger as well as buy it; we'll sell it back and forth to each other forever from our living rooms. That way we won't even have to go outside." - A Scanner Darkly By PK Dick
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Sat Jan 22, 2005 10:36 pm    Post subject: Reply with quote

Reiser4 :P
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
ahubu
Guru
Guru


Joined: 16 Aug 2003
Posts: 400
Location: Groningen, The Netherlands

PostPosted: Sat Jan 22, 2005 10:55 pm    Post subject: Reply with quote

If you find that emerge is getting slower (i.e. calculating dependencies), you might want to consider putting the portage tree on its own partition.

Anyway you probably have way too many packages installed! :twisted:

You als might want to check your worldfile for redundant packages (packages that already are dependancy of another package).

There are some great scripts for that actually.
_________________
Anne // Light travels faster than sound. That's why people appear bright until
you hear them speak.
-Unknown
Back to top
View user's profile Send private message
z4Rilla
Apprentice
Apprentice


Joined: 22 Dec 2003
Posts: 291
Location: EU

PostPosted: Sun Feb 06, 2005 6:11 pm    Post subject: Reply with quote

kaloyer wrote:
This is a good resource. Keep it up! :D

My Tip:

Edit /etc/conf.d/rc

Edit the following line:
Code:

RC_PARALLEL_STARTUP="no"

change it to
Code:

RC_PARALLEL_STARTUP="yes"


that allows multiple services to start at once.


doesnt work for me... eth0 tries to start twice
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum