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:

83624

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-09
amazon-ecr-credential-helper - 0.12.0
Ebuild name:

app-containers/amazon-ecr-credential-helper-0.12.0

Description

Automatically gets credentials for Amazon ECR on

Added to portage

2026-03-09

barman - 3.17.0
Ebuild name:

dev-db/barman-3.17.0

Description

Administration tool for disaster recovery of PostgreSQL servers

Added to portage

2026-03-09

binaryornot - 0.6.0
Ebuild name:

dev-python/binaryornot-0.6.0

Description

Ultra-lightweight pure Python package to guess whether a file is binar

Added to portage

2026-03-09

cachetools - 7.0.4
Ebuild name:

dev-python/cachetools-7.0.4

Description

Extensible memoizing collections and decorators

Added to portage

2026-03-09

catch - 3.13.0
Ebuild name:

dev-cpp/catch-3.13.0

Description

Modern C++ header-only framework for unit-tests

Added to portage

2026-03-09

clamav - 0.103.12-r4
Ebuild name:

app-antivirus/clamav-0.103.12-r4

Description

Clam Anti-Virus Scanner

Added to portage

2026-03-09

clamav - 1.4.4
Ebuild name:

app-antivirus/clamav-1.4.4

Description

Clam Anti-Virus Scanner

Added to portage

2026-03-09

clamav - 1.5.2
Ebuild name:

app-antivirus/clamav-1.5.2

Description

Clam Anti-Virus Scanner

Added to portage

2026-03-09

cloudflare-warp - 2026.1.150.0-r1
Ebuild name:

net-vpn/cloudflare-warp-2026.1.150.0-r1

Description

Cloudflare Warp Client

Added to portage

2026-03-09

configargparse - 1.7.3
Ebuild name:

dev-python/configargparse-1.7.3

Description

Drop-in replacement for argparse supporting config files and env va

Added to portage

2026-03-09

cursor-agent - 2026.02.27
Ebuild name:

dev-util/cursor-agent-2026.02.27

Description

Cursor CLI - interact with AI agents directly from your terminal

Added to portage

2026-03-09

dbeaver-bin - 26.0.0
Ebuild name:

dev-db/dbeaver-bin-26.0.0

Description

Free universal database tool (community edition)

Added to portage

2026-03-09

dos2unix - 7.5.4
Ebuild name:

app-text/dos2unix-7.5.4

Description

Convert DOS or MAC text files to UNIX format or vice versa

Added to portage

2026-03-09

drpm - 0.5.3
Ebuild name:

app-arch/drpm-0.5.3

Description

A library for making, reading and applying deltarpm packages

Added to portage

2026-03-09

elasticsearch - 9.3.1
Ebuild name:

app-misc/elasticsearch-9.3.1

Description

Free and Open, Distributed, RESTful Search Engine

Added to portage

2026-03-09

entr - 5.8
Ebuild name:

app-admin/entr-5.8

Description

Run arbitrary commands when files change

Added to portage

2026-03-09

fd - 10.4.1
Ebuild name:

sys-apps/fd-10.4.1

Description

Alternative to find that provides sensible defaults for 80% of the use cases

Added to portage

2026-03-09

freeciv - 3.2.3
Ebuild name:

games-strategy/freeciv-3.2.3

Description

Multiplayer strategy game (Civilization Clone)

Added to portage

2026-03-09

fvwm3 - 1.1.4
Ebuild name:

x11-wm/fvwm3-1.1.4

Description

A multiple large virtual desktop window manager derived from fvwm

Added to portage

2026-03-09

fzf - 0.70.0
Ebuild name:

app-shells/fzf-0.70.0

Description

General-purpose command-line fuzzy finder, written in Golang

Added to portage

2026-03-09

gallery-dl - 1.31.9
Ebuild name:

net-misc/gallery-dl-1.31.9

Description

Download image galleries and collections from several image hosting site

Added to portage

2026-03-09

gcc - 16.0.1_p20260308
Ebuild name:

sys-devel/gcc-16.0.1_p20260308

Description

The GNU Compiler Collection

Added to portage

2026-03-09

gnumeric - 1.12.60
Ebuild name:

app-office/gnumeric-1.12.60

Description

The GNOME Spreadsheet

Added to portage

2026-03-09

goffice - 0.10.60
Ebuild name:

x11-libs/goffice-0.10.60

Description

A library of document-centric objects and utilities

Added to portage

2026-03-09

graphviz - 14.1.3
Ebuild name:

media-gfx/graphviz-14.1.3

Description

Open Source Graph Visualization Software

Added to portage

2026-03-09

groonga - 16.0.0-r1
Ebuild name:

app-text/groonga-16.0.0-r1

Description

An Embeddable Fulltext Search Engine

Added to portage

2026-03-09

joplin-desktop - 3.6.4
Ebuild name:

app-office/joplin-desktop-3.6.4

Description

Secure note taking and to-do app with synchronization capabilities

Added to portage

2026-03-09

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-09

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-09

moarvm - 2026.02
Ebuild name:

dev-lang/moarvm-2026.02

Description

A 6model-based VM for NQP and Raku

Added to portage

2026-03-09

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-09

mocker - 0.5.0
Ebuild name:

app-emacs/mocker-0.5.0

Description

Simple mocking framework for Emacs

Added to portage

2026-03-09

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-09

modus-themes - 5.2.0
Ebuild name:

app-emacs/modus-themes-5.2.0

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-09

modus-themes - 9999
Ebuild name:

app-emacs/modus-themes-9999

Description

Highly accessible themes for GNU Emacs

Added to portage

2026-03-09

mongodb-compass-bin - 1.49.2
Ebuild name:

dev-db/mongodb-compass-bin-1.49.2

Description

GUI for MongoDB

Added to portage

2026-03-09

moto - 5.1.22
Ebuild name:

dev-python/moto-5.1.22

Description

Mock library for boto

Added to portage

2026-03-09

nodejs - 24.14.0
Ebuild name:

net-libs/nodejs-24.14.0

Description

A JavaScript runtime built on Chrome's V8 JavaScript engine

Added to portage

2026-03-09

nqp - 2026.02
Ebuild name:

dev-lang/nqp-2026.02

Description

Not Quite Perl, a Raku bootstrapping compiler

Added to portage

2026-03-09

octave - 11.1.0
Ebuild name:

sci-mathematics/octave-11.1.0

Description

High-level interactive language for numerical computations

Added to portage

2026-03-09

openpace - 1.1.4
Ebuild name:

dev-libs/openpace-1.1.4

Description

Cryptographic library for EAC version 2

Added to portage

2026-03-09

pipewire - 1.6.1
Ebuild name:

media-video/pipewire-1.6.1

Description

Multimedia processing graphs

Added to portage

2026-03-09

rakudo - 2026.02
Ebuild name:

dev-lang/rakudo-2026.02

Description

A compiler for the Raku programming language

Added to portage

2026-03-09

robin-map - 1.4.1
Ebuild name:

dev-cpp/robin-map-1.4.1

Description

C++ fast hash map and hash set using robin hood hashing

Added to portage

2026-03-09

sdl3-image - 3.4.0
Ebuild name:

media-libs/sdl3-image-3.4.0

Description

A simple library to load images of various formats as SDL surfaces.

Added to portage

2026-03-09

sdl3-mixer - 3.1.2_rc1
Ebuild name:

media-libs/sdl3-mixer-3.1.2_rc1

Description

Simple Direct Media Layer Mixer Library

Added to portage

2026-03-09

spectacle - 6.6.2-r1
Ebuild name:

kde-plasma/spectacle-6.6.2-r1

Description

Screenshot capture utility

Added to portage

2026-03-09

sphinx-autoapi - 3.8.0
Ebuild name:

dev-python/sphinx-autoapi-3.8.0

Description

A new approach to API documentation in Sphinx

Added to portage

2026-03-09

ugrd - 2.2.0
Ebuild name:

sys-kernel/ugrd-2.2.0

Description

Python based POSIX initramfs generator with TOML definitions

Added to portage

2026-03-09

zchunk - 1.5.3
Ebuild name:

app-arch/zchunk-1.5.3

Description

File format designed for highly efficient deltas with good compression

Added to portage

2026-03-09

2026-03-08
bibutils - 7.2
Ebuild name:

app-text/bibutils-7.2

Description

Interconverts between various bibliography formats using common XML intermedi

Added to portage

2026-03-08

django-polymorphic - 4.11.2
Ebuild name:

dev-python/django-polymorphic-4.11.2

Description

Seamless Polymorphic Inheritance for Django Models

Added to portage

2026-03-08

doxygen - 1.16.1
Ebuild name:

app-text/doxygen-1.16.1

Description

Documentation system for most programming languages

Added to portage

2026-03-08

e2fsprogs - 1.47.4
Ebuild name:

sys-fs/e2fsprogs-1.47.4

Description

Standard EXT2/EXT3/EXT4 filesystem utilities

Added to portage

2026-03-08

fpylll - 0.6.4-r1
Ebuild name:

dev-python/fpylll-0.6.4-r1

Description

Python bindings for sci-libs/fplll

Added to portage

2026-03-08

gcc - 15.2.1_p20260307
Ebuild name:

sys-devel/gcc-15.2.1_p20260307

Description

The GNU Compiler Collection

Added to portage

2026-03-08

gnome-shell-extension-weather-oclock - 50.0
Ebuild name:

gnome-extra/gnome-shell-extension-weather-oclock-50.0

Description

Display the current weather inside the pill n

Added to portage

2026-03-08

jaraco-context - 6.1.1
Ebuild name:

dev-python/jaraco-context-6.1.1

Description

Context managers by jaraco

Added to portage

2026-03-08

kokkos - 5.0.2
Ebuild name:

dev-cpp/kokkos-5.0.2

Description

C++ Performance Portability Programming EcoSystem

Added to portage

2026-03-08

kup - 0.3.6-r5
Ebuild name:

dev-util/kup-0.3.6-r5

Description

kernel.org uploader tool

Added to portage

2026-03-08

libtmux - 0.55.0
Ebuild name:

dev-python/libtmux-0.55.0

Description

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

Added to portage

2026-03-08

libvirt - 12.1.0-r1
Ebuild name:

app-emulation/libvirt-12.1.0-r1

Description

C toolkit to manipulate virtual machines

Added to portage

2026-03-08

lutris - 0.5.19-r1
Ebuild name:

games-util/lutris-0.5.19-r1

Description

An open source gaming platform for GNU/Linux

Added to portage

2026-03-08

lutris - 0.5.20-r1
Ebuild name:

games-util/lutris-0.5.20-r1

Description

An open source gaming platform for GNU/Linux

Added to portage

2026-03-08

lutris - 0.5.22-r1
Ebuild name:

games-util/lutris-0.5.22-r1

Description

An open source gaming platform for GNU/Linux

Added to portage

2026-03-08

mac-fdisk - 0.1_p18-r2
Ebuild name:

sys-fs/mac-fdisk-0.1_p18-r2

Description

Mac/PowerMac disk partitioning utility

Added to portage

2026-03-08

mercurial - 7.2-r1
Ebuild name:

dev-vcs/mercurial-7.2-r1

Description

Scalable distributed SCM

Added to portage

2026-03-08

mgorny-dev-scripts - 67
Ebuild name:

app-portage/mgorny-dev-scripts-67

Description

Handy scripts for ebuild development and more

Added to portage

2026-03-08

mimalloc - 2.2.7
Ebuild name:

dev-libs/mimalloc-2.2.7

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-08

mimalloc - 3.2.8
Ebuild name:

dev-libs/mimalloc-3.2.8

Description

A compact general purpose allocator with excellent performance

Added to portage

2026-03-08

mold - 2.40.4-r2
Ebuild name:

sys-devel/mold-2.40.4-r2

Description

A Modern Linker

Added to portage

2026-03-08

onlyoffice-bin - 9.3.1
Ebuild name:

app-office/onlyoffice-bin-9.3.1

Description

A free and open source office and productivity suite (binary versio

Added to portage

2026-03-08

petsc - 3.24.5
Ebuild name:

sci-mathematics/petsc-3.24.5

Description

Portable, Extensible Toolkit for Scientific Computation

Added to portage

2026-03-08

plasma-meta - 6.6.0-r1
Ebuild name:

kde-plasma/plasma-meta-6.6.0-r1

Description

Merge this to pull in all Plasma 6 packages

Added to portage

2026-03-08

plasma-meta - 6.6.2-r1
Ebuild name:

kde-plasma/plasma-meta-6.6.2-r1

Description

Merge this to pull in all Plasma 6 packages

Added to portage

2026-03-08

pyspellchecker - 0.9.0
Ebuild name:

dev-python/pyspellchecker-0.9.0

Description

Pure python spell checker based on work by Peter Norvig

Added to portage

2026-03-08

ristretto - 0.14.0
Ebuild name:

media-gfx/ristretto-0.14.0

Description

A fast and lightweight picture viewer for Xfce

Added to portage

2026-03-08

slepc - 3.24.2
Ebuild name:

sci-mathematics/slepc-3.24.2

Description

Scalable Library for Eigenvalue Problem Computations

Added to portage

2026-03-08

trilinos - 17.0.0
Ebuild name:

sci-libs/trilinos-17.0.0

Description

Scientific library collection for large scale problems

Added to portage

2026-03-08

upmpdcli - 1.9.14
Ebuild name:

media-sound/upmpdcli-1.9.14

Description

UPnP Media Renderer front-end for MPD, the Music Player Daemon

Added to portage

2026-03-08

wine-staging - 11.4
Ebuild name:

app-emulation/wine-staging-11.4

Description

Free implementation of Windows(tm) on Unix, with Wine-Staging patch

Added to portage

2026-03-08

wsjtx_improved - 3.1.0
Ebuild name:

media-radio/wsjtx_improved-3.1.0

Description

Weak signal ham radio communication with improvements

Added to portage

2026-03-08

xfce4-terminal - 1.2.0
Ebuild name:

x11-terms/xfce4-terminal-1.2.0

Description

A terminal emulator for the Xfce desktop environment

Added to portage

2026-03-08

xpadneo - 0.10
Ebuild name:

games-util/xpadneo-0.10

Description

Advanced Linux Driver for Xbox One Wireless Controller

Added to portage

2026-03-08

zmac - 1.3-r2
Ebuild name:

dev-embedded/zmac-1.3-r2

Description

Z80 macro cross-assembler

Added to portage

2026-03-08

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