|
13 years ago 65 |
As an impatient S.o.B. with the attention span of a hyperactive mayfly, one of my bugbears with Linux, specifically Linux Mint Debian Edition in my case, is how long some applications take to start up when I select the menu option. On my laptop for example, Libre Office Writer takes over twenty five seconds. That doesn't sound like a huge amount of time and in the grand scheme of things it probably isn't; but it feels like an eternity when you are waiting for an application to open.
If you want to find out how long twenty five seconds actually is, try the following, simple experiment.
Get into your car at 3am and drive around a quiet neighbourhood. Give a blast on your horn that lasts for twenty five seconds. You will be truly amazed at how long it is!
Seriously, don't do that as depending on the neighbourhood, you may get into trouble with the law, or shot or both!
LibreOffice writer now starts up on my laptop in less than five seconds and most other programs have had a similar boost. And it was easy to achieve.
When starting any Linux application, the biggest chunk of time by far is spent working out which shared libraries are needed by the application and which are needed by those and so on and so on. What we need then is a way to speed up or avoid this process. Fortunately, there is a wonderful utility called prelink which will do the job perfectly.
The following is how I set it up in LMDE; the process should be the same in the other Mint editions as I know it works the same for Xubuntu.
That's it! It really is that easy.
Thanks!!
“Though prelink does provide a benefit, it may be a bit hard to justify as time goes on.” See http://lwn.net/Articles/341244/ before you decide to do that. With an SSD, you don’t need this anymore.
Awesome Thanks
No. It's a cron job which is similar to a scheduled task in the Windows world.
EXELENT !!!
Do I must start command "sudo /etc/cron.daily/prelink" every time when Im login to os?
Woot, thanks! My libreOffice stuff and firefox open in 2 secs now :)
Wow this made a huge difference thanks!
Thanks, even on an already fast machine I was able to speed up some applications, notably gimp. Great advise!
Workaround for the '134' bug:
1. sudo chmod 666 /etc/prelink.conf
2. sudo prelink -amvR
3. take the program from the last 'Prelinking ...' output before it crashed and
sudo echo '-b /path/to/program' >> /etc/prelink.conf
4. repeat 2 and 3 until it runs through
james3mc: It means it can't link that item. It should be OK to ignore
hithirdwavedust:I have opuntia but not specifically the prickly pear. On your main question, I have no idea I'm afraid but I thought it generated on disk tables of links
This is incredibly interesting; do you know of any security ramifications of prelinking? Also, does the linking reside in main memory as the machine runs?
On a totally different subject, do you have a prickly pear in your collection of cacti?
On my system, initialise eventually fails. My prelink log ends with this ...
2012-02-10 09:35:37 prelink: /usr/bin/mplayer: Cannot prelink against non-PIC shared library /usr/lib/i686/cmov/libpostproc.so.52
prelink.bin: ../../src/conflict.c:763: prelink_build_conflicts: Assertion `j < ndeps' failed.
Prelink failed with return value 134
Any ideas what this actually means?
James
I followed your recommendation for helping applications open faster.
While some applications were not noticeably affected, others, like LibreOffice, and Gimp showed a drastic improvement in start-up speed. Following the steps in your tutorial it was easy, and fast to set up prelinking.
Thanx for the Tutorial, I have carefully followed the steps,but have encountered this problem and would like to ask if anyone can tell me what is going wrong, and how i can correct it.
bilbo@bilbo-laptop ~ $ sudo /etc/cron.daily/prelink
[sudo] password for bilbo:
/etc/cron.daily/prelink: line 55: 1682 Aborted /usr/sbin/prelink -a $PRELINK_OPTS >> /var/log/prelink.log 2>&1
Many thanks :)
On my LMDE 1109 I have problems. Here is my prelink.log:
/usr/sbin/prelink -a -mR -T -f
2011-12-14 05:15:35 prelink: /usr/lib/icedove/icedove-bin: Could not find one of the dependencies
2011-12-14 05:15:35 prelink: /usr/lib/klibc/bin/losetup: Using /lib/klibc-gj8Lrm8UlC498y56mvS0YY96gps.so, not /lib/ld-linux.so.2 as dynamic linker
2011-12-14 05:15:35 prelink: /usr/lib/klibc/bin/dmesg: Using /lib/klibc-gj8Lrm8UlC498y56mvS0YY96gps.so, not /lib/ld-linux.so.2 as dynamic linker
(...)
2011-12-14 05:15:35 prelink: /usr/lib/klibc/bin/reboot: Using /lib/klibc-gj8Lrm8UlC498y56mvS0YY96gps.so, not /lib/ld-linux.so.2 as dynamic linker
2011-12-14 05:15:39 prelink: /usr/lib/libbonobo-activation.so.4.0.0: Not enough room to add .dynamic entry
2011-12-14 05:15:44 prelink: /usr/sbin/chat: DT_JMPREL tag not adjacent to DT_REL relocations
2011-12-14 05:15:59 prelink: /usr/sbin/pppoe-discovery: DT_JMPREL tag not adjacent to DT_REL relocations
prelink.bin: ../../src/conflict.c:763: prelink_build_conflicts: Assertion `j < ndeps' failed.
Prelink failed with return value 134
== ==
Thank you in advance for any kind of help.
How I check if prelink is working on my machine?
Thank you ;)
Does anybody know what to choose between prelink and preload?
I am rather fine with preload, but the price to pay in terms of boot time is very high
All commands worked w/o a fuss. Will report back if noticeable improvement.
Thanks for the info! Very helpful!
Works well. Thanks!
@pnin: I think ureadahead is purely for boot speed.
From the Arch Wiki which is a damn good source of Linux info
Ureadahead (Über-readahead) is used to speed up the boot process. It works by reading all the files required during boot and makes pack files for quicker access, then during boot reads these files in advance, thus minimizes the access times for the harddrives. It's intended to replace sreadahead.
Pardon my noobiness, but something itches me about this tip: is it compatible with the current (July-11) default implementation of ureadahead, or does the later make prelink redundant?
If not, why isn't prelink installed and activated by default, at least in LM LXDE, considering it sees a lot of older hardware, and this could mean a world of difference?
I've been using both, prelink and preload, seems to be working great.
Desktop comes a little slower on boot, but much better when working on the desktop.
This also works with network files.
Very good Trollboy you get a cookie today and a mint on your pillow.
Well done that man, made my ssd even faster.
Hm. Now I'm not sure. I ran prelink and especially OOo *does* seem faster. Starts in 2 sec.
Then I ran [ sudo prelink -ua ] to undo the prelinking again but this results in a long list of shared files which it can not find.
After rebooting I tried starting OOo writer: The first start takes about 4 seconds, all subsequent starts take 2 seconds. I never timed the starts before, but, like I said, it seems a lot faster.
I'm going to test this on a slower computer now.
Right. Thanks for a great tip anyway. OpenOffice.org Writer starting up in 2 seconds! Down from 4 :) I need to try this on a slower computer. Thanks!
Why is it not included? I don't know.
Are there any drawbacks? I haven't encountered any yet. That doesn't mean I never will ;)
When I do an upgrade, I tend to automatically run the prelink cron script afterwards.
How come this is not integrated in all distros by default? What are the drawbacks, caveats and known issues?
Would this fail when I upgrade applications to a new version, which may rely on different dependencies than the previous version?
Seems like an excellent tool anyhow, trying it out now :)
This is very good! Thank you!
Libreoffice Writer 4 seconds.
Useful tutorial, thank you!