from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites: www.linuxhowtos.org
toolsntoys.linuxhowtos.org



Last additions:
How to make X listen on port 6000

How to make X listen on port 6000

words:

34

views:

84951

userrating:

average rating: 1.2 (52 votes) (1=very good 6=terrible)


May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Misc

Speeding up the boot process (next generation)

The idea is to preload the useful files into kernel buffer cache before they are needed. Since I/O can happen parallel to the other CPU intensive tasks during bootup, this leads to faster bootup and faster startup time for your chosen applications. Other projects use static lists to preload the files.

This tutorial uses an automated process of generating the "useful" prefetch database.

This is /etc/init.d/my-readahead.
Code:

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        before syslog-ng
}

start() {
        ebegin "Starting readahead ROYALE"
        cat /etc/conf.d/* > /dev/null 2>&1 &
        cat /usr/lib/gconv/gconv-modules.cache > /dev/null 2>&1 &
        cat /usr/share/icons/gnome/icon-theme.cache > /dev/null 2>&1 &
        cat /usr/share/icons/hicolor/icon-theme.cache > /dev/null 2>&1 &
        cat `cat /etc/conf.d/sofile-list.load` > /dev/null 2>&1 &
        if [ -f /forcesampler ];then
                /usr/sbin/sample-init-process /etc/conf.d/sofile-list.load &
                rm -f /forcesampler
        fi 
        eend 0
}

stop() {
        eend 0
}

The executable shell script /usr/sbin/sample-init-process:
Code:

 #!/bin/bash
final_db="$1"

# total number of lists to keep in /etc/conf.d/
total_to_keep=4

# total number of samples to make in /forcesampler boot.
# It will take twice this amount of seconds to finish sampling.
total_samples_per_boot=200

# touch empty file if not there
[ ! -f "$final_db" ] && touch "$final_db"

let i=0
while [ "$i" -ne "$total_to_keep" ] ; do
        if [ ! -f "$final_db$i" ] ; then
                break;
        else
                j=$((i+1))
                if [ "$j" = "$total_to_keep" ] ;then
                        j=0
                fi
                if [ -f "$final_db$j" -a "$final_db$i" -nt "$final_db$j" ];then
                        i=$((j))
                        break;
                fi
        fi
        i=$((i+1))
done
if [ "$i" = "$total_to_keep" ] ;then
        i=0
fi

slot="$i"
cp "$final_db" "$final_db$i"

function collect_sample()
{
        lsof | awk '{if ($5=="REG") {if (match($9,".so") || match($9,".conf") \
        || match($9,"/bin/") || match($9,"ttf") || match($9,"libexec")) \
        print $9}}' | sort | uniq >> $1
}

collect_sample /tmp/init_sample1

i=0 
while [ "$i" -ne "$total_samples_per_boot" ] ; do
        collect_sample /tmp/init_sample2
        cat /tmp/init_sample1 /tmp/init_sample2 | sort | uniq > /tmp/init_sample3
        mv /tmp/init_sample3 /tmp/init_sample1
        sleep 1
        i=$((i+1))
done

cat /tmp/init_sample1 "$final_db$slot" | sort | uniq > "$final_db"

rm -f /tmp/init_sample[123]
And then do this:
Code:
chmod +x /usr/sbin/sample-init-process
rc-update add my-readahead default
touch /forcesampler

What you have done is asked my-readahead to create a sampler process which samples what files (fonts, binaries, libraries, configs) are in use, every second. It collects 200 samples (will be busy for at least 10 minutes after boot) and keeps updating the database with a list of useful files.

Once you boot after this the first time, you will probably see a slow down because its collecting samples for use on the next and subsequent boots. Use your system as you normally would. Open firefox, gaim, OO or whatever. Once the sampler script has finished ('ps -aef|grep sample-init-process' will tell you if its running), reboot. Now this and all subsequent boots will be much faster.

If it takes too long for the sample-init-process to finish, reduce the total_samples_per_boot variable in the sampler script to 100 and try again by touching /forcesampler.

In future, whenever you feel like updating the prefetch database, just 'touch /forcesampler' and database will be updated on next reboot.

based on http://forums.gentoo.org/viewtopic-t-478491.html, some script modifications done.

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2026-05-04
backports-zstd - 1.4.0
Ebuild name:

dev-python/backports-zstd-1.4.0

Description

Backport of PEP-784 adding Zstandard to the standard library

Added to portage

2026-05-04

cachetools - 7.1.1
Ebuild name:

dev-python/cachetools-7.1.1

Description

Extensible memoizing collections and decorators

Added to portage

2026-05-04

cudd - 3.0.0-r2
Ebuild name:

sci-mathematics/cudd-3.0.0-r2

Description

Colorado University binary Decision Diagram library

Added to portage

2026-05-04

ffmpeg - 8.1.1
Ebuild name:

media-video/ffmpeg-8.1.1

Description

Complete solution to record/convert/stream audio and video

Added to portage

2026-05-04

gcc - 17.0.0_p20260503
Ebuild name:

sys-devel/gcc-17.0.0_p20260503

Description

The GNU Compiler Collection

Added to portage

2026-05-04

git-sources - 7.1_rc2
Ebuild name:

sys-kernel/git-sources-7.1_rc2

Description

The very latest -git version of the Linux kernel

Added to portage

2026-05-04

haproxy - 2.8.22
Ebuild name:

net-proxy/haproxy-2.8.22

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-04

haproxy - 3.0.21
Ebuild name:

net-proxy/haproxy-3.0.21

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-04

haproxy - 3.2.17
Ebuild name:

net-proxy/haproxy-3.2.17

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-04

haproxy - 3.3.8
Ebuild name:

net-proxy/haproxy-3.3.8

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2026-05-04

kodi - 22.0_alpha3
Ebuild name:

media-tv/kodi-22.0_alpha3

Description

A free and open source media-player and entertainment hub

Added to portage

2026-05-04

micropolis - 1.0_p20250710
Ebuild name:

games-simulation/micropolis-1.0_p20250710

Description

Free version of the well-known city building simulation

Added to portage

2026-05-04

mistune - 3.2.1
Ebuild name:

dev-python/mistune-3.2.1

Description

The fastest markdown parser in pure Python

Added to portage

2026-05-04

nextcloud - 32.0.9
Ebuild name:

www-apps/nextcloud-32.0.9

Description

Personal cloud that runs on your own server

Added to portage

2026-05-04

nextcloud - 33.0.3
Ebuild name:

www-apps/nextcloud-33.0.3

Description

Personal cloud that runs on your own server

Added to portage

2026-05-04

openpgp-keys-janwassenberg - 20260503
Ebuild name:

sec-keys/openpgp-keys-janwassenberg-20260503

Description

OpenPGP key used by Jan Wassenberg

Added to portage

2026-05-04

openpgp-keys-roymarples - 20260418-r1
Ebuild name:

sec-keys/openpgp-keys-roymarples-20260418-r1

Description

OpenPGP key used by Roy Marples

Added to portage

2026-05-04

piwigo - 16.4.0
Ebuild name:

www-apps/piwigo-16.4.0

Description

a photo gallery software for the web

Added to portage

2026-05-04

poetry-core - 2.4.0
Ebuild name:

dev-python/poetry-core-2.4.0

Description

Poetry PEP 517 Build Backend

Added to portage

2026-05-04

poezio - 0.17
Ebuild name:

net-im/poezio-0.17

Description

Console XMPP client that looks like most famous IRC clients

Added to portage

2026-05-04

pytz - 2026.2
Ebuild name:

dev-python/pytz-2026.2

Description

World timezone definitions for Python

Added to portage

2026-05-04

sbcl - 2.6.4
Ebuild name:

dev-lisp/sbcl-2.6.4

Description

Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp

Added to portage

2026-05-04

valgrind - 3.27.0_p1
Ebuild name:

dev-debug/valgrind-3.27.0_p1

Description

An open-source memory debugger for GNU/Linux

Added to portage

2026-05-04

wtforms - 3.2.2
Ebuild name:

dev-python/wtforms-3.2.2

Description

Flexible forms validation and rendering library for python web development

Added to portage

2026-05-04

wxmaxima - 26.05.0
Ebuild name:

sci-mathematics/wxmaxima-26.05.0

Description

Graphical frontend to Maxima, using the wxWidgets toolkit

Added to portage

2026-05-04

zim - 0.76.3-r1
Ebuild name:

x11-misc/zim-0.76.3-r1

Description

A desktop wiki

Added to portage

2026-05-04

2026-05-03
alsa-tools - 1.2.15-r3
Ebuild name:

media-sound/alsa-tools-1.2.15-r3

Description

Advanced Linux Sound Architecture tools

Added to portage

2026-05-03

arj - 3.10.22_p28-r1
Ebuild name:

app-arch/arj-3.10.22_p28-r1

Description

Utility for opening arj archives

Added to portage

2026-05-03

bear - 4.1.2
Ebuild name:

dev-util/bear-4.1.2

Description

A tool that generates a compilation database for clang tooling

Added to portage

2026-05-03

blender-bin - 4.2.20
Ebuild name:

media-gfx/blender-bin-4.2.20

Description

3D Creation/Animation/Publishing System

Added to portage

2026-05-03

blender-bin - 4.5.9
Ebuild name:

media-gfx/blender-bin-4.5.9

Description

3D Creation/Animation/Publishing System

Added to portage

2026-05-03

blender-bin - 5.1.1
Ebuild name:

media-gfx/blender-bin-5.1.1

Description

3D Creation/Animation/Publishing System

Added to portage

2026-05-03

boost-m4 - 0.4_p20250404
Ebuild name:

dev-build/boost-m4-0.4_p20250404

Description

Another set of autoconf macros for compiling against boost

Added to portage

2026-05-03

capnproto - 1.4.0
Ebuild name:

dev-libs/capnproto-1.4.0

Description

RPC/Serialization system with capabilities support

Added to portage

2026-05-03

cargo-c - 0.10.22
Ebuild name:

dev-util/cargo-c-0.10.22

Description

Helper program to build and install c-like libraries

Added to portage

2026-05-03

chrony - 4.8-r1
Ebuild name:

net-misc/chrony-4.8-r1

Description

NTP client and server programs

Added to portage

2026-05-03

closure-compiler-bin - 20260429
Ebuild name:

dev-lang/closure-compiler-bin-20260429

Description

JavaScript optimizing compiler

Added to portage

2026-05-03

clr-loader - 0.3.1
Ebuild name:

dev-python/clr-loader-0.3.1

Description

Generic pure Python loader for .NET runtimes

Added to portage

2026-05-03

dar - 2.8.5
Ebuild name:

app-backup/dar-2.8.5

Description

A full featured backup tool, aimed for disks

Added to portage

2026-05-03

dropbear - 2026.90
Ebuild name:

net-misc/dropbear-2026.90

Description

Small SSH 2 client/server designed for small memory environments

Added to portage

2026-05-03

easycrypt - 2026.05
Ebuild name:

sci-mathematics/easycrypt-2026.05

Description

Computer-Aided Cryptographic Proofs

Added to portage

2026-05-03

evisum - 2.0.4
Ebuild name:

sys-process/evisum-2.0.4

Description

System and process monitor written with EFL

Added to portage

2026-05-03

gcc - 16.1.1_p20260502
Ebuild name:

sys-devel/gcc-16.1.1_p20260502

Description

The GNU Compiler Collection

Added to portage

2026-05-03

gnome-session-openrc - 49.1-r1
Ebuild name:

gnome-base/gnome-session-openrc-49.1-r1

Description

Gnome session leader for OpenRC

Added to portage

2026-05-03

gzip - 1.14_p20260502
Ebuild name:

app-arch/gzip-1.14_p20260502

Description

Standard GNU compressor

Added to portage

2026-05-03

ipy - 1.01-r2
Ebuild name:

dev-python/ipy-1.01-r2

Description

Class and tools for handling of IPv4 and IPv6 addresses and networks

Added to portage

2026-05-03

kotlin-bin - 2.3.21
Ebuild name:

dev-lang/kotlin-bin-2.3.21

Description

Statically typed language that targets the JVM and JavaScript

Added to portage

2026-05-03

libburn - 1.5.8-r1
Ebuild name:

dev-libs/libburn-1.5.8-r1

Description

Open-source library for reading, mastering and writing optical discs

Added to portage

2026-05-03

libisoburn - 1.5.8-r1
Ebuild name:

dev-libs/libisoburn-1.5.8-r1

Description

Creation/expansion of ISO-9660 filesystems on CD/DVD media supported b

Added to portage

2026-05-03

lxc - 7.0.0
Ebuild name:

app-containers/lxc-7.0.0

Description

A userspace interface for the Linux kernel containment features

Added to portage

2026-05-03

lxcfs - 7.0.0
Ebuild name:

sys-fs/lxcfs-7.0.0

Description

FUSE filesystem for LXC

Added to portage

2026-05-03

mac - 12.76
Ebuild name:

media-sound/mac-12.76

Description

Monkey's Audio Codecs

Added to portage

2026-05-03

mit-krb5 - 1.22.2-r1
Ebuild name:

app-crypt/mit-krb5-1.22.2-r1

Description

MIT Kerberos V

Added to portage

2026-05-03

moto - 5.2.0
Ebuild name:

dev-python/moto-5.2.0

Description

Mock library for boto

Added to portage

2026-05-03

mpv - 0.41.0-r2
Ebuild name:

media-video/mpv-0.41.0-r2

Description

Media player for the command line

Added to portage

2026-05-03

muse - 3.20.2
Ebuild name:

app-emacs/muse-3.20.2

Description

An authoring and publishing environment for Emacs

Added to portage

2026-05-03

nagios-mode - 0.4
Ebuild name:

app-emacs/nagios-mode-0.4

Description

Major mode for editing Nagios configuration files

Added to portage

2026-05-03

navi2ch - 1.8.4-r2
Ebuild name:

app-emacs/navi2ch-1.8.4-r2

Description

A navigator for the Japanese textboard 2ch

Added to portage

2026-05-03

nerd-icons - 0.1.0
Ebuild name:

app-emacs/nerd-icons-0.1.0

Description

Emacs Nerd Font Icons Library

Added to portage

2026-05-03

nginx-mode - 1.1.10
Ebuild name:

app-emacs/nginx-mode-1.1.10

Description

Emacs editing mode for Nginx config files

Added to portage

2026-05-03

no-littering - 1.8.7
Ebuild name:

app-emacs/no-littering-1.8.7

Description

ELisp library that helps keeping Emacs configuration directory clean

Added to portage

2026-05-03

pango - 1.57.1
Ebuild name:

x11-libs/pango-1.57.1

Description

Internationalized text layout and rendering library

Added to portage

2026-05-03

papers - 49.6-r1
Ebuild name:

app-text/papers-49.6-r1

Description

A document viewer for the GNOME desktop

Added to portage

2026-05-03

pbr - 7.0.3-r1
Ebuild name:

dev-python/pbr-7.0.3-r1

Description

Inject some useful and sensible default behaviors into setuptools

Added to portage

2026-05-03

pbr - 7.0.3-r2
Ebuild name:

dev-python/pbr-7.0.3-r2

Description

Inject some useful and sensible default behaviors into setuptools

Added to portage

2026-05-03

portage - 3.0.78
Ebuild name:

sys-apps/portage-3.0.78

Description

The package management and distribution system for Gentoo

Added to portage

2026-05-03

postfix - 3.11.2
Ebuild name:

mail-mta/postfix-3.11.2

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-05-03

pytest-asyncio - 1.4.0_alpha2
Ebuild name:

dev-python/pytest-asyncio-1.4.0_alpha2

Description

Library for testing asyncio code with pytest

Added to portage

2026-05-03

pythonnet - 3.0.5-r1
Ebuild name:

dev-python/pythonnet-3.0.5-r1

Description

Nearly seamless integration with the .NET Common Language Runtime

Added to portage

2026-05-03

rclone - 1.74.0
Ebuild name:

net-misc/rclone-1.74.0

Description

A program to sync files to and from various cloud storage providers

Added to portage

2026-05-03

sabnzbd - 5.0.1
Ebuild name:

net-nntp/sabnzbd-5.0.1

Description

Binary newsgrabber with web-interface

Added to portage

2026-05-03

sccache - 0.15.0
Ebuild name:

dev-util/sccache-0.15.0

Description

ccache/distcc like tool with support for rust and cloud storage

Added to portage

2026-05-03

skim - 4.6.1
Ebuild name:

app-misc/skim-4.6.1

Description

Command-line fuzzy finder

Added to portage

2026-05-03

suricata - 7.0.15-r1
Ebuild name:

net-analyzer/suricata-7.0.15-r1

Description

High performance Network IDS, IPS and Network Security Monitoring e

Added to portage

2026-05-03

system-monitoring-center - 3.4.0
Ebuild name:

sys-apps/system-monitoring-center-3.4.0

Description

Multi-featured system monitor GUI written in Python

Added to portage

2026-05-03

tavern - 3.4.0
Ebuild name:

dev-python/tavern-3.4.0

Description

A tool, library, and Pytest plugin for testing RESTful APIs

Added to portage

2026-05-03

tea - 0.14.0
Ebuild name:

dev-util/tea-0.14.0

Description

Command line tool to interact with Gitea server

Added to portage

2026-05-03

tifffile - 2026.5.2
Ebuild name:

dev-python/tifffile-2026.5.2

Description

Read and write TIFF files

Added to portage

2026-05-03

tox - 4.53.1
Ebuild name:

dev-python/tox-4.53.1

Description

virtualenv-based automation of test activities

Added to portage

2026-05-03

transient - 0.13.2
Ebuild name:

app-emacs/transient-0.13.2

Description

Transient commands abstraction for GNU Emacs

Added to portage

2026-05-03

unbound - 1.25.0
Ebuild name:

net-dns/unbound-1.25.0

Description

A validating, recursive and caching DNS resolver

Added to portage

2026-05-03

wcwidth - 0.7.0
Ebuild name:

dev-python/wcwidth-0.7.0

Description

Measures number of Terminal column cells of wide-character codes

Added to portage

2026-05-03

whipper - 0.10.0-r4
Ebuild name:

media-sound/whipper-0.10.0-r4

Description

A Python CD-DA ripper preferring accuracy over speed (forked from mor

Added to portage

2026-05-03

xterm - 410
Ebuild name:

x11-terms/xterm-410

Description

Terminal Emulator for X Windows

Added to portage

2026-05-03

rdf newsfeed | rss newsfeed | Atom newsfeed
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
- Copyright and legal notices -
Time to create this page: 62.6 ms