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:

89620

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-10-28
2026-10-27
apparmor - 4.1.8
Ebuild name:

sys-apps/apparmor-4.1.8

Description

Userspace utils and init scripts for the AppArmor application security syst

Added to portage

2026-10-27

apparmor - 5.0.2-r1
Ebuild name:

sys-apps/apparmor-5.0.2-r1

Description

Userspace utils and init scripts for the AppArmor application security s

Added to portage

2026-10-27

apparmor-profiles - 4.1.8
Ebuild name:

sec-policy/apparmor-profiles-4.1.8

Description

A collection of profiles for the AppArmor application security s

Added to portage

2026-10-27

apparmor-utils - 4.1.8
Ebuild name:

sys-apps/apparmor-utils-4.1.8

Description

Additional userspace utils to assist with AppArmor profile management

Added to portage

2026-10-27

aws-c-auth - 1.0.2
Ebuild name:

dev-libs/aws-c-auth-1.0.2

Description

AWS C Auth C99 library implementation of AWS client-side authentication

Added to portage

2026-10-27

aws-c-io - 1.1.1
Ebuild name:

dev-libs/aws-c-io-1.1.1

Description

AWS C IO It handles all IO and TLS work for application protocols

Added to portage

2026-10-27

aws-c-s3 - 1.4.1
Ebuild name:

dev-libs/aws-c-s3-1.4.1

Description

AWS C S3 async library

Added to portage

2026-10-27

binary-orphans - 1.0.6
Ebuild name:

dev-haskell/binary-orphans-1.0.6

Description

Compatibility package for binary; provides instances

Added to portage

2026-10-27

bpftool - 7.7.0-r2
Ebuild name:

dev-util/bpftool-7.7.0-r2

Description

Tool for inspection and simple manipulation of eBPF programs and maps

Added to portage

2026-10-27

bpftool - 7.8.1-r1
Ebuild name:

dev-util/bpftool-7.8.1-r1

Description

Tool for inspection and simple manipulation of eBPF programs and maps

Added to portage

2026-10-27

c-blosc2 - 3.4.0
Ebuild name:

dev-libs/c-blosc2-3.4.0

Description

Blocking, shuffling and lossless compression library

Added to portage

2026-10-27

cachetools - 7.2.6
Ebuild name:

dev-python/cachetools-7.2.6

Description

Extensible memoizing collections and decorators

Added to portage

2026-10-27

closure-compiler-bin - 20261021
Ebuild name:

dev-lang/closure-compiler-bin-20261021

Description

JavaScript optimizing compiler

Added to portage

2026-10-27

cloudflared - 2026.10.4
Ebuild name:

net-vpn/cloudflared-2026.10.4

Description

A command-line client and tunneling daemon for Cloudflare Tunnel

Added to portage

2026-10-27

dist-kernel - 6.18.59
Ebuild name:

virtual/dist-kernel-6.18.59

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-10-27

dist-kernel - 7.2.13
Ebuild name:

virtual/dist-kernel-7.2.13

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-10-27

django-js-asset - 5.0.0
Ebuild name:

dev-python/django-js-asset-5.0.0

Description

Script tag with additional attributes for django.forms.Media

Added to portage

2026-10-27

dulwich - 1.2.20
Ebuild name:

dev-python/dulwich-1.2.20

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2026-10-27

edk2 - 202608-r1
Ebuild name:

sys-firmware/edk2-202608-r1

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-10-27

edk2-bin - 202408_p1
Ebuild name:

sys-firmware/edk2-bin-202408_p1

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-10-27

edk2-bin - 202608_p1
Ebuild name:

sys-firmware/edk2-bin-202608_p1

Description

TianoCore EDK II UEFI firmware for virtual machines

Added to portage

2026-10-27

firefox - 153.6.0
Ebuild name:

www-client/firefox-153.6.0

Description

Firefox Web Browser

Added to portage

2026-10-27

firefox - 159.0
Ebuild name:

www-client/firefox-159.0

Description

Firefox Web Browser

Added to portage

2026-10-27

firefox-bin - 153.6.0
Ebuild name:

www-client/firefox-bin-153.6.0

Description

Firefox Web Browser

Added to portage

2026-10-27

firefox-bin - 159.0
Ebuild name:

www-client/firefox-bin-159.0

Description

Firefox Web Browser

Added to portage

2026-10-27

firefox-l10n - 153.6.0
Ebuild name:

www-client/firefox-l10n-153.6.0

Description

Firefox Web Browser's translation files

Added to portage

2026-10-27

firefox-l10n - 159.0
Ebuild name:

www-client/firefox-l10n-159.0

Description

Firefox Web Browser's translation files

Added to portage

2026-10-27

fractal - 14.3
Ebuild name:

net-im/fractal-14.3

Description

Matrix messaging app for GNOME written in Rust

Added to portage

2026-10-27

gdbus-codegen - 2.88.4
Ebuild name:

dev-util/gdbus-codegen-2.88.4

Description

GDBus code and documentation generator

Added to portage

2026-10-27

genshi - 0.7.12
Ebuild name:

dev-python/genshi-0.7.12

Description

Python toolkit for stream-based generation of output for the web

Added to portage

2026-10-27

gentoo-kernel - 6.18.59
Ebuild name:

sys-kernel/gentoo-kernel-6.18.59

Description

Linux kernel built with Gentoo patches

Added to portage

2026-10-27

gentoo-kernel - 7.2.13
Ebuild name:

sys-kernel/gentoo-kernel-7.2.13

Description

Linux kernel built with Gentoo patches

Added to portage

2026-10-27

gentoo-kernel-bin - 6.18.59
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.59

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-10-27

gentoo-kernel-bin - 7.2.13
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.2.13

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-10-27

gentoo-kernel-modprep - 6.18.59
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.59

Description

Minimal subset of gentoo-kernel-bin for building modules,

Added to portage

2026-10-27

gentoo-kernel-modprep - 7.2.13
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.2.13

Description

Minimal subset of gentoo-kernel-bin for building modules, f

Added to portage

2026-10-27

gentoo-sources - 6.18.59
Ebuild name:

sys-kernel/gentoo-sources-6.18.59

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-10-27

geopy - 2.5.0
Ebuild name:

sci-geosciences/geopy-2.5.0

Description

Python client for several popular geocoding web services

Added to portage

2026-10-27

gexiv2 - 0.14.7-r2
Ebuild name:

media-libs/gexiv2-0.14.7-r2

Description

GObject-based wrapper around the Exiv2 library

Added to portage

2026-10-27

gexiv2 - 0.16.2-r1
Ebuild name:

media-libs/gexiv2-0.16.2-r1

Description

GObject-based wrapper around the Exiv2 library

Added to portage

2026-10-27

glib - 2.88.4
Ebuild name:

dev-libs/glib-2.88.4

Description

The GLib library of C routines

Added to portage

2026-10-27

glib-utils - 2.88.4
Ebuild name:

dev-util/glib-utils-2.88.4

Description

Build utilities for GLib using projects

Added to portage

2026-10-27

grpcio - 1.85.0
Ebuild name:

dev-python/grpcio-1.85.0

Description

HTTP/2-based RPC framework

Added to portage

2026-10-27

grpcio-status - 1.85.0
Ebuild name:

dev-python/grpcio-status-1.85.0

Description

Reference package for GRPC Python status proto mapping

Added to portage

2026-10-27

highlight-indentation - 0.7.0_p20210221
Ebuild name:

app-emacs/highlight-indentation-0.7.0_p20210221

Description

Minor modes to highlight indentation guides in Emac

Added to portage

2026-10-27

highline - 7.2.2
Ebuild name:

app-emacs/highline-7.2.2

Description

Minor mode to highlight current line in buffer

Added to portage

2026-10-27

hl-todo - 3.9.3
Ebuild name:

app-emacs/hl-todo-3.9.3

Description

Highlight TODO and similar keywords in comments and strings

Added to portage

2026-10-27

hl-todo - 3.9.5
Ebuild name:

app-emacs/hl-todo-3.9.5

Description

Highlight TODO and similar keywords in comments and strings

Added to portage

2026-10-27

jellyfin-bin - 12.4
Ebuild name:

www-apps/jellyfin-bin-12.4

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-10-27

jsonpatch - 1.38
Ebuild name:

dev-python/jsonpatch-1.38

Description

Apply JSON-Patches like http

Added to portage

2026-10-27

jsonpath-ng - 1.14.0
Ebuild name:

dev-python/jsonpath-ng-1.14.0

Description

Python JSONPath Next-Generation

Added to portage

2026-10-27

jsonpointer - 3.6
Ebuild name:

dev-python/jsonpointer-3.6

Description

Identify specific nodes in a JSON document (according to draft 08)

Added to portage

2026-10-27

libapparmor - 4.1.8
Ebuild name:

sys-libs/libapparmor-4.1.8

Description

Library to support AppArmor userspace utilities

Added to portage

2026-10-27

libheif - 1.23.7
Ebuild name:

media-libs/libheif-1.23.7

Description

ISO/IEC 23008-12 HEIF file format decoder and encoder

Added to portage

2026-10-27

lxml-html-clean - 0.4.6
Ebuild name:

dev-python/lxml-html-clean-0.4.6

Description

Separate project for HTML cleaning functionalities copied from lxm

Added to portage

2026-10-27

mpvqt - 1.2.1
Ebuild name:

media-libs/mpvqt-1.2.1

Description

libmpv wrapper for QtQuick2 and QML

Added to portage

2026-10-27

msgpack - 1.2.4
Ebuild name:

dev-python/msgpack-1.2.4

Description

MessagePack (de)serializer for Python

Added to portage

2026-10-27

networkmanager-openvpn - 1.12.5
Ebuild name:

net-vpn/networkmanager-openvpn-1.12.5

Description

NetworkManager OpenVPN plugin

Added to portage

2026-10-27

openvpn - 2.7.8
Ebuild name:

net-vpn/openvpn-2.7.8

Description

Robust and highly flexible tunneling application compatible with many OSes

Added to portage

2026-10-27

org-mode - 9.8.12
Ebuild name:

app-emacs/org-mode-9.8.12

Description

An Emacs mode for notes and project planning

Added to portage

2026-10-27

pandoc-bin - 3.13
Ebuild name:

app-text/pandoc-bin-3.13

Description

Conversion between markup formats (binary package)

Added to portage

2026-10-27

pdns-recursor - 5.4.9
Ebuild name:

net-dns/pdns-recursor-5.4.9

Description

The PowerDNS Recursor

Added to portage

2026-10-27

pycurl - 7.49.0
Ebuild name:

dev-python/pycurl-7.49.0

Description

Python bindings for curl/libcurl

Added to portage

2026-10-27

pyqt-builder - 1.20.2
Ebuild name:

dev-python/pyqt-builder-1.20.2

Description

The PEP 517 compliant PyQt build system

Added to portage

2026-10-27

pyqt-builder - 1.20.3
Ebuild name:

dev-python/pyqt-builder-1.20.3

Description

The PEP 517 compliant PyQt build system

Added to portage

2026-10-27

qemu - 10.0.10-r2
Ebuild name:

app-emulation/qemu-10.0.10-r2

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.0.14-r1
Ebuild name:

app-emulation/qemu-10.0.14-r1

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.0.7-r2
Ebuild name:

app-emulation/qemu-10.0.7-r2

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.1.3-r3
Ebuild name:

app-emulation/qemu-10.1.3-r3

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.2.2-r2
Ebuild name:

app-emulation/qemu-10.2.2-r2

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.2.3-r1
Ebuild name:

app-emulation/qemu-10.2.3-r1

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.2.3-r3
Ebuild name:

app-emulation/qemu-10.2.3-r3

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 10.2.4-r1
Ebuild name:

app-emulation/qemu-10.2.4-r1

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

qemu - 11.1.2-r1
Ebuild name:

app-emulation/qemu-11.1.2-r1

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-27

ruff - 0.17.3
Ebuild name:

dev-util/ruff-0.17.3

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-10-27

scx - 1.1.4
Ebuild name:

sys-kernel/scx-1.1.4

Description

sched_ext schedulers and tools

Added to portage

2026-10-27

scx-loader - 1.1.3-r1
Ebuild name:

sys-kernel/scx-loader-1.1.3-r1

Description

DBUS on-demand loader of sched-ext schedulers

Added to portage

2026-10-27

simdjson - 5.0.6
Ebuild name:

dev-libs/simdjson-5.0.6

Description

SIMD accelerated C++ JSON library

Added to portage

2026-10-27

sip - 6.17.2
Ebuild name:

dev-python/sip-6.17.2

Description

Python bindings generator for C/C++ libraries

Added to portage

2026-10-27

sqlglot - 30.25.0
Ebuild name:

dev-python/sqlglot-30.25.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-10-27

stripe - 16.0.1
Ebuild name:

dev-python/stripe-16.0.1

Description

Stripe Python bindings

Added to portage

2026-10-27

texlive-core - 2026-r2
Ebuild name:

app-text/texlive-core-2026-r2

Description

A complete TeX distribution

Added to portage

2026-10-27

tmuxp - 1.76.0
Ebuild name:

app-misc/tmuxp-1.76.0

Description

tmux session manager. built on libtmux

Added to portage

2026-10-27

uv - 0.13.6
Ebuild name:

dev-python/uv-0.13.6

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-10-27

uv-build - 0.13.6
Ebuild name:

dev-python/uv-build-0.13.6

Description

PEP517 uv build backend

Added to portage

2026-10-27

vanilla-kernel - 6.18.59
Ebuild name:

sys-kernel/vanilla-kernel-6.18.59

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-10-27

vanilla-kernel - 7.2.13
Ebuild name:

sys-kernel/vanilla-kernel-7.2.13

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-10-27

xdebug - 3.5.3
Ebuild name:

dev-php/xdebug-3.5.3

Description

A PHP debugging and profiling extension

Added to portage

2026-10-27

yt-dlp - 2026.10.26
Ebuild name:

net-misc/yt-dlp-2026.10.26

Description

youtube-dl fork with additional features and fixes

Added to portage

2026-10-27

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