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:

87642

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-08-14
firewalld - 2.5.1
Ebuild name:

net-firewall/firewalld-2.5.1

Description

Firewall daemon with D-Bus interface providing a dynamic firewall

Added to portage

2026-08-14

lsp-mode - 9999
Ebuild name:

app-emacs/lsp-mode-9999

Description

Emacs client/library for the Language Server Protocol

Added to portage

2026-08-14

ruff - 0.16.3
Ebuild name:

dev-util/ruff-0.16.3

Description

An extremely fast Python linter, written in Rust

Added to portage

2026-08-14

uutils-coreutils - 0.10.0
Ebuild name:

sys-apps/uutils-coreutils-0.10.0

Description

GNU coreutils rewritten in Rust

Added to portage

2026-08-14

2026-08-13
acl - 2.4.0
Ebuild name:

virtual/acl-2.4.0

Description

Virtual for acl support (sys/acl.h)

Added to portage

2026-08-13

aiohttp-socks - 0.12.0
Ebuild name:

dev-python/aiohttp-socks-0.12.0

Description

SOCKS proxy connector for aiohttp

Added to portage

2026-08-13

ansible-compat - 26.8.0
Ebuild name:

dev-python/ansible-compat-26.8.0

Description

Contains functions that facilitate working with various versions o

Added to portage

2026-08-13

apache-arrow - 25.0.1-r1
Ebuild name:

dev-libs/apache-arrow-25.0.1-r1

Description

A cross-language development platform for in-memory data

Added to portage

2026-08-13

bcachefs-tools - 1.39.1
Ebuild name:

sys-fs/bcachefs-tools-1.39.1

Description

Tools for bcachefs

Added to portage

2026-08-13

boto3 - 1.43.70
Ebuild name:

dev-python/boto3-1.43.70

Description

The AWS SDK for Python

Added to portage

2026-08-13

botocore - 1.43.70
Ebuild name:

dev-python/botocore-1.43.70

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-13

bpf-linker - 0.11.0
Ebuild name:

dev-util/bpf-linker-0.11.0

Description

Simple BPF static linker

Added to portage

2026-08-13

braintree - 4.46.0
Ebuild name:

dev-python/braintree-4.46.0

Description

Braintree Python Library

Added to portage

2026-08-13

caffe2 - 2.12.0-r3
Ebuild name:

sci-ml/caffe2-2.12.0-r3

Description

A deep learning framework

Added to portage

2026-08-13

charset-normalizer - 3.5.0
Ebuild name:

dev-python/charset-normalizer-3.5.0

Description

The Real First Universal Charset Detector

Added to portage

2026-08-13

clang - 23.1.0_rc3
Ebuild name:

dev-python/clang-23.1.0_rc3

Description

Python bindings for llvm-core/clang

Added to portage

2026-08-13

clang - 23.1.0_rc3
Ebuild name:

llvm-core/clang-23.1.0_rc3

Description

C language family frontend for LLVM

Added to portage

2026-08-13

clang-common - 23.1.0_rc3
Ebuild name:

llvm-core/clang-common-23.1.0_rc3

Description

Common files shared between multiple slots of clang

Added to portage

2026-08-13

compiler-rt - 23.1.0_rc3
Ebuild name:

llvm-runtimes/compiler-rt-23.1.0_rc3

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-08-13

compiler-rt-sanitizers - 23.1.0_rc3
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.1.0_rc3

Description

Compiler runtime libraries for clang (sanitizers &

Added to portage

2026-08-13

datasets - 5.0.1-r2
Ebuild name:

sci-ml/datasets-5.0.1-r2

Description

Access and share datasets for Audio, Computer Vision, and NLP tasks

Added to portage

2026-08-13

discord - 1.0.153
Ebuild name:

net-im/discord-1.0.153

Description

All-in-one voice and text chat for gamers

Added to portage

2026-08-13

dolphin - 2606a
Ebuild name:

games-emulation/dolphin-2606a

Description

Gamecube and Wii game emulator

Added to portage

2026-08-13

flang - 23.1.0_rc3
Ebuild name:

llvm-core/flang-23.1.0_rc3

Description

LLVM's Fortran frontend

Added to portage

2026-08-13

flang-rt - 23.1.0_rc3
Ebuild name:

llvm-runtimes/flang-rt-23.1.0_rc3

Description

LLVM's Fortran runtime

Added to portage

2026-08-13

flatpak - 1.18.1
Ebuild name:

sys-apps/flatpak-1.18.1

Description

Linux application sandboxing and distribution framework

Added to portage

2026-08-13

glibc - 2.43-r3
Ebuild name:

sys-libs/glibc-2.43-r3

Description

GNU libc C library

Added to portage

2026-08-13

glibc - 2.44-r1
Ebuild name:

sys-libs/glibc-2.44-r1

Description

GNU libc C library

Added to portage

2026-08-13

httpx-socks - 0.13.0
Ebuild name:

dev-python/httpx-socks-0.13.0

Description

Proxy (HTTP, SOCKS) transports for httpx

Added to portage

2026-08-13

hypothesis - 6.165.4
Ebuild name:

dev-python/hypothesis-6.165.4

Description

A library for property based testing

Added to portage

2026-08-13

intel-microcode - 20260812_p20260813
Ebuild name:

sys-firmware/intel-microcode-20260812_p20260813

Description

Intel IA32/IA64 microcode update data

Added to portage

2026-08-13

libclc - 23.1.0_rc3
Ebuild name:

llvm-runtimes/libclc-23.1.0_rc3

Description

OpenCL C library

Added to portage

2026-08-13

libcxx - 23.1.0_rc3
Ebuild name:

llvm-runtimes/libcxx-23.1.0_rc3

Description

New implementation of the C++ standard library, targeting C++11

Added to portage

2026-08-13

libcxxabi - 23.1.0_rc3
Ebuild name:

llvm-runtimes/libcxxabi-23.1.0_rc3

Description

Low level support for a standard C++ library

Added to portage

2026-08-13

libgcc - 23.1.0_rc3
Ebuild name:

llvm-runtimes/libgcc-23.1.0_rc3

Description

Compiler runtime library for clang, compatible with libgcc_s

Added to portage

2026-08-13

liblore - 0.9.0
Ebuild name:

dev-python/liblore-0.9.0

Description

Shared library for public-inbox / lore.kernel.org access

Added to portage

2026-08-13

libunwind - 23.1.0_rc3
Ebuild name:

llvm-runtimes/libunwind-23.1.0_rc3

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-08-13

lit - 23.1.0_rc3
Ebuild name:

dev-python/lit-23.1.0_rc3

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-08-13

lld - 23.1.0_rc3
Ebuild name:

llvm-core/lld-23.1.0_rc3

Description

The LLVM linker (link editor)

Added to portage

2026-08-13

lldb - 23.1.0_rc3
Ebuild name:

llvm-core/lldb-23.1.0_rc3

Description

The LLVM debugger

Added to portage

2026-08-13

llvm - 23.1.0_rc3
Ebuild name:

dev-ml/llvm-23.1.0_rc3

Description

OCaml bindings for LLVM

Added to portage

2026-08-13

llvm - 23.1.0_rc3
Ebuild name:

llvm-core/llvm-23.1.0_rc3

Description

Low Level Virtual Machine

Added to portage

2026-08-13

llvm-common - 23.1.0_rc3
Ebuild name:

llvm-core/llvm-common-23.1.0_rc3

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-08-13

lsp-treemacs - 0.5
Ebuild name:

app-emacs/lsp-treemacs-0.5

Description

Integration between lsp-mode and treemacs

Added to portage

2026-08-13

lsp-ui - 8.0.1
Ebuild name:

app-emacs/lsp-ui-8.0.1

Description

UI modules for lsp-mode

Added to portage

2026-08-13

lsp-ui - 9.0.0
Ebuild name:

app-emacs/lsp-ui-9.0.0

Description

UI modules for lsp-mode

Added to portage

2026-08-13

mattermost-desktop-bin - 6.2.3_rc2
Ebuild name:

net-im/mattermost-desktop-bin-6.2.3_rc2

Description

Mattermost Desktop application

Added to portage

2026-08-13

mattermost-desktop-bin - 6.3.0
Ebuild name:

net-im/mattermost-desktop-bin-6.3.0

Description

Mattermost Desktop application

Added to portage

2026-08-13

mlir - 23.1.0_rc3
Ebuild name:

llvm-core/mlir-23.1.0_rc3

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-08-13

opam - 2.5.2
Ebuild name:

dev-ml/opam-2.5.2

Description

A source-based package manager for OCaml

Added to portage

2026-08-13

opam-common - 2.5.2
Ebuild name:

dev-ml/opam-common-2.5.2

Description

Core libraries for opam

Added to portage

2026-08-13

opam-installer - 2.5.2
Ebuild name:

dev-ml/opam-installer-2.5.2

Description

Core installer for opam packages

Added to portage

2026-08-13

openmp - 23.1.0_rc3
Ebuild name:

llvm-runtimes/openmp-23.1.0_rc3

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-08-13

openmp-amdgcn-amd-amdhsa - 23.1.0_rc3
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.1.0_rc3

Description

OpenMP target library for amdgcn devices

Added to portage

2026-08-13

openmp-nvptx64-nvidia-cuda - 23.1.0_rc3
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.1.0_rc3

Description

OpenMP target library for nvptx64 devices

Added to portage

2026-08-13

openmp-spirv64-intel - 23.1.0_rc3
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.1.0_rc3

Description

OpenMP target library for spirv64 Intel devices

Added to portage

2026-08-13

polly - 23.1.0_rc3
Ebuild name:

llvm-core/polly-23.1.0_rc3

Description

Polyhedral optimizations for LLVM

Added to portage

2026-08-13

pyproject-fmt - 2.27.1
Ebuild name:

dev-python/pyproject-fmt-2.27.1

Description

Format your pyproject.toml file

Added to portage

2026-08-13

pytest-lazy-fixtures - 1.4.1
Ebuild name:

dev-python/pytest-lazy-fixtures-1.4.1

Description

Allows you to use fixtures in @pytest.mark.parametrize

Added to portage

2026-08-13

python - 3.10.21
Ebuild name:

dev-lang/python-3.10.21

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-08-13

python - 3.11.16
Ebuild name:

dev-lang/python-3.11.16

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-08-13

python - 3.12.14
Ebuild name:

dev-lang/python-3.12.14

Description

An interpreted, interactive, object-oriented programming language

Added to portage

2026-08-13

python-discovery - 1.5.2
Ebuild name:

dev-python/python-discovery-1.5.2

Description

Python interpreter discovery

Added to portage

2026-08-13

python-engineio - 4.13.5
Ebuild name:

dev-python/python-engineio-4.13.5

Description

Python implementation of the Engine.IO realtime server

Added to portage

2026-08-13

python-tests - 3.12.14
Ebuild name:

dev-python/python-tests-3.12.14

Description

Test modules from dev-lang/python

Added to portage

2026-08-13

pythran - 0.19.0_rc1
Ebuild name:

dev-python/pythran-0.19.0_rc1

Description

Ahead of Time compiler for numeric kernels

Added to portage

2026-08-13

pyzotero - 1.13.5
Ebuild name:

dev-python/pyzotero-1.13.5

Description

A Python client for the Zotero API

Added to portage

2026-08-13

repo - 2.65
Ebuild name:

dev-vcs/repo-2.65

Description

Google tool for managing git, particularly multiple repos

Added to portage

2026-08-13

root - 6.40.02
Ebuild name:

sci-physics/root-6.40.02

Description

C++ data analysis framework and interpreter from CERN

Added to portage

2026-08-13

rsync - 3.5.0
Ebuild name:

net-misc/rsync-3.5.0

Description

File transfer program to keep remote files into sync

Added to portage

2026-08-13

rw - 0.10
Ebuild name:

sci-mathematics/rw-0.10

Description

Compute rank-width decompositions of graphs

Added to portage

2026-08-13

shadow - 4.20.2
Ebuild name:

sys-apps/shadow-4.20.2

Description

Utilities to deal with user accounts

Added to portage

2026-08-13

sqlglot - 30.17.0
Ebuild name:

dev-python/sqlglot-30.17.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-08-13

types-setuptools - 84.0.0.20260812
Ebuild name:

dev-python/types-setuptools-84.0.0.20260812

Description

Typing stubs for setuptools

Added to portage

2026-08-13

typing-inspection - 0.4.4
Ebuild name:

dev-python/typing-inspection-0.4.4

Description

Runtime typing introspection tools

Added to portage

2026-08-13

uftrace - 0.19
Ebuild name:

dev-util/uftrace-0.19

Description

Function (graph) tracer for user-space

Added to portage

2026-08-13

xrootd - 5.9.7
Ebuild name:

net-libs/xrootd-5.9.7

Description

Extended ROOT remote file server

Added to portage

2026-08-13

xrootd - 6.1.1
Ebuild name:

net-libs/xrootd-6.1.1

Description

Extended ROOT remote file server

Added to portage

2026-08-13

xxhash - 4.0.0
Ebuild name:

dev-python/xxhash-4.0.0

Description

Python binding for the xxHash library

Added to portage

2026-08-13

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