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:

84108

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-03-31
awscli - 1.44.69
Ebuild name:

app-admin/awscli-1.44.69

Description

Universal Command Line Environment for AWS

Added to portage

2026-03-31

bash - 5.3_p9-r1
Ebuild name:

app-shells/bash-5.3_p9-r1

Description

The standard GNU Bourne again shell

Added to portage

2026-03-31

bash - 5.4_alpha_pre20251202-r1
Ebuild name:

app-shells/bash-5.4_alpha_pre20251202-r1

Description

The standard GNU Bourne again shell

Added to portage

2026-03-31

bcachefs-tools - 1.37.4
Ebuild name:

sys-fs/bcachefs-tools-1.37.4

Description

Tools for bcachefs

Added to portage

2026-03-31

blake3 - 1.8.4
Ebuild name:

dev-libs/blake3-1.8.4

Description

a fast cryptographic hash function

Added to portage

2026-03-31

blessed - 1.38.0
Ebuild name:

dev-python/blessed-1.38.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2026-03-31

boto3 - 1.42.79
Ebuild name:

dev-python/boto3-1.42.79

Description

The AWS SDK for Python

Added to portage

2026-03-31

botocore - 1.42.79
Ebuild name:

dev-python/botocore-1.42.79

Description

Low-level, data-driven core of boto 3

Added to portage

2026-03-31

chrome-binary-plugins - 148.0.7753.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-148.0.7753.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-03-31

chromium - 148.0.7753.0
Ebuild name:

www-client/chromium-148.0.7753.0

Description

Open-source version of Google Chrome web browser

Added to portage

2026-03-31

claws-mail - 4.4.0
Ebuild name:

mail-client/claws-mail-4.4.0

Description

An email client (and news reader) based on GTK+

Added to portage

2026-03-31

discid - 1.4.0
Ebuild name:

dev-python/discid-1.4.0

Description

Python bindings for libdiscid

Added to portage

2026-03-31

easy-rsa - 3.2.6
Ebuild name:

app-crypt/easy-rsa-3.2.6

Description

Small RSA key management package, based on OpenSSL

Added to portage

2026-03-31

evisum - 1.2.0
Ebuild name:

sys-process/evisum-1.2.0

Description

System and process monitor written with EFL

Added to portage

2026-03-31

exaile - 4.2.2
Ebuild name:

media-sound/exaile-4.2.2

Description

GTK+ based media player aiming to be similar to Amarok

Added to portage

2026-03-31

faker - 40.12.0
Ebuild name:

dev-python/faker-40.12.0

Description

A Python package that generates fake data for you

Added to portage

2026-03-31

gajim - 2.4.5
Ebuild name:

net-im/gajim-2.4.5

Description

GTK XMPP Client

Added to portage

2026-03-31

google-api-core - 2.30.1
Ebuild name:

dev-python/google-api-core-2.30.1

Description

Core Library for Google Client Libraries

Added to portage

2026-03-31

google-auth-httplib2 - 0.3.1
Ebuild name:

dev-python/google-auth-httplib2-0.3.1

Description

httplib2 Transport for Google Auth

Added to portage

2026-03-31

google-auth-oauthlib - 1.3.1
Ebuild name:

dev-python/google-auth-oauthlib-1.3.1

Description

Google Authentication Library

Added to portage

2026-03-31

google-chrome-unstable - 148.0.7753.0
Ebuild name:

www-client/google-chrome-unstable-148.0.7753.0

Description

The web browser from Google

Added to portage

2026-03-31

gr-fosphor - 0.0_p20260330
Ebuild name:

net-analyzer/gr-fosphor-0.0_p20260330

Description

gnuradio fosphor block (GPU spectrum display)

Added to portage

2026-03-31

grpcio - 1.80.0
Ebuild name:

dev-python/grpcio-1.80.0

Description

HTTP/2-based RPC framework

Added to portage

2026-03-31

grpcio-status - 1.80.0
Ebuild name:

dev-python/grpcio-status-1.80.0

Description

Reference package for GRPC Python status proto mapping

Added to portage

2026-03-31

gshisen - 1.3.0-r3
Ebuild name:

gnustep-apps/gshisen-1.3.0-r3

Description

The first GNUstep game, similar to Mahjongg

Added to portage

2026-03-31

just - 1.48.1
Ebuild name:

dev-build/just-1.48.1

Description

Just a command runner (with syntax inspired by 'make')

Added to portage

2026-03-31

krita - 6.0.1
Ebuild name:

media-gfx/krita-6.0.1

Description

Free digital painting application. Digital Painting, Creative Freedom

Added to portage

2026-03-31

libetpan - 1.9.4-r3
Ebuild name:

net-libs/libetpan-1.9.4-r3

Description

A portable, efficient middleware for different kinds of mail access

Added to portage

2026-03-31

luv - 1.52.1.0
Ebuild name:

dev-lua/luv-1.52.1.0

Description

Bare libuv bindings for lua

Added to portage

2026-03-31

mew - 6.8_p20230203
Ebuild name:

app-emacs/mew-6.8_p20230203

Description

Great MIME mail reader for Emacs/XEmacs

Added to portage

2026-03-31

mic-paren - 3.15-r1
Ebuild name:

app-emacs/mic-paren-3.15-r1

Description

Advanced highlighting of matching parentheses

Added to portage

2026-03-31

microsoft-edge - 146.0.3856.84
Ebuild name:

www-client/microsoft-edge-146.0.3856.84

Description

The web browser from Microsoft

Added to portage

2026-03-31

mimalloc - 2.2.7-r1
Ebuild name:

dev-libs/mimalloc-2.2.7-r1

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-31

mimalloc - 3.2.8-r1
Ebuild name:

dev-libs/mimalloc-3.2.8-r1

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-31

mldonkey - 0.0.4b-r2
Ebuild name:

app-emacs/mldonkey-0.0.4b-r2

Description

An Emacs Lisp interface to the MLDonkey core

Added to portage

2026-03-31

mmm-mode - 0.5.11
Ebuild name:

app-emacs/mmm-mode-0.5.11

Description

Enables the user to edit different parts of a file in different major mod

Added to portage

2026-03-31

moccur-edit - 2.16
Ebuild name:

app-emacs/moccur-edit-2.16

Description

An improved interface to color-moccur for editing

Added to portage

2026-03-31

ngspice - 46
Ebuild name:

sci-electronics/ngspice-46

Description

The Next Generation Spice (Electronic Circuit Simulator)

Added to portage

2026-03-31

ntp - 4.2.8_p18-r3
Ebuild name:

net-misc/ntp-4.2.8_p18-r3

Description

Network Time Protocol suite/programs

Added to portage

2026-03-31

pf-sources - 6.19_p4
Ebuild name:

sys-kernel/pf-sources-6.19_p4

Description

Added to portage

2026-03-31

requests - 2.33.1
Ebuild name:

dev-python/requests-2.33.1

Description

HTTP library for human beings

Added to portage

2026-03-31

tree-sitter-lua - 0.5.0
Ebuild name:

dev-libs/tree-sitter-lua-0.5.0

Description

Lua grammar for Tree-sitter

Added to portage

2026-03-31

tree-sitter-markdown - 0.5.3
Ebuild name:

dev-libs/tree-sitter-markdown-0.5.3

Description

Markdown grammar for Tree-sitter

Added to portage

2026-03-31

tree-sitter-vim - 0.8.1
Ebuild name:

dev-libs/tree-sitter-vim-0.8.1

Description

Vimscript grammar for Tree-sitter

Added to portage

2026-03-31

unzip - 6.0_p29-r2
Ebuild name:

app-arch/unzip-6.0_p29-r2

Description

unzipper for pkzip-compressed files

Added to portage

2026-03-31

urwid - 4.0.0
Ebuild name:

dev-python/urwid-4.0.0

Description

Curses-based user interface library for Python

Added to portage

2026-03-31

vcsi - 7.0.17
Ebuild name:

media-video/vcsi-7.0.17

Description

Create thumbnail sheets from video files

Added to portage

2026-03-31

vinyl - 0
Ebuild name:

acct-group/vinyl-0

Description

group for vinyl-cache

Added to portage

2026-03-31

vinyl - 0
Ebuild name:

acct-user/vinyl-0

Description

user for vinyl-cache

Added to portage

2026-03-31

xfce4-terminal - 1.2.0-r1
Ebuild name:

x11-terms/xfce4-terminal-1.2.0-r1

Description

A terminal emulator for the Xfce desktop environment

Added to portage

2026-03-31

2026-03-30
ada - 3.4.4
Ebuild name:

dev-cpp/ada-3.4.4

Description

WHATWG-compliant and fast URL parser written in modern C++

Added to portage

2026-03-30

asterisk - 21.12.2
Ebuild name:

net-misc/asterisk-21.12.2

Description

Asterisk A Modular Open Source PBX System

Added to portage

2026-03-30

atuin - 18.13.5
Ebuild name:

app-shells/atuin-18.13.5

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2026-03-30

bolt - 0.9.11
Ebuild name:

sys-apps/bolt-0.9.11

Description

Userspace system daemon to enable security levels for Thunderbolt 3

Added to portage

2026-03-30

ccache - 4.13.2
Ebuild name:

dev-util/ccache-4.13.2

Description

Fast compiler cache

Added to portage

2026-03-30

cmake - 4.1.5
Ebuild name:

dev-build/cmake-4.1.5

Description

Cross platform Make

Added to portage

2026-03-30

cmake - 4.2.4
Ebuild name:

dev-build/cmake-4.2.4

Description

Cross platform Make

Added to portage

2026-03-30

cmake - 4.3.1
Ebuild name:

dev-build/cmake-4.3.1

Description

Cross platform Make

Added to portage

2026-03-30

cppgir - 2.0_p20260321
Ebuild name:

dev-cpp/cppgir-2.0_p20260321

Description

GObject-Introspection C++ binding wrapper generator

Added to portage

2026-03-30

cyme - 2.3.0
Ebuild name:

sys-apps/cyme-2.3.0

Description

List system USB buses and devices; a modern cross-platform `lsusb`

Added to portage

2026-03-30

edk2 - 202511-r1
Ebuild name:

sys-firmware/edk2-202511-r1

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-03-30

edk2-bin - 202511
Ebuild name:

sys-firmware/edk2-bin-202511

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-03-30

evaluate - 0.4.4
Ebuild name:

sci-ml/evaluate-0.4.4

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

evaluate - 0.4.5
Ebuild name:

sci-ml/evaluate-0.4.5

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

evaluate - 0.4.6
Ebuild name:

sci-ml/evaluate-0.4.6

Description

makes evaluating, comparing models and reporting their performance easier

Added to portage

2026-03-30

exfatprogs - 1.3.2
Ebuild name:

sys-fs/exfatprogs-1.3.2

Description

Userspace utilities for the exFAT filesystem

Added to portage

2026-03-30

fcft - 3.3.3
Ebuild name:

media-libs/fcft-3.3.3

Description

Simple library for font loading and glyph rasterization

Added to portage

2026-03-30

firecracker-bin - 1.15.0
Ebuild name:

app-emulation/firecracker-bin-1.15.0

Description

Secure and fast microVMs for serverless computing (static buil

Added to portage

2026-03-30

fuse - 3.18.2
Ebuild name:

sys-fs/fuse-3.18.2

Description

An interface for filesystems implemented in userspace

Added to portage

2026-03-30

gcc - 16.0.1_p20260329
Ebuild name:

sys-devel/gcc-16.0.1_p20260329

Description

The GNU Compiler Collection

Added to portage

2026-03-30

git-sources - 7.0_rc6
Ebuild name:

sys-kernel/git-sources-7.0_rc6

Description

The very latest -git version of the Linux kernel

Added to portage

2026-03-30

grub - 2.14-r4
Ebuild name:

sys-boot/grub-2.14-r4

Description

GNU GRUB boot loader

Added to portage

2026-03-30

inxi - 3.3.40.1
Ebuild name:

sys-apps/inxi-3.3.40.1

Description

The CLI inxi collects and prints hardware and system information

Added to portage

2026-03-30

libpng - 1.6.56
Ebuild name:

media-libs/libpng-1.6.56

Description

Portable Network Graphics library

Added to portage

2026-03-30

mbuffer - 20260301
Ebuild name:

sys-block/mbuffer-20260301

Description

M(easuring)buffer is a replacement for buffer with additional functional

Added to portage

2026-03-30

mdadm - 4.6
Ebuild name:

sys-fs/mdadm-4.6

Description

Tool for running RAID systems - replacement for the raidtools

Added to portage

2026-03-30

mmm-mode - 0.5.11
Ebuild name:

app-emacs/mmm-mode-0.5.11

Description

Enables the user to edit different parts of a file in different major mod

Added to portage

2026-03-30

mocker - 0.5.0
Ebuild name:

app-emacs/mocker-0.5.0

Description

Simple mocking framework for Emacs

Added to portage

2026-03-30

modus-themes - 5.1.0
Ebuild name:

app-emacs/modus-themes-5.1.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-30

nethack - 3.6.7-r1
Ebuild name:

games-roguelike/nethack-3.6.7-r1

Description

The ultimate old-school single player dungeon exploration game

Added to portage

2026-03-30

pylsqpack - 0.3.24
Ebuild name:

dev-python/pylsqpack-0.3.24

Description

Python wrapper for the ls-qpack QPACK library

Added to portage

2026-03-30

pyqt6 - 6.11.0
Ebuild name:

dev-python/pyqt6-6.11.0

Description

Python bindings for the Qt framework

Added to portage

2026-03-30

pyqt6-webengine - 6.11.0
Ebuild name:

dev-python/pyqt6-webengine-6.11.0

Description

Python bindings for QtWebEngine

Added to portage

2026-03-30

qbe - 1.2-r1
Ebuild name:

sys-devel/qbe-1.2-r1

Description

Pure-C embeddable compiler backend

Added to portage

2026-03-30

synapse - 1.150.0
Ebuild name:

net-im/synapse-1.150.0

Description

Reference implementation of Matrix homeserver

Added to portage

2026-03-30

sysvinit - 3.18
Ebuild name:

sys-apps/sysvinit-3.18

Description

/sbin/init - parent of all processes

Added to portage

2026-03-30

tdlib - 1.8.62
Ebuild name:

net-libs/tdlib-1.8.62

Description

Cross-platform library for building Telegram clients

Added to portage

2026-03-30

transformers - 5.3.0
Ebuild name:

sci-ml/transformers-5.3.0

Description

State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow

Added to portage

2026-03-30

winbox - 4.1_rc1
Ebuild name:

app-admin/winbox-4.1_rc1

Description

Management Software for MikroTik RouterOS

Added to portage

2026-03-30

xrootd - 5.9.2
Ebuild name:

net-libs/xrootd-5.9.2

Description

Extended ROOT remote file server

Added to portage

2026-03-30

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