Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Flying with gentoo
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 741
Location: Barcelona, Spain

PostPosted: Fri Oct 01, 2004 3:14 pm    Post subject: [HOWTO] Flying with gentoo Reply with quote

HOW TO OPTIMIZE AND ACCELERATE YOUR SYSTEM
also known as how to fly with gentoo

This is guide is a sum of a lot of posts here in the forum and some investigations i have done in my boxes by trying out several programs and options. Some of them are completely safe, but some other could damage your system. Please make backups of your important data, try this guide in testing boxes, and then move the optimizations to the production boxes.
This improvements will obviously have a greater effect on a old computer, if you have a very good computer this will have a minor impact, as your system should already be pretty fast ;)

INDEX
    0. How to make tests without being in danger
    1. Optimization of the init scripts
    2. Using rc-update
    3. Cflags and ldflags
    4. Using hdparm
    5. Should you.. prelink?
    6. Managing the Swap
    7. Ccache
    8. Distcc
    9. USE's
    10. Modifying ebuilds and injecting packages
    11. Halt vs Suspend
    12. Xdelta - Deltup
    13. NPTL
    14. GCC
    15. Filesystems [data safety vs speed]
    16. i/o and tasks schedulers
    17. Useful Scripts

18. New tips


0. How to make tests without being in danger

To test new ebuilds and try new configurations I did an instalation inside a chroot to be completely safe. There's is a guide HERE to make a similar thing, and be able to test this howto without damaging your system. You could also use vmware or uml, but this seems a fastest way.
Once I did the chroot install, I made a compressed image, so that everytime I broke the sub-system with my tests i can extract it and go on testing with a new installed system (and my system keeps clean).

1. Optimization of the init scripts

Some of the operations performed when you boot the system are not always needed. Let's modify the scripts so that we only do them if they are really needed.

/etc/init.d/modules

change:

Code:
ebegin "Calculating module dependencies"
    /sbin/modules-update &>/dev/null
eend $? "Failed to calculate dependencies"

for:
Code:
if [ /etc/modules.d -nt /etc/modules.conf ]
    then
        ebegin "Calculating module dependencies"
        /sbin/modules-update &>/dev/null
        eend $? "Failed to calculate dependencies"
    else
        einfo "Module dependencies are up-to-date"
fi

Doing this, modules-update will only run if it´s really needed because you made changes in the system.

/etc/init.d/localmount

change:
Code:
mount -at nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null

for:
Code:
mount -aFt nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null

The will start all the local mounts at the same moment, not one after the other.

/etc/init.d/bootmisc

change:
Code:
if [ -x /sbin/env-update.sh ]
then

    ebegin "Updating environment"
    /sbin/env-update.sh >/dev/null
    eend 0
fi

for:
Code:
if [ -x /sbin/env-update.sh ]
then
    if [ /etc/env.d -nt /etc/profile.env ]
    then
        ebegin "Updating environment"
        /sbin/env-update.sh >/dev/null
        eend 0
    else
        einfo "Environment up-to-date"
    fi
fi

Doing this, env-update will only run if it´s really needed because you made changes in the system.

/etc/conf.d/rc

change:
Code:
RC_PARALLEL_STARTUP="no"

for:
Code:
RC_PARALLEL_STARTUP="yes"


This will start all the services at the same moment, not one after the other.

note: could some devel explain if this tweaks are dangeorus, and if not why they are not in portage by default?


2. Using rc-update

Managing the runlevels is very easy thanks to rc-update, that makes easy this job:

to see how we have currently configured the boot runlevels:
Code:
# rc-update show


to remove a service from the system start:
Code:
# rc-update del aplicacion runlevel

note: change runlevel for boot or default (you could also create more), if you omit the runlevel it will search in all of them and remove the service.

to add an application:
Code:
# rc-update add application runlevel


I have some service in the boot runlevel and some in the default runlevel, please note that some services need to be started after some other (this means that some services depends on some other.

You can check the depends editing the /etc/init.d/service file and checking the first lines, where the depends are declared. For example, if you want to start sshd, you will need the net services started before.

I have recently created a new runlevel (battery) where i added all i want to have running when i don´t have AC. Then, with acpid's help I configured the runlevel so that when i unplug the AC, it changes to battery runlevel, and the when i plug it again it gets back to default runlevel. This way, when I switch to the battery level i use speedfreq, hdparm and iwconfig to reduce the power consumption of the hardisk, the wireless card and the processor.

You can check the actual runlevel using rc-status:
Code:
# rc-status
Runlevel: battery
acpid                                          started
alsasound                                      started
domainname                                     started
gpm                                            started
hdparm.battery                                 started
local                                          started
metalog                                        started
speedfreq.battery                              started
vixie-cron                                     started
wireless.baterry                               started


more information about the RC- HERE.

For those who boot directly into X (xdm, gdm, kdm,..) i have read that you can put xdm and it's dependencies in boot runlevel, so that it will load X while loading the rest of services in the background. If someone have this running please comment so that the rest can use it.

3. cflags and ldflags

CFLAGS (you can set them at /etc/make.conf) are parameters we pass to gcc when we compile a package when emerging it. You can be more or less risky here, in THIS webpage and THIS one there is a lot of info on recommended configurations for CFLAGS. My CFLAGS for my pentium4 box are the following:

Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer"


note: cflags changed a little bit in gcc 3.4.X and -mcpu is deprecated, you should use -mtune instead. Moreover, pentium-m is accepted for centrino laptops. The CFLAGS of my centrino laptop are the following:
Code:
CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer -ffast-math -momit-leaf-frame-pointers"


As for the CXXFLAGS, -fvisibility-inlines-hidden has been reported as a good flag to improve the C++ compiles (thx teutzz).
Frepo has also been reported as a good cxxflag, but it does not perform very well on my system.

The ldflags are also interesting, they are discussed HERE and HERE. Ldflags are optimizations for the dinamyc loader (ld), so it's more or less the same way prelink would go. I am using them already and didn't have any problem when emerging new packages:
Code:
LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s"

Something more "stable" would be
Code:
LDFLAGS="-Wl,-O1"

note: those in the ldflags are "L", not "1" (in the -W)
note: some users reported errors using ldflags, if you have problems compiling a package try to remove them (and post ldflags/package in this thread).

NOTE: Cflags and Ldflags are and will be always a subject in which everybody has his opinion. The best way is to test them yourself, do somebenchmarks, and keep the flags you find optimal for your system. Also check the differents posts in the forums talking about this so that you can get an idea. A useful program to determine what cflags you should use, is ACOVEA (already in portage), which is a benchmarking tool that will do several tests on your machine (the standard test will run for more than 15 hours) to help you pick the best cflags for your machine. See THIS thread for acovea scripts and results.

4. Using hdparm

Another important application is hdparm. It allows us to configure our hard disk parameters, so get the maximum performance:

Code:
# emerge hdparm
# rc-update add hdparm default

See /etc/conf.d/hdparm

see actual configuration:
Code:
# hdparm -i /dev/hda


testing the speed:
Code:
# hdparm -Tt /dev/hda


In my computer I modifified /etc/conf.d/hdparm to get the maximum of my hard disk:
Code:
hda_args="-d1 -X69 -c1"
cdrom0_args="-d1"


If you need more information the man page is pretty good
Code:
# man hdparm

Also check THIS for a little tutorial.

5. Should you.. prelink?

Prelink is a powerful application, it allows us to pre-link the libraries needed for a binary before using it. So instead of looking for which libraries the binary will need when we launch it, prelink will modify the binary addind a little descriptions of the libs it nees to run. This get rid of the search for shared libraries everytime we launch the binary, so it makes it faster.
Important: Everytime that you upgrade the libraries that are needed for the binaries, (for example glibc) you have to re-run prelink on the system.

This is a little optimization that we will thank when launching big applications like KDE (moreover, if you prelink your system KDE will not need to launch kdeinit, so it will also run faster). The little binaries are already pretty fast, so will not appreciate the difference.

Requirements: it is a must to have compiled the binaries with binutils-2.13.90.0.xx and gcc-3.2 or higher, and also have installed glibc-2.3.1-r2 or higher. The size of the binaries will be bigger with prelink, and to run the process you need enough free space on the hard disk.

Way to go:
Code:
# emerge prelink

Find config file at /etc/prelink.conf
Code:
# prelink -afmR

This is the common use of prelink, that will prelink ALL the binaries, and also will look if the binaries were already prelinked, and prelink them again if needed.

It is possible that you get some errors when running prelink, because some binaries can not be prelinked (the ones compressed with upx, for example).

More information HERE, and/or man prelink.

6. Managing the swap

In this section I just wanted to mention some things that can help us.
First of all, if you have two harddisks it is better to put the swap partition on the second disk (having the root partition in the first one) as this will improve the read/write times.

Also you should NOT use a file as swap. I tried it once in an old computer, deleted the swap partition and set a file as ./swap of 256 MB.¡ and modified fstab. This method is slower, as it has to find the file, open the file, find were it was writting to it, writte to it, save, and close the
file. With a partition in the disc this process is pretty much faster.

Another concept to know about is swappiness (kernel 2.6+). When an application needs memory and the RAM is full, there are two options: or the RAM gets empties a little bit cleaning out old used memory, or swap memory gets used (slower than ram). In the new kernels, you can set a variable to define if the kernel should empty some ram or use the swap partition.

/etc/sysctl.conf
Code:
vm.swappiness = 40

This value can be between 0 and 100. Close to 0 will mean that the kernel should empty some ram, and a higher value close to 100 will tell the kernel to use the swap memory more often.
The default value is 60. I set this to 25 in my laptop, so that i can reduce the disk access. You can use ´free -m´ to see the stats of your memory useage.

7. Ccache

ccache is an application (included en portage and on by default when emerging (if you emerge ccache)) that acts as a cache for the compiler.
With this little prog we will be able to compile in a faster way when compiling packages, specially with the big make's (you could think that using a cache when compiling has no use, but it speeds up some instructions like the make clean)

Just emerge it and set the default cache size (read the einfo after the emerge), and it will be on by default. You can check it with:
Code:
# emerge info | grep ccache
ccache version 2.3 [enabled]

You can check the ccache stats by doing:
Code:
# ccache -s


8. Distcc

distcc is an application that will make our life easier when installing gentoo in several computers, or if our computer is very slow but have another fast computer. It can be combined with ccache, optimizing the compiling time. I won't explaint this
feature a lot, because it's not used by everyone. Just that you know about it, because you can use cross-compiling with different computers with different processors, they will just share the compiling tasks.

More information HERE.

9. USE's

The USE flags are a useful tool that gentoo provides us with to configure our packages as we want them.

For example, imagine that you want to compile apache:
Code:
# emerge -pv apache
[ebuild N ] net-www/apache-2.0.50 -debug -doc -ipv6 +ssl 6,197 kB

The (+/-) options that appear after the name of the program we are going to install (-v flag) are the USE vars we can use to configure the package we are installing. If, for example, we don't want our apache to use ssl, we can do this:
Code:
# USE="-ssl" emerge -pv apache
[ebuild N ] net-www/apache-2.0.50 -debug -doc -ipv6 -ssl 6,197 kB

We can see that ssl is now off, and apache won't be compiled with ssl support.

In this example we set the USE var directly on the propmt, but this is not the correct way to do it if you want the system to remember the USE flags everytime you compile that package. You can set your USE flags in the /etc/make.conf file, or also use /etc/portage/package.use to set them for
individual packages.

It is the same for the "x86" flag (to tell portage to use the latest version available of every package), it's not recommended to just set the flag on the prompt, you should set it on /etc/make.conf to use it for all the packages, or set it individually:
Code:
# echo "app-editors/nano ~x86" >> /etc/portage/package.keywords


It is important to take a look at the USE flags of the packages before installing them, so that we can turn off features we won't be needing saving space and sometimes dependencies.
For example, if we want to emerge the console irc client BitchX, portage want to install xmms, X, and some other dependencies that could be useless for some of us. Setting -xxms and -X for xmms in the /etc/portage/package.use will allow us to install BitchX without the xmms and X support, and we won't need to install all those packages.

You can see that this is a powerful tool to use when emerging, it gives us a lot of control of how the packages will be installed in our system.

You have a little description of the USE flags in /usr/portage/profiles/use.desc

10. Modifying ebuilds and injecting packages

Always keep a backup of your files before modifying them (also note that emerge sync will fix if you mess an ebuild).

¿What's injecting a package and what's the use of it?
Remember that time when you wanted to install package X, and as a dependency portage asked to install package Y? For example, a lot of users manage the kernel manually instead of using portage to do it (gentoo-sources, gentoo-dev-sources, vanilla-sources, and so on). Then, when you emerge some package that needs the kernel-sources (like alsa, or ipw2X00) installed portage will try to install some kernel-sources. Why would you do that if you already have your kernel at /usr/src?

note: injecting has been deprecated, now you should use package.provided and virtuals as explained

- using package.provided:

package.provided tells portage that a package is installed (even if it's not)
You can use this file to put all the packages you want to tell portage you installed by hand.
Code:
echo "sys-kernel/ck-sources" >> /etc/portage/profile/package.provided


package.provided doesn't affect virtuals, virtuals are used to tell portage what packages should install for a given category:
For example, you could tell portage that you want to satisfy x11 with xorg, and not xfree anymore (which is not a valid example anymore, but it is useful to understand the use of it)
Code:
echo "virtual/x11 x11-base/xorg-x11" >> /etc/portage/profile/virtuals


more information on this and /etc/portage management -> man portage

11. Halt vs Suspend

Have you never asked yourself why you shutdown you computer, when you can suspend it to ram or disk?
If you suspend to ram, it has the handicap that it will still need AC input in order to keep the system alive. But suspending to disk is very useful (specially for laptops), because the laptop will "shutdown", but we will keep our sesion.

Doing it this way we avoid to boot all the system services everytime (it not an instant recuperation from the "sleep", but seems faster).
I have used swsusp2 in my laptop and works fine, but you have to patch the kernel sources. You can find info in THIS post on how to do this. Try it and you won't regret.

12. Xdelta - Deltup

In THIS post Deltup is discussed, because a new version is available. The point is that everytime portage needs to download a file, deltup will look for an older version of the file (/usr/portage/distfiles) and try to download only the
difference between the two files, and create the new file on-the-fly.

This can be a big improvement for all those 56k users who keep their /usr/portage/distfiles in order to only download patches when new "revisions" are released, because this can lower the mb to download everytime they want to emerge new versions of the installed packages.

13. Native POSIX Thread Library

This library, know as NPTL, can improve our system, because it's up to 4 times faster than the standard LinuxThreads when creating new threads. You *should* use 2.6 linux headers, and a new version of glibc and gcc (~x86). To use ntpl you just have to recompile glibc with the USE flag
"nptl" turned on.

note: in order to use nptl you need gcc 3.x or higher installed.

HERE you can get more information and benchmarkings.

14. GCC

GCC is very important, specially in a distro like gentoo in which the users look to optimize their system by compiling theirselves the packages they install. Using an actual version of gcc has some advantages, because all the code we create when compiling will be more optimized (from version 3.4.x you can already use the -march=pentium-m for the centrino
processors).

To install the latest gcc, just emerge gcc with ~x86 turned on (rmember to change your profile also):
Code:
# echo "sys-devel/gcc ~x86" >> /etc/portage/package.keywords
# emerge -u gcc


15. Filesystems [data safety vs speed]

After trying out some filesystems, i use reiser4 because it's the fastest filesystem available. I think that it is very useful to use a fast filesystem, but you have to keep backups of your data just in case you have corruption issues.
Also point that, after using ext2, ext3, reiserfs, xfs, reiserfs and som other encripted filesystems i have never had corruption issues with my data. Just keep backups of your data and you will be all set.

Note that you need a version of the kernel with the reiser4 patches, so it will have to be a development patched release.

To convert your / partition to reiser4 you will need a livecd with reiser4 support like THIS one, and install a kernel with that support also.

NOTA: Some people have problems because they can't find the Reiser4 submenu in the Filesystems tree of the kernel, make sure that you have deactivated the option "use 4kb for kernel stacks instead of 8kb) under the kernel hacking submenu, and then you will find the Reiser4 option.

16. i/o and tasks schedulers

coming soon

17. Useful Scripts and tips

There are some useful scripts in the forums and the portage tree to manage our system:

1- esearch

This one is included in the portage tree (you can just emerge esearch), and it's an utility to search trought the portage package database. The good thing is that it's very fast (faster than emerge -sS).
Note that after every emerge sync we have to update de esearch database by running eupdatedb, or you can just use esync to update the portage tree (esync will emerge sync, and then show a list with the changes (new packages) from the last sync).


2- eix

The same concept as esearch, but it's faster (and it is also faster to update the package database).
It's a young project, but works pretty fine.
More info HERE.

3- Cruft

This script from will generate a list with all the files in our system that could be deleted because they don't belong to any installed package. You have to be careful when using it, because it can generase false positives.

Usage:
Code:
# ./cruft > cruft.log

Then you can check the list, and remove from it the files you want to keep.
Then you can run this command to get rid of the files:
Code:
# cat cruft.log | xargs rm -rf


You could also just take a look at the list and delete them yourself.

More info HERE.

4- Stale

Interesting script that will help us to keep /usr/portage/distfiles with an optimal size. The script will search in that dir, and delete (when invoked with the --nopretend option) the old files, not the actual ones.
For example, if we have libtool-1.3.5.tar.gz and libtool-1.5.2.tar.gz, it would delete libtool-1.3.5.tar.gz


It gets messed with files like font-arial-iso-8859-1 and font-arial-iso-8859-2, in which the numeration doesn't not correspond to the versioning of the package (the same with gtk and glib in their versions 1.x and 2.x)
More info HERE.

5- Porthole

Portage frontend made in python (+gtk), that offers us a visual way to configure portage, and it makes easier to configure the packages and emerges. It's already in portage, so you just have to "emerge porthole".

6- kuroo

Another portage frontend, this one is made with Qt (for the kde-lovers). It's a young project, but works fine.

More info HERE.

You can also find more useful scripts and programs related to Portage in THIS thread.

7- portage cdb

This is not a script itself, but it's a nice tip to improve the portage speed. Try it, you wont be disappointed!

8- mounting / in ram

very nice article, worth a read :) https://forums.gentoo.org/viewtopic-t-296892.html

18. New tips (xdarma)

1- Kernel 2.6 performance tips (link)

2- KDE performance tips (link)



-under construction-
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep


Last edited by asph on Mon Jul 31, 2006 7:29 am; edited 12 times in total
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Fri Oct 01, 2004 3:30 pm    Post subject: Reply with quote

Sweet,

Just did the changes to teh /etc scripts. Not going to do the others but look usefoul for ppl interested in them
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Fri Oct 01, 2004 5:01 pm    Post subject: Re: [HOWTO] Flying with gentoo Reply with quote

nastassja wrote:
Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer"


note: cflags changed a little bit in gcc 3.4.X and -mcpu is deprecated, you should use -mtune instead. Moreover, pentium-m is accepted for centrino laptops. The CFLAGS of my centrino laptop are the following:
Code:
CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer"



1. -mcpu / -mtune preceded by -march implies -mcpu / -mtune (and everything that goes with it)
2. -falign-functions=4 actually slows you down a bit because your 1st level cache even that is used maybe a little more efficient it actually loads with data slower (even microsoft uses -falign-functions=16 even from the pentium-pro era) (for athlon and up a -falign-functions=64 would be more appropriate even that it does more or less of a diffrence; for intel (and i can be mistaken) maybe a value of 32 would suite)
3. when mentioning gcc-3.4 don't forget the -fvisibility-inlines-hidden cxxflag
4. -O3 does your binaries quite large and when it comes to desktop usage using -O2 may be more appropiate (faster program loading)
5. there are quite a few more cflags that can give more than a not notiable performance boost: -momit-leaf-frame-pointers -ffast-math etc
6. don't forget mentioning the diffrent kernel sources and diffrent i/o and tasks schedulers
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
galay2
Apprentice
Apprentice


Joined: 02 Feb 2004
Posts: 208

PostPosted: Fri Oct 01, 2004 6:35 pm    Post subject: Reply with quote

excellent guide!! However, I'm particularly interested in your hdparm tweak. How did you come up with the optimizations? Is there a guide somewhere? The man page does provide a load of options, but I would imagine you tested it in a systematic way?
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Fri Oct 01, 2004 6:54 pm    Post subject: Reply with quote

Great HOWTO, got some valuable tricks from it :P

Last edited by Deranger on Wed Nov 17, 2004 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 741
Location: Barcelona, Spain

PostPosted: Fri Oct 01, 2004 7:01 pm    Post subject: Reply with quote

thanks for the comments teutzz, i'll consider that when updating the guide
glad you like it, I will work on it as it still needs some improvements :)

galay: about the hdparm, the man page explains every option you can use.. using dma is really a boost, and also udma5 if your harddrive supports it (you can check with hdparm /dev/hda).. i also read a deep manual of hdparm, i'll post the link later.
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
Trevoke
Advocate
Advocate


Joined: 04 Sep 2004
Posts: 4099
Location: NY, NY

PostPosted: Fri Oct 01, 2004 8:11 pm    Post subject: Reply with quote

HOT DAMN!
SWEET!
THUMBS UP!
Ok.. I'm killing the caps.. But.. Nice!
_________________
Votre moment detente
What is the nature of conflict?
Back to top
View user's profile Send private message
bladdo
Guru
Guru


Joined: 19 Jul 2004
Posts: 334
Location: NJ

PostPosted: Fri Oct 01, 2004 8:24 pm    Post subject: Reply with quote

Awsome Nice job! I expecially like porthole , very dandy but I wish you could just run it and then when you went to emerge something you could type in the root passwd like in gnome-system-tools.
_________________
Bladdo formerly >Milo<
bladdo.net - scripting and design
Creator of AIM Bot: Tiny Tiny Bot - the bot that learns
distro: gentoo | window manager: pekwm
Back to top
View user's profile Send private message
mfkr79
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jul 2004
Posts: 143
Location: Italy

PostPosted: Fri Oct 01, 2004 9:39 pm    Post subject: Reply with quote

Very interesting, especially LDFLAGS & Optimization of the init scripts that sound new to me

As I boot directly into X, I put xdm and his dependency into the boot runlevel, and noticed a little faster startup, maybe due more to the changes in the init-scripts

Thank you nastassja :D
_________________
Gentoo ~amd64 on DELL XPS M1530
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Fri Oct 01, 2004 11:10 pm    Post subject: Reply with quote

nastassja wrote:
galay: about the hdparm, the man page explains every option you can use.. using dma is really a boost, and also udma5 if your harddrive supports it (you can check with hdparm /dev/hda).. i also read a deep manual of hdparm, i'll post the link later.
about hdparm: it is quite danderous to specify specific dma seting from hdparm; better let the bios manage the udma mode (much more safer)
btw: my hdparm settings:
Code:
-u1 -m16 -c1 -A1 -a64 -d1

_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
MighMoS
Guru
Guru


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

PostPosted: Fri Oct 01, 2004 11:42 pm    Post subject: Reply with quote

[quote="teutzz"]
nastassja wrote:
btw: my hdparm settings:
Code:
-u1 -m16 -c1 -A1 -a64 -d1

...and just to outdo you, here are mine:
Code:
disc0_args="-d1 -X66 -u1 -m16 -a256 -A1 -c3 -k1 -A1"
disc1_args="-d1 -X66 -u1 -m16 -a256 -A1 -c3 -k1 -A1"
cdrom0_args="-d1 -E40"
Note: replace -E40 w/ your actual cdrom speed. Also, the -c3 gives a big speed boost for me, so if you just take one letter, take that one.
_________________
jabber: MighMoS@jabber.org

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


Joined: 03 Aug 2003
Posts: 163
Location: berkeley, california

PostPosted: Sat Oct 02, 2004 12:35 am    Post subject: Reply with quote

for something so over the top (but i like it) you might want to consider adding a section on acovea https://forums.gentoo.org/viewtopic.php?t=157108&highlight=acovea

it helped me speed up my computer a lot, even though it does take a while. The scripts in the forum thread make it very simple to use
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Oct 02, 2004 1:26 am    Post subject: Reply with quote

For porthole, I am very near a -0.4 release. Watch for the announcement in Chat. There is a thread in there for the porthole-cvs with instructions on how to test it for the -0.4 release.

As for having an internal su ability. It is something I have wanted to put in, but gksu was undergoing major rework to its API and would have only meant trouble to include it before now. I will work on including it after I have the -0.4 release out.


The tuning tricks look good. I'll have to work on my system a little
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sat Oct 02, 2004 4:26 am    Post subject: Reply with quote

[quote="MighMoS"]
teutzz wrote:
nastassja wrote:
btw: my hdparm settings:
Code:
-u1 -m16 -c1 -A1 -a64 -d1

...and just to outdo you, here are mine:
Code:
disc0_args="-d1 -X66 -u1 -m16 -a256 -A1 -c3 -k1 -A1"
disc1_args="-d1 -X66 -u1 -m16 -a256 -A1 -c3 -k1 -A1"
cdrom0_args="-d1 -E40"
Note: replace -E40 w/ your actual cdrom speed. Also, the -c3 gives a big speed boost for me, so if you just take one letter, take that one.
sorry to disapoint you but you don't outdo me: i have udam5 (set corectvly by the system bios); alsa c3 if you read the man page is acctuly slower then c1 as it is syncronous
also my opinnion is that your readahead is to great (okay it will perform better in hdparm tests) because it will have mediocre speed rezults in real life usage as the data from your hdd is not a single continous string of data written on the disc on the exact order that the user will access it (more or less it is quite fragmented -> in linux that is good -> especially when using reiser4)

one thing is for sure: your args line is longer than mine, so you certenly outto me there :D

sorry for the bad english: 7am here, just woke up
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sat Oct 02, 2004 5:32 am    Post subject: Reply with quote

seringen wrote:
for something so over the top (but i like it) you might want to consider adding a section on acovea https://forums.gentoo.org/viewtopic.php?t=157108&highlight=acovea

it helped me speed up my computer a lot, even though it does take a while. The scripts in the forum thread make it very simple to use
yeah, but it gives a very very optimised settings output, i.e. changing the fsb with only one 1 Mhz or just adding more ram / or changing the ram chip is all that it takes to outdate your acovea cflags; not to mention the days spend doing the acovea tests (and all test in order to be valid must be done in single user mode, just console running, no X etc)
and in the end you still lose some time because you have to sort out what can be let in and what must be left out (many times it spits weird flags which if you use them it's like a disaster waiting to happen)

although (i ran it once, twice actualy: 1 time for my c compiler, 1 time for my c++ compiler), and what i can say it's that is good for a general direction (giving a sense of where to go from now), but nothing more, and that it must be treaten with care whatever the result

[EDIT]
not to mention that in genereal adding more optimisation (i.e. cflags) rarely makes a measureable diffrence (speed), maybe just increasing compile time (now i'm not saying go rock stable cflags, but go tested and proven to make a diffrence experimental cflags, i.e. -ffast-math, -fomit-frame-pointer, -momit-leaf-frame-pointer, -ftracer, -fforce-addr, -fprefech-loop etc)
[/EDIT]
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
seringen
Apprentice
Apprentice


Joined: 03 Aug 2003
Posts: 163
Location: berkeley, california

PostPosted: Sat Oct 02, 2004 10:03 pm    Post subject: Reply with quote

teutzz wrote:


although (i ran it once, twice actualy: 1 time for my c compiler, 1 time for my c++ compiler), and what i can say it's that is good for a general direction (giving a sense of where to go from now), but nothing more, and that it must be treaten with care whatever the result

[EDIT]
not to mention that in genereal adding more optimisation (i.e. cflags) rarely makes a measureable diffrence (speed), maybe just increasing compile time (now i'm not saying go rock stable cflags, but go tested and proven to make a diffrence experimental cflags, i.e. -ffast-math, -fomit-frame-pointer, -momit-leaf-frame-pointer, -ftracer, -fforce-addr, -fprefech-loop etc)
[/EDIT]


yeah, well of course you should only use it as a pointer to what you should use. And I'd highly argue against the idea of "proven" cflags like you claim. I personally run -O1 mainly with options turned off and only a few turned on. And on a reasonably fast computer, acovea should run overnight. Anyway I still feel acovea is a perfectly sane addition to the list, considering the nature of this topic is speeding up your computer, and people who really feel they have to do it would be interested in acovea. And acovea really did help speed my computer up.

Hope that clarifies my point.
Back to top
View user's profile Send private message
teutzz
Guru
Guru


Joined: 22 Apr 2004
Posts: 333
Location: .ro

PostPosted: Sat Oct 02, 2004 10:22 pm    Post subject: Reply with quote

seringen wrote:
teutzz wrote:


although (i ran it once, twice actualy: 1 time for my c compiler, 1 time for my c++ compiler), and what i can say it's that is good for a general direction (giving a sense of where to go from now), but nothing more, and that it must be treaten with care whatever the result

[EDIT]
not to mention that in genereal adding more optimisation (i.e. cflags) rarely makes a measureable diffrence (speed), maybe just increasing compile time (now i'm not saying go rock stable cflags, but go tested and proven to make a diffrence experimental cflags, i.e. -ffast-math, -fomit-frame-pointer, -momit-leaf-frame-pointer, -ftracer, -fforce-addr, -fprefech-loop etc)
[/EDIT]


yeah, well of course you should only use it as a pointer to what you should use. And I'd highly argue against the idea of "proven" cflags like you claim. I personally run -O1 mainly with options turned off and only a few turned on. And on a reasonably fast computer, acovea should run overnight. Anyway I still feel acovea is a perfectly sane addition to the list, considering the nature of this topic is speeding up your computer, and people who really feel they have to do it would be interested in acovea. And acovea really did help speed my computer up.

Hope that clarifies my point.
in every gentoo power user's life comes a time of wondering if he/she can optimize his box even better (i'm one of those, stating that i even ran the full acovea tests just to see the rezults more or less out of curiosity) so yes at least partly i agree with you
_________________
Cand nu stii ce sa raspunzi sau ce sa spui un simplu BLA ajunge... lolz
Back to top
View user's profile Send private message
alechiko
Guru
Guru


Joined: 01 Feb 2004
Posts: 465
Location: Inside piano, do not disturb.

PostPosted: Sun Oct 03, 2004 2:18 am    Post subject: Weeee Reply with quote

Great guide! thanks a lot! really appreciated it, especially the suspend change and the tip about keeping gcc upto date.. which made me realised that the processor-m is out for the centrino which ive updated from what was i686 i think :)
_________________
None
Back to top
View user's profile Send private message
ryceck
Apprentice
Apprentice


Joined: 13 Jan 2004
Posts: 195

PostPosted: Mon Oct 04, 2004 8:40 am    Post subject: Reply with quote

The thingy bout the LDFlags was new for me... but it doesn't work :/
Code:

/usr/lib/i686-gpc-linux-gnu/3.4.2/../../../../i686-pc-linux-gnu/bin/ld : no such file: no such file or directory

I checked, and ld is at the location it asks for... so I wouldn't what goes wrong here....

The rest of the tweaks are excellent :D
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 741
Location: Barcelona, Spain

PostPosted: Mon Oct 04, 2004 9:23 am    Post subject: Reply with quote

ryceck wrote:
The thingy bout the LDFlags was new for me... but it doesn't work :/
Code:

/usr/lib/i686-gpc-linux-gnu/3.4.2/../../../../i686-pc-linux-gnu/bin/ld : no such file: no such file or directory

I checked, and ld is at the location it asks for... so I wouldn't what goes wrong here....

The rest of the tweaks are excellent :D


what ldflags did you use? what package are you trying to compile when you get the error?

i am working on an update, i guess i will post it today or tomorrow
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Mon Oct 04, 2004 7:04 pm    Post subject: Reply with quote

What happened to the times when all we had to do was try to hit the ground and miss?

:wink:
Back to top
View user's profile Send private message
ryceck
Apprentice
Apprentice


Joined: 13 Jan 2004
Posts: 195

PostPosted: Tue Oct 05, 2004 8:41 am    Post subject: Reply with quote

mvila wrote:
ryceck wrote:
The thingy bout the LDFlags was new for me... but it doesn't work :/
Code:

/usr/lib/i686-gpc-linux-gnu/3.4.2/../../../../i686-pc-linux-gnu/bin/ld : no such file: no such file or directory

I checked, and ld is at the location it asks for... so I wouldn't what goes wrong here....

The rest of the tweaks are excellent :D


what ldflags did you use? what package are you trying to compile when you get the error?

i am working on an update, i guess i will post it today or tomorrow


Every package and these flags: "Wl, O1"

@Chaosite: Those days will arrive again when the Vorlons do ;)
Back to top
View user's profile Send private message
John5788
Advocate
Advocate


Joined: 06 Apr 2004
Posts: 2140
Location: 127.0.0.1

PostPosted: Wed Oct 06, 2004 11:25 pm    Post subject: Reply with quote

great guide, just tried it :)
_________________
John5788
Back to top
View user's profile Send private message
seringen
Apprentice
Apprentice


Joined: 03 Aug 2003
Posts: 163
Location: berkeley, california

PostPosted: Wed Oct 06, 2004 11:37 pm    Post subject: Reply with quote

how's the update coming along?
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Thu Oct 07, 2004 9:28 am    Post subject: Re: [HOWTO] Flying with gentoo Reply with quote

mvila wrote:
14. GCC

GCC is very important, specially in a distro like gentoo in which the users look to optimize their system by compiling theirselves the packages they install. Using an actual version of gcc has some advantages, because all the code we create when compiling will be more optimized (from version 3.4.x you can already use the -march=pentium-m for the centrino
processors).

To install the latest gcc, just emerge gcc with ~x86 turned on:
Code:
# echo "sys-devel/gcc ~x86" >> /etc/portage/package.keywords
# emerge -u gcc



I've just merged a new gcc, but I noticed it isn't being used..!!
Right now, I have two versions of gcc installed. (3.3.4-r1 and 3.4.2-r2)

Try running these commands and you'll like notice the same:
Code:
gcc -v
etcat -v gcc
gcc-config --get-current-profile
gcc-config --list-profiles


Something tell me we need to run gcc-config i686-pc-linux-gnu-3.3.4 first... :P
_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
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, 3, 4, 5, 6  Next
Page 1 of 6

 
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