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:

86415

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-06-30
acl - 2.4.0
Ebuild name:

sys-apps/acl-2.4.0

Description

Access control list utilities, libraries, and headers

Added to portage

2026-06-30

attr - 2.6.0
Ebuild name:

sys-apps/attr-2.6.0

Description

Extended attributes tools

Added to portage

2026-06-30

bleachbit - 6.0.0
Ebuild name:

sys-apps/bleachbit-6.0.0

Description

Clean junk to free disk space and to maintain privacy

Added to portage

2026-06-30

burp - 3.3.0
Ebuild name:

app-backup/burp-3.3.0

Description

Network backup and restore client and server for Unix and Windows

Added to portage

2026-06-30

cryptsetup - 2.8.6-r2
Ebuild name:

sys-fs/cryptsetup-2.8.6-r2

Description

Tool to setup encrypted devices with dm-crypt

Added to portage

2026-06-30

element - 1.12.22
Ebuild name:

www-apps/element-1.12.22

Description

A glossy Matrix collaboration client for the web

Added to portage

2026-06-30

endless-sky - 0.11.2
Ebuild name:

games-strategy/endless-sky-0.11.2

Description

Space exploration, trading & combat in the tradition of Termi

Added to portage

2026-06-30

git - 2.55.0
Ebuild name:

dev-vcs/git-2.55.0

Description

Stupid content tracker distributed VCS designed for speed and efficiency

Added to portage

2026-06-30

icinga2 - 2.15.4
Ebuild name:

net-analyzer/icinga2-2.15.4

Description

Distributed, general purpose, network monitoring engine

Added to portage

2026-06-30

icinga2 - 2.16.2
Ebuild name:

net-analyzer/icinga2-2.16.2

Description

Distributed, general purpose, network monitoring engine

Added to portage

2026-06-30

intel-metrics-discovery - 1.16.189
Ebuild name:

dev-libs/intel-metrics-discovery-1.16.189

Description

A user mode library that provides access to GPU performan

Added to portage

2026-06-30

intel-metrics-library - 1.0.234
Ebuild name:

dev-libs/intel-metrics-library-1.0.234

Description

User mode driver helper library that provides access to GPU

Added to portage

2026-06-30

just - 1.54.0
Ebuild name:

dev-build/just-1.54.0

Description

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

Added to portage

2026-06-30

keepassxc - 2.8.0_pre20260629
Ebuild name:

app-admin/keepassxc-2.8.0_pre20260629

Description

KeePassXC - KeePass Cross-platform Community Edition

Added to portage

2026-06-30

magit - 4.5.0-r1
Ebuild name:

app-emacs/magit-4.5.0-r1

Description

A Git porcelain inside Emacs

Added to portage

2026-06-30

mercurial - 7.2.3
Ebuild name:

dev-vcs/mercurial-7.2.3

Description

Scalable distributed SCM

Added to portage

2026-06-30

nextcloud - 32.0.12
Ebuild name:

www-apps/nextcloud-32.0.12

Description

Personal cloud that runs on your own server

Added to portage

2026-06-30

nextcloud - 33.0.6
Ebuild name:

www-apps/nextcloud-33.0.6

Description

Personal cloud that runs on your own server

Added to portage

2026-06-30

nextcloud - 34.0.1
Ebuild name:

www-apps/nextcloud-34.0.1

Description

Personal cloud that runs on your own server

Added to portage

2026-06-30

openpgp-keys-acl - 20260629
Ebuild name:

sec-keys/openpgp-keys-acl-20260629

Description

OpenPGP keys used by sys-apps/acl

Added to portage

2026-06-30

openpgp-keys-bleachbit - 20250910
Ebuild name:

sec-keys/openpgp-keys-bleachbit-20250910

Description

OpenPGP keys used by the BleachBit developer

Added to portage

2026-06-30

platformio - 6.1.19-r2
Ebuild name:

dev-embedded/platformio-6.1.19-r2

Description

An open source ecosystem for IoT development

Added to portage

2026-06-30

redis - 8.2.7
Ebuild name:

dev-db/redis-8.2.7

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-06-30

redis - 8.4.4
Ebuild name:

dev-db/redis-8.4.4

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-06-30

redis - 8.6.4
Ebuild name:

dev-db/redis-8.6.4

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-06-30

redis - 8.8.0
Ebuild name:

dev-db/redis-8.8.0

Description

A persistent caching system, key-value, and data structures database

Added to portage

2026-06-30

rutorrent - 5.3.4
Ebuild name:

www-apps/rutorrent-5.3.4

Description

ruTorrent is a front-end for the popular Bittorrent client rTorrent

Added to portage

2026-06-30

shared-mime-info - 2.5.1
Ebuild name:

x11-misc/shared-mime-info-2.5.1

Description

The Shared MIME-info Database specification

Added to portage

2026-06-30

stellarium - 26.2
Ebuild name:

sci-astronomy/stellarium-26.2

Description

3D photo-realistic skies in real time

Added to portage

2026-06-30

tar - 1.35-r1
Ebuild name:

app-arch/tar-1.35-r1

Description

Use this to make tarballs

Added to portage

2026-06-30

wine-vanilla - 11.12
Ebuild name:

app-emulation/wine-vanilla-11.12

Description

Free implementation of Windows(tm) on Unix, without external patch

Added to portage

2026-06-30

xmlsec - 1.3.12
Ebuild name:

dev-libs/xmlsec-1.3.12

Description

Command line tool for signing, verifying, encrypting and decrypting XML

Added to portage

2026-06-30

zen-sources - 7.1.2
Ebuild name:

sys-kernel/zen-sources-7.1.2

Description

The Zen Kernel Live Sources

Added to portage

2026-06-30

zim - 0.77.0
Ebuild name:

x11-misc/zim-0.77.0

Description

A desktop wiki

Added to portage

2026-06-30

2026-06-29
apscheduler - 3.11.3
Ebuild name:

dev-python/apscheduler-3.11.3

Description

In-process task scheduler with Cron-like capabilities

Added to portage

2026-06-29

botan - 3.12.0
Ebuild name:

dev-libs/botan-3.12.0

Description

C++ crypto library

Added to portage

2026-06-29

bracex - 2.7
Ebuild name:

dev-python/bracex-2.7

Description

Bash style brace expansion for Python

Added to portage

2026-06-29

clang - 23.0.0_pre20260628
Ebuild name:

dev-python/clang-23.0.0_pre20260628

Description

Python bindings for llvm-core/clang

Added to portage

2026-06-29

clang - 23.0.0_pre20260628
Ebuild name:

llvm-core/clang-23.0.0_pre20260628

Description

C language family frontend for LLVM

Added to portage

2026-06-29

clang-common - 23.0.0_pre20260628
Ebuild name:

llvm-core/clang-common-23.0.0_pre20260628

Description

Common files shared between multiple slots of clang

Added to portage

2026-06-29

compiler-rt - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/compiler-rt-23.0.0_pre20260628

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-06-29

compiler-rt-sanitizers - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/compiler-rt-sanitizers-23.0.0_pre20260628

Description

Compiler runtime libraries for clang (sanit

Added to portage

2026-06-29

courier - 2.0.2
Ebuild name:

mail-mta/courier-2.0.2

Description

An MTA designed specifically for maildirs

Added to portage

2026-06-29

courier-authlib - 0.73.1
Ebuild name:

net-libs/courier-authlib-0.73.1

Description

Courier authentication library

Added to portage

2026-06-29

elementpath - 5.1.3
Ebuild name:

dev-python/elementpath-5.1.3

Description

XPath 1.0/2.0 parsers and selectors for ElementTree and lxml

Added to portage

2026-06-29

flang - 23.0.0_pre20260628
Ebuild name:

llvm-core/flang-23.0.0_pre20260628

Description

LLVM's Fortran frontend

Added to portage

2026-06-29

flang-rt - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/flang-rt-23.0.0_pre20260628

Description

LLVM's Fortran runtime

Added to portage

2026-06-29

freecad - 1.1.1
Ebuild name:

media-gfx/freecad-1.1.1

Description

Qt based Computer Aided Design application

Added to portage

2026-06-29

gcc - 17.0.0_p20260628
Ebuild name:

sys-devel/gcc-17.0.0_p20260628

Description

The GNU Compiler Collection

Added to portage

2026-06-29

gdbus-codegen - 2.88.2
Ebuild name:

dev-util/gdbus-codegen-2.88.2

Description

GDBus code and documentation generator

Added to portage

2026-06-29

gentoo-zsh-completions - 20260628.1
Ebuild name:

app-shells/gentoo-zsh-completions-20260628.1

Description

Gentoo specific zsh completion support (includes emerg

Added to portage

2026-06-29

git-sources - 7.2_rc1
Ebuild name:

sys-kernel/git-sources-7.2_rc1

Description

The very latest -git version of the Linux kernel

Added to portage

2026-06-29

glib - 2.88.2
Ebuild name:

dev-libs/glib-2.88.2

Description

The GLib library of C routines

Added to portage

2026-06-29

glib-utils - 2.88.2
Ebuild name:

dev-util/glib-utils-2.88.2

Description

Build utilities for GLib using projects

Added to portage

2026-06-29

glibmm - 2.88.1
Ebuild name:

dev-cpp/glibmm-2.88.1

Description

C++ interface for glib2

Added to portage

2026-06-29

js8call - 3.0.2
Ebuild name:

media-radio/js8call-3.0.2

Description

Weak signal ham radio communication

Added to portage

2026-06-29

kubo - 0.41.0
Ebuild name:

net-p2p/kubo-0.41.0

Description

Main implementation of IPFS

Added to portage

2026-06-29

ldns - 1.9.2
Ebuild name:

net-libs/ldns-1.9.2

Description

Library that aims to simplify DNS programming in C

Added to portage

2026-06-29

libclc - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libclc-23.0.0_pre20260628

Description

OpenCL C library

Added to portage

2026-06-29

libcxx - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libcxx-23.0.0_pre20260628

Description

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

Added to portage

2026-06-29

libcxxabi - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libcxxabi-23.0.0_pre20260628

Description

Low level support for a standard C++ library

Added to portage

2026-06-29

libgcc - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libgcc-23.0.0_pre20260628

Description

Compiler runtime library for clang, compatible with libgcc_

Added to portage

2026-06-29

libtmux - 0.60.0
Ebuild name:

dev-python/libtmux-0.60.0

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2026-06-29

libunwind - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/libunwind-23.0.0_pre20260628

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-06-29

lit - 23.0.0_pre20260628
Ebuild name:

dev-python/lit-23.0.0_pre20260628

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-06-29

lld - 23.0.0_pre20260628
Ebuild name:

llvm-core/lld-23.0.0_pre20260628

Description

The LLVM linker (link editor)

Added to portage

2026-06-29

lldb - 23.0.0_pre20260628
Ebuild name:

llvm-core/lldb-23.0.0_pre20260628

Description

The LLVM debugger

Added to portage

2026-06-29

llvm - 23.0.0_pre20260628
Ebuild name:

dev-ml/llvm-23.0.0_pre20260628

Description

OCaml bindings for LLVM

Added to portage

2026-06-29

llvm - 23.0.0_pre20260628
Ebuild name:

llvm-core/llvm-23.0.0_pre20260628

Description

Low Level Virtual Machine

Added to portage

2026-06-29

llvm-common - 23.0.0_pre20260628
Ebuild name:

llvm-core/llvm-common-23.0.0_pre20260628

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-06-29

mlir - 23.0.0_pre20260628
Ebuild name:

llvm-core/mlir-23.0.0_pre20260628

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-06-29

moor - 2.15.1
Ebuild name:

sys-apps/moor-2.15.1

Description

Pager designed to do the right thing without any configuration

Added to portage

2026-06-29

nghttp3 - 1.17.0
Ebuild name:

net-libs/nghttp3-1.17.0

Description

HTTP/3 library written in C

Added to portage

2026-06-29

ngtcp2 - 1.24.0
Ebuild name:

net-libs/ngtcp2-1.24.0

Description

Implementation of the IETF QUIC Protocol

Added to portage

2026-06-29

ondselsolver - 1.0.1_p20260211
Ebuild name:

sci-libs/ondselsolver-1.0.1_p20260211

Description

Assembly Constraints and Multibody Dynamics code

Added to portage

2026-06-29

openmp - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-23.0.0_pre20260628

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-06-29

openmp-amdgcn-amd-amdhsa - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-amdgcn-amd-amdhsa-23.0.0_pre20260628

Description

OpenMP target library for amdgcn devices

Added to portage

2026-06-29

openmp-nvptx64-nvidia-cuda - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-nvptx64-nvidia-cuda-23.0.0_pre20260628

Description

OpenMP target library for nvptx64 devic

Added to portage

2026-06-29

openmp-spirv64-intel - 23.0.0_pre20260628
Ebuild name:

llvm-runtimes/openmp-spirv64-intel-23.0.0_pre20260628

Description

OpenMP target library for spirv64 Intel devic

Added to portage

2026-06-29

pandas - 3.0.4
Ebuild name:

dev-python/pandas-3.0.4

Description

Powerful data structures for data analysis and statistics

Added to portage

2026-06-29

peewee - 4.1.1
Ebuild name:

dev-python/peewee-4.1.1

Description

Small Python ORM

Added to portage

2026-06-29

polly - 23.0.0_pre20260628
Ebuild name:

llvm-core/polly-23.0.0_pre20260628

Description

Polyhedral optimizations for LLVM

Added to portage

2026-06-29

pyglet - 2.1.15
Ebuild name:

dev-python/pyglet-2.1.15

Description

Cross-platform windowing and multimedia library for Python

Added to portage

2026-06-29

quimup - 2.1.2
Ebuild name:

media-sound/quimup-2.1.2

Description

Qt client for the music player daemon (MPD)

Added to portage

2026-06-29

rebulk - 4.2.2
Ebuild name:

dev-python/rebulk-4.2.2

Description

Python library that performs advanced searches in strings

Added to portage

2026-06-29

regex - 2026.6.28
Ebuild name:

dev-python/regex-2026.6.28

Description

Alternative regular expression module to replace re

Added to portage

2026-06-29

sqlite - 3.53.3
Ebuild name:

dev-db/sqlite-3.53.3

Description

SQL database engine

Added to portage

2026-06-29

squid - 7.6
Ebuild name:

net-proxy/squid-7.6

Description

Full-featured web proxy cache

Added to portage

2026-06-29

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