Page 1 of 10 123 ... LastLast
Results 1 to 10 of 96

Thread: Prelinking Guide- Make Ubuntu Feel Faster

  1. #1
    Join Date
    Nov 2004
    Location
    Texas
    Beans
    2,434

    Prelinking Guide- Make Ubuntu Feel Faster

    Disclaimer: Prelinking might break your system! Only consider for use if you can risk the chance that your install might mess up. Most of all make sure that it gets to run the whole thing through the first time you prelink. Stopping in the middle can lead to system failure. Prelinking is a powerful device and needs to be used with care.


    Originally written by Jdong.

    UPDATE 1/2/07: Prelink is no longer necessary in Feisty. Feisty uses a new linking mechanism called DT_GNU_HASH which dramatically speeds up the linking process without the need for continuously running this prelink program. Again, prelink is NOT useful starting from Feisty

    Reason to use Prelinking

    (from the Gentoo Linux Prelinking Guide)

    Most common applications make use of shared libraries. These shared libraries need to be loaded into memory at runtime and the various symbol references need to be resolved. For most small programs this dynamic linking is very quick. But for programs written in C++ and that have many library dependencies, the dynamic linking can take a fair amount of time.

    On most systems, libraries are not changed very often and when a program is run, the operations taken to link the program are the same every time. Prelink takes advantage of this by carrying out the linking and storing it in the executable, in effect prelinking it.

    Prelinking can cut the startup times of applications. For example, a typical KDE program's loading time can be cut by as much as 50%. The only maintenance required is re-running prelink every time a library is upgraded for a pre-linked executable.

    Yet there is a chance that prelinking might mess up something, so use at your own risk.

    How to enable prelink

    1. Activate Ubuntu universe sources
    2. Put this command into terminal to install Prelink:

    sudo apt-get install prelink


    3. Now put this command into the terminal:

    sudo gedit /etc/default/prelink
    4. Change where it says "PRELINKING=unknown from unknown" to "yes"
    5. Adjust the other options if you know what the heck you're doing. If it looks foreign to you, the defaults work well.
    6. To start the first prelink (the longest one!), put this in terminal:

    sudo /etc/cron.daily/prelink
    Automatic Prelinking After Program Are Installed

    One problem with prelinking in that when you install new programs those programs are not prelinked. So to avoid this problem when installing programs with apt-get or synaptic, use the directions below.

    1. Put this in terminal:

    sudo gedit /etc/apt/apt.conf
    2. When the file opens in Gedit, put this line at the end of the file and save (even if the file has no content before you add the line):

    DPkg:ost-Invoke {"echo Running prelink, please wait...;/etc/cron.daily/prelink";}

    General Notes About Prelinking

    In the future, prelink performs a quick prelink (a less-than-1-minute procedure on most systems) daily, usually at midnight. Every 14 days, or whatever you changed it to be, a full prelink will run.

    If you just did a major apt-get upgrade that changed systemwide libraries (i.e. libc6, glibc, major gnome/X libs, etc etc etc) and experience cryptic errors about libs, rerun step 6.

    To undo prelink, change step 4 from yes to no, then rerun step 6.

    Prelinking will make the binaries it prelinks change, so it's not appropriate if you have tripwire or another checksum-based IDS system, or if you do incremental or differential backups to save on space.
    Last edited by jdong; January 2nd, 2007 at 06:32 PM.
    Those folks who try to impose analog rules on digital content will find themselves on the wrong side of the tidal wave.
    - Mark Shuttleworth

  2. #2
    Join Date
    Aug 2005
    Location
    Saint Paul, MN
    Beans
    2,907

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    sudo gedit /etc/apt/apt.conf
    Thanks for the guide! I had installed prelinking but didn't know about the apt configuration.

    Breezy amd64 does not appear to have an apt.conf file. I did, however, find a /etc/apt/apt.conf.d directory that has similar scripts. I created a new script called S99prelink and that appears to do the trick.
    Last edited by mlomker; October 12th, 2005 at 01:43 AM.

  3. #3
    Join Date
    Jun 2005
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question Re: Prelinking Guide- Make Ubuntu Feel Faster

    I have a question. Eventhough prelinking sonds like a miracle tweak that would speed up most applications; since you noted to use this prelinking at one's own risk, I was wondering if prelinking would affect the stability of the whole operating system negatively? I remember reading a similar thread for hoary but didn't perform the changes. I am asking this because if it can speed up the system why isn't the ubuntu gets installed prelinking enabled off the bat and I would prefer the stability of ubuntu over the performance under any condition. So please comment about this if you have experience from hoary or breezy's preview release. Thanks
    Last edited by ubunxpm; October 13th, 2005 at 03:39 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    Saint Paul, MN
    Beans
    2,907

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    So please comment about this if you have experience from hoary or breezy's preview release. Thanks
    I ran prelinking on Hoary and now Breezy. To be honest, I haven't noticed any performance difference...other than the few seconds delay while waiting for the prelinking to finish when I install packages now. I certainly didn't run disk benchmarks before and after, but it doesn't seem like much to me.

  5. #5
    Join Date
    Jun 2005
    Beans
    19
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    Quote Originally Posted by poofyhairguy
    Yet there is a chance that prelinking might mess up something, so use at your own risk.
    Well, then it does not make a major difference in performance. Obviously a memory upgrade would do a whole lot more to the performance than prelinking. Did anything go wrong because of it where normally it wouldn't have?
    Last edited by ubunxpm; October 13th, 2005 at 03:49 PM.

  6. #6
    Join Date
    Nov 2004
    Location
    Texas
    Beans
    2,434

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    Quote Originally Posted by ubunxpm
    Well, then it does not make a major difference in performance. Obviously a memory upgrade would do a whole lot more to the performance than prelinking.
    Yes. Prelinking can help decrease the start up times for some applications. Its not a miracle tweak that makes everything faster, its just a way to get some applications to load faster.
    Those folks who try to impose analog rules on digital content will find themselves on the wrong side of the tidal wave.
    - Mark Shuttleworth

  7. #7
    Join Date
    Aug 2005
    Location
    Chicago, IL
    Beans
    106
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    I started prelinking a few weeks ago in Breezy, the major differnece I felt was in opening OO.org apps for the first time, Writer went from ~10sec to 3-4sec, same for the rest OO.org, and Gimp.

    Great tutorial poofyhairguy/jdong.
    Ubuntu Gutsy Gibbon 7.10
    AMD 64 3000+ / 2 GB RAM / nVidia 6200 @ 1600*1200 on ViewSonic E790
    Storage: (120+200+[400+400]+400+750) GB = 2270 GB

  8. #8
    Join Date
    Sep 2005
    Beans
    41

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    i can def see a dif in oo.org yayy thanks for the great tutorial

  9. #9
    Join Date
    Sep 2005
    Location
    MD
    Beans
    19

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    Same here - improvement in apps like OOo and Gimp. That's enough for me - I don't need gaim to load faster, for example, because its already pretty quick - what makes this worthwhile is the savings on the larger apps. Great guide, thanks.

  10. #10
    Join Date
    Apr 2005
    Location
    Brisbane, Qld. Australia
    Beans
    202
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: Prelinking Guide- Make Ubuntu Feel Faster

    Quote Originally Posted by mlomker
    Thanks for the guide! I had installed prelinking but didn't know about the apt configuration.

    Breezy amd64 does not appear to have an apt.conf file. I did, however, find a /etc/apt/apt.conf.d directory that has similar scripts. I created a new script called S99prelink and that appears to do the trick.
    Could the steps you followed to do this be added to the original 'Howto'.

    Cheers.
    "I'm just sittin' here watchin' the wheels go 'round and 'round"
    John Lennon

Page 1 of 10 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •