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:

87912

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-24
dist-kernel - 6.1.184
Ebuild name:

virtual/dist-kernel-6.1.184

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-24

dist-kernel - 6.12.105
Ebuild name:

virtual/dist-kernel-6.12.105

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-24

dist-kernel - 6.18.46
Ebuild name:

virtual/dist-kernel-6.18.46

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-24

dist-kernel - 6.6.153
Ebuild name:

virtual/dist-kernel-6.6.153

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-24

dist-kernel - 7.1.10
Ebuild name:

virtual/dist-kernel-7.1.10

Description

Virtual to depend on any Distribution Kernel

Added to portage

2026-08-24

drumstick - 2.11.1
Ebuild name:

media-sound/drumstick-2.11.1

Description

Qt/C++ wrapper for ALSA sequencer

Added to portage

2026-08-24

evdev - 2.0.0
Ebuild name:

dev-python/evdev-2.0.0

Description

Python library for evdev bindings

Added to portage

2026-08-24

filelock - 3.32.4
Ebuild name:

dev-python/filelock-3.32.4

Description

A platform independent file lock for Python

Added to portage

2026-08-24

gentoo-kernel - 6.1.184
Ebuild name:

sys-kernel/gentoo-kernel-6.1.184

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel - 6.12.105
Ebuild name:

sys-kernel/gentoo-kernel-6.12.105

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel - 6.18.46
Ebuild name:

sys-kernel/gentoo-kernel-6.18.46

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel - 6.6.153
Ebuild name:

sys-kernel/gentoo-kernel-6.6.153

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel - 7.1.10
Ebuild name:

sys-kernel/gentoo-kernel-7.1.10

Description

Linux kernel built with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-bin - 6.1.184
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.184

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-bin - 6.12.105
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.105

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-bin - 6.18.46
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.18.46

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-bin - 6.6.153
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.153

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-bin - 7.1.10
Ebuild name:

sys-kernel/gentoo-kernel-bin-7.1.10

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2026-08-24

gentoo-kernel-modprep - 6.1.184
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.1.184

Description

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

Added to portage

2026-08-24

gentoo-kernel-modprep - 6.12.105
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.12.105

Description

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

Added to portage

2026-08-24

gentoo-kernel-modprep - 6.18.46
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.18.46

Description

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

Added to portage

2026-08-24

gentoo-kernel-modprep - 6.6.153
Ebuild name:

sys-kernel/gentoo-kernel-modprep-6.6.153

Description

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

Added to portage

2026-08-24

gentoo-kernel-modprep - 7.1.10
Ebuild name:

sys-kernel/gentoo-kernel-modprep-7.1.10

Description

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

Added to portage

2026-08-24

nh3 - 0.3.7
Ebuild name:

dev-python/nh3-0.3.7

Description

Ammonia HTML sanitizer Python binding

Added to portage

2026-08-24

oct2py - 6.1.1
Ebuild name:

dev-python/oct2py-6.1.1

Description

Python to GNU Octave bridge

Added to portage

2026-08-24

pypdf - 6.16.2
Ebuild name:

dev-python/pypdf-6.16.2

Description

Python library to work with PDF files

Added to portage

2026-08-24

sphinx-autoapi - 3.8.1
Ebuild name:

dev-python/sphinx-autoapi-3.8.1

Description

A new approach to API documentation in Sphinx

Added to portage

2026-08-24

tellico - 4.2.2
Ebuild name:

kde-misc/tellico-4.2.2

Description

Collection manager based on KDE Frameworks

Added to portage

2026-08-24

vanilla-kernel - 6.1.184
Ebuild name:

sys-kernel/vanilla-kernel-6.1.184

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-24

vanilla-kernel - 6.12.105
Ebuild name:

sys-kernel/vanilla-kernel-6.12.105

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-24

vanilla-kernel - 6.18.46
Ebuild name:

sys-kernel/vanilla-kernel-6.18.46

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-24

vanilla-kernel - 6.6.153
Ebuild name:

sys-kernel/vanilla-kernel-6.6.153

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-24

vanilla-kernel - 7.1.10
Ebuild name:

sys-kernel/vanilla-kernel-7.1.10

Description

Linux kernel built from vanilla upstream sources

Added to portage

2026-08-24

xwaylandvideobridge - 0.5.2
Ebuild name:

gui-apps/xwaylandvideobridge-0.5.2

Description

Screenshare Wayland windows to XWayland apps

Added to portage

2026-08-24

2026-08-23
bitwarden-cli-bin - 2026.8.0
Ebuild name:

app-admin/bitwarden-cli-bin-2026.8.0

Description

CLI client for Bitwarden compatible servers

Added to portage

2026-08-23

candy - 6.1.11
Ebuild name:

net-vpn/candy-6.1.11

Description

A reliable, low-latency, and anti-censorship virtual private network

Added to portage

2026-08-23

cloudflared - 2026.8.2
Ebuild name:

net-vpn/cloudflared-2026.8.2

Description

A command-line client and tunneling daemon for Cloudflare Tunnel

Added to portage

2026-08-23

cmd2 - 4.2.1
Ebuild name:

dev-python/cmd2-4.2.1

Description

Extra features for standard library's cmd module

Added to portage

2026-08-23

cudd - 3.0.0-r3
Ebuild name:

sci-mathematics/cudd-3.0.0-r3

Description

Colorado University binary Decision Diagram library

Added to portage

2026-08-23

dsfmt - 2.2.5
Ebuild name:

sci-mathematics/dsfmt-2.2.5

Description

Double precision SIMD-oriented Fast Mersenne Twister library

Added to portage

2026-08-23

fig2dev - 3.2.9a-r1
Ebuild name:

media-gfx/fig2dev-3.2.9a-r1

Description

Set of tools for creating TeX documents with graphics

Added to portage

2026-08-23

filezilla - 3.71.0
Ebuild name:

net-ftp/filezilla-3.71.0

Description

FTP client with lots of useful features and an intuitive interface

Added to portage

2026-08-23

fzssh - 1.4.0
Ebuild name:

net-libs/fzssh-1.4.0

Description

A SSH/SFTP library based on libfilezilla

Added to portage

2026-08-23

gentoo-sources - 6.1.184
Ebuild name:

sys-kernel/gentoo-sources-6.1.184

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-23

gentoo-sources - 6.12.105
Ebuild name:

sys-kernel/gentoo-sources-6.12.105

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-23

gentoo-sources - 6.18.46
Ebuild name:

sys-kernel/gentoo-sources-6.18.46

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-23

gentoo-sources - 6.6.153
Ebuild name:

sys-kernel/gentoo-sources-6.6.153

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-23

gentoo-sources - 7.1.10
Ebuild name:

sys-kernel/gentoo-sources-7.1.10

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2026-08-23

ggml - 0.21.0-r1
Ebuild name:

sci-ml/ggml-0.21.0-r1

Description

Tensor library for machine learning

Added to portage

2026-08-23

gitea - 1.27.2
Ebuild name:

www-apps/gitea-1.27.2

Description

A painless self-hosted Git service

Added to portage

2026-08-23

h2o - 2.3.0_pre20260804
Ebuild name:

www-servers/h2o-2.3.0_pre20260804

Description

H2O - the optimized HTTP/1, HTTP/2 server

Added to portage

2026-08-23

labwc - 0.20.2
Ebuild name:

gui-wm/labwc-0.20.2

Description

Openbox alternative for wayland

Added to portage

2026-08-23

lego - 5.4.0
Ebuild name:

app-crypt/lego-5.4.0

Description

Let's Encrypt/ACME client (like certbot or acme.sh) and library written in Go

Added to portage

2026-08-23

libfilezilla - 0.57.0
Ebuild name:

dev-libs/libfilezilla-0.57.0

Description

C++ library offering some basic functionality for platform-independent

Added to portage

2026-08-23

lsp-docker - 1.0.0_p20240327
Ebuild name:

app-emacs/lsp-docker-1.0.0_p20240327

Description

Emacs library to leverage lsp-mode in the Docker environment

Added to portage

2026-08-23

lsp-java - 3.1_p20240328-r1
Ebuild name:

app-emacs/lsp-java-3.1_p20240328-r1

Description

Emacs Java IDE using Eclipse JDT Language Server

Added to portage

2026-08-23

moto - 5.2.3
Ebuild name:

dev-python/moto-5.2.3

Description

Mock library for boto

Added to portage

2026-08-23

pymdown-extensions - 11.0.2
Ebuild name:

dev-python/pymdown-extensions-11.0.2

Description

Extensions for Python Markdown

Added to portage

2026-08-23

ryzen_smu - 0.1.5-r1
Ebuild name:

app-admin/ryzen_smu-0.1.5-r1

Description

Kernel driver for AMD Ryzen's System Management Unit

Added to portage

2026-08-23

s2geometry - 0.13.1-r3
Ebuild name:

sci-geosciences/s2geometry-0.13.1-r3

Description

Computational geometry and spatial indexing on the sphere

Added to portage

2026-08-23

shadowsocks-libev - 3.3.6-r1
Ebuild name:

net-proxy/shadowsocks-libev-3.3.6-r1

Description

A lightweight secured SOCKS5 proxy for embedded devices and lo

Added to portage

2026-08-23

slack - 4.51.191
Ebuild name:

net-im/slack-4.51.191

Description

Team collaboration tool

Added to portage

2026-08-23

smcipmitool - 2.31.0.260727
Ebuild name:

sys-apps/smcipmitool-2.31.0.260727

Description

An out-of-band utility for interfacing with SuperBlade and IPMI

Added to portage

2026-08-23

sqlite - 3.53.4
Ebuild name:

dev-db/sqlite-3.53.4

Description

SQL database engine

Added to portage

2026-08-23

syrupy - 6.0.0
Ebuild name:

dev-python/syrupy-6.0.0

Description

The sweeter pytest snapshot plugin

Added to portage

2026-08-23

telegram-desktop-bin - 7.1.1
Ebuild name:

net-im/telegram-desktop-bin-7.1.1

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-08-23

turbovnc - 3.3.1
Ebuild name:

net-misc/turbovnc-3.3.1

Description

A fast replacement for TigerVNC

Added to portage

2026-08-23

vanilla-sources - 6.1.184
Ebuild name:

sys-kernel/vanilla-sources-6.1.184

Description

Full sources for the Linux kernel

Added to portage

2026-08-23

vanilla-sources - 6.12.105
Ebuild name:

sys-kernel/vanilla-sources-6.12.105

Description

Full sources for the Linux kernel

Added to portage

2026-08-23

vanilla-sources - 6.18.46
Ebuild name:

sys-kernel/vanilla-sources-6.18.46

Description

Full sources for the Linux kernel

Added to portage

2026-08-23

vanilla-sources - 6.6.153
Ebuild name:

sys-kernel/vanilla-sources-6.6.153

Description

Full sources for the Linux kernel

Added to portage

2026-08-23

vanilla-sources - 7.1.10
Ebuild name:

sys-kernel/vanilla-sources-7.1.10

Description

Full sources for the Linux kernel

Added to portage

2026-08-23

vaultwarden - 1.37.2
Ebuild name:

app-admin/vaultwarden-1.37.2

Description

Unofficial Bitwarden compatible password manager

Added to portage

2026-08-23

vaultwarden-web - 2026.7.0
Ebuild name:

www-apps/vaultwarden-web-2026.7.0

Description

Prebuilt web vault frontend for Vaultwarden

Added to portage

2026-08-23

vopono - 0.10.21
Ebuild name:

net-vpn/vopono-0.10.21

Description

Launch applications via VPN tunnels using temporary network namespaces

Added to portage

2026-08-23

wayfire-plugins-extra - 0.11.2
Ebuild name:

gui-libs/wayfire-plugins-extra-0.11.2

Description

extra plugins for wayfire

Added to portage

2026-08-23

wcm - 0.11.0
Ebuild name:

gui-apps/wcm-0.11.0

Description

Wayfire Config Manager

Added to portage

2026-08-23

wf-shell - 0.11.0
Ebuild name:

gui-apps/wf-shell-0.11.0

Description

Compiz like 3D wayland compositor

Added to portage

2026-08-23

wine-staging - 11.16
Ebuild name:

app-emulation/wine-staging-11.16

Description

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

Added to portage

2026-08-23

zellij - 0.45.0
Ebuild name:

app-misc/zellij-0.45.0

Description

A terminal workspace with batteries included

Added to portage

2026-08-23

zfs - 2.2.11
Ebuild name:

sys-fs/zfs-2.2.11

Description

Userland utilities for ZFS Linux kernel module

Added to portage

2026-08-23

zfs - 2.3.9
Ebuild name:

sys-fs/zfs-2.3.9

Description

Userland utilities for ZFS Linux kernel module

Added to portage

2026-08-23

zfs - 2.4.4
Ebuild name:

sys-fs/zfs-2.4.4

Description

Linux kernel module and userland utilities for ZFS

Added to portage

2026-08-23

zfs-kmod - 2.2.11
Ebuild name:

sys-fs/zfs-kmod-2.2.11

Description

Linux ZFS kernel module for sys-fs/zfs

Added to portage

2026-08-23

zfs-kmod - 2.3.9
Ebuild name:

sys-fs/zfs-kmod-2.3.9

Description

Linux ZFS kernel module for sys-fs/zfs

Added to portage

2026-08-23

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