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:

87356

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-02
cachetools - 7.1.7
Ebuild name:

dev-python/cachetools-7.1.7

Description

Extensible memoizing collections and decorators

Added to portage

2026-08-02

cbor2 - 6.1.4
Ebuild name:

dev-python/cbor2-6.1.4

Description

CBOR (de)serializer with extensive tag support

Added to portage

2026-08-02

cloudflared - 2026.7.3
Ebuild name:

net-vpn/cloudflared-2026.7.3

Description

A command-line client and tunneling daemon for Cloudflare Tunnel

Added to portage

2026-08-02

cpuinfo - 2026.04.13
Ebuild name:

dev-libs/cpuinfo-2026.04.13

Description

CPU INFOrmation library

Added to portage

2026-08-02

django-polymorphic - 4.11.7
Ebuild name:

dev-python/django-polymorphic-4.11.7

Description

Seamless Polymorphic Inheritance for Django Models

Added to portage

2026-08-02

glibc - 2.44.9999
Ebuild name:

sys-libs/glibc-2.44.9999

Description

GNU libc C library

Added to portage

2026-08-02

hypothesis - 6.165.0
Ebuild name:

dev-python/hypothesis-6.165.0

Description

A library for property based testing

Added to portage

2026-08-02

mame - 0.289-r1
Ebuild name:

games-emulation/mame-0.289-r1

Description

Multiple Arcade Machine Emulator

Added to portage

2026-08-02

mirrorselect - 2.7.0
Ebuild name:

app-portage/mirrorselect-2.7.0

Description

Tool to help select distfiles mirrors for Gentoo

Added to portage

2026-08-02

netpbm - 11.2.27
Ebuild name:

media-libs/netpbm-11.2.27

Description

A set of utilities for converting to/from the netpbm (and related) format

Added to portage

2026-08-02

netselect - 0.4-r3
Ebuild name:

net-analyzer/netselect-0.4-r3

Description

Ultrafast implementation of ping

Added to portage

2026-08-02

openpgp-keys-gentoo-developers - 20260727
Ebuild name:

sec-keys/openpgp-keys-gentoo-developers-20260727

Description

Gentoo Authority Keys (GLEP 79)

Added to portage

2026-08-02

openpgp-keys-gentoo-infrastructure - 20260727
Ebuild name:

sec-keys/openpgp-keys-gentoo-infrastructure-20260727

Description

Gentoo Authority Keys (GLEP 79)

Added to portage

2026-08-02

phonenumbers - 9.0.36
Ebuild name:

dev-python/phonenumbers-9.0.36

Description

Python port of Google's libphonenumber

Added to portage

2026-08-02

pkgconf - 3.0.5
Ebuild name:

dev-util/pkgconf-3.0.5

Description

pkg-config compatible replacement with no dependencies other than C99

Added to portage

2026-08-02

portalocker - 4.0.0
Ebuild name:

dev-python/portalocker-4.0.0

Description

A library for Python file locking

Added to portage

2026-08-02

py - 1.11.0-r2
Ebuild name:

dev-python/py-1.11.0-r2

Description

library with cross-python path, ini-parsing, io, code, log facilities

Added to portage

2026-08-02

pyopenssl - 26.4.0
Ebuild name:

dev-python/pyopenssl-26.4.0

Description

Python interface to the OpenSSL library

Added to portage

2026-08-02

pytest-check - 2.9.1
Ebuild name:

dev-python/pytest-check-2.9.1

Description

pytest plugin that allows multiple failures per test

Added to portage

2026-08-02

svglib - 2.1.0
Ebuild name:

dev-python/svglib-2.1.0

Description

Pure-Python library for reading and converting SVG

Added to portage

2026-08-02

telegram-desktop-bin - 7.0.7
Ebuild name:

net-im/telegram-desktop-bin-7.0.7

Description

Official desktop client for Telegram (binary package)

Added to portage

2026-08-02

uvicorn - 0.52.1
Ebuild name:

dev-python/uvicorn-0.52.1

Description

Lightning-fast ASGI server implementation

Added to portage

2026-08-02

2026-08-01
alcotest - 1.9.1
Ebuild name:

dev-ml/alcotest-1.9.1

Description

A lightweight and colourful test framework

Added to portage

2026-08-01

awscli - 1.45.62
Ebuild name:

app-admin/awscli-1.45.62

Description

Universal Command Line Environment for AWS

Added to portage

2026-08-01

boto3 - 1.43.62
Ebuild name:

dev-python/boto3-1.43.62

Description

The AWS SDK for Python

Added to portage

2026-08-01

botocore - 1.43.62
Ebuild name:

dev-python/botocore-1.43.62

Description

Low-level, data-driven core of boto 3

Added to portage

2026-08-01

claude-code - 2.1.220
Ebuild name:

dev-util/claude-code-2.1.220

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2026-08-01

cli11 - 2.7.1
Ebuild name:

dev-cpp/cli11-2.7.1

Description

Command line parser for C++11

Added to portage

2026-08-01

compat53 - 0.15.1
Ebuild name:

dev-lua/compat53-0.15.1

Description

Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1

Added to portage

2026-08-01

cryptography - 50.0.0
Ebuild name:

dev-python/cryptography-50.0.0

Description

Library providing cryptographic recipes and primitives

Added to portage

2026-08-01

cutlass - 4.4.2
Ebuild name:

dev-libs/cutlass-4.4.2

Description

CUDA Templates for Linear Algebra Subroutines

Added to portage

2026-08-01

environs - 15.1.0
Ebuild name:

dev-python/environs-15.1.0

Description

Python library for simplified environment variable parsing

Added to portage

2026-08-01

firecracker-bin - 1.16.1
Ebuild name:

app-emulation/firecracker-bin-1.16.1

Description

Secure and fast microVMs for serverless computing (static buil

Added to portage

2026-08-01

flrig - 2.0.12
Ebuild name:

media-radio/flrig-2.0.12

Description

Transceiver control program for Amateur Radio use

Added to portage

2026-08-01

ggml - 0.18.0
Ebuild name:

sci-ml/ggml-0.18.0

Description

Tensor library for machine learning

Added to portage

2026-08-01

gtk4-layer-shell - 1.3.0
Ebuild name:

gui-libs/gtk4-layer-shell-1.3.0

Description

A library for using the Layer Shell Wayland protocol with GTK4

Added to portage

2026-08-01

guessit - 4.4.0
Ebuild name:

dev-python/guessit-4.4.0

Description

Python library for guessing information from video filenames

Added to portage

2026-08-01

ibus-typing-booster - 2.30.11
Ebuild name:

app-i18n/ibus-typing-booster-2.30.11

Description

Completion input method for IBus

Added to portage

2026-08-01

integers - 0.8.0
Ebuild name:

dev-ml/integers-0.8.0

Description

Various signed and unsigned integer types for OCaml

Added to portage

2026-08-01

jupyter-builder - 1.2.1
Ebuild name:

dev-python/jupyter-builder-1.2.1

Description

JupyterLab build tools

Added to portage

2026-08-01

just - 1.57.0
Ebuild name:

dev-build/just-1.57.0

Description

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

Added to portage

2026-08-01

kitty - 0.48.2
Ebuild name:

x11-terms/kitty-0.48.2

Description

Fast, feature-rich, GPU-based terminal

Added to portage

2026-08-01

kitty-shell-integration - 0.48.2
Ebuild name:

x11-terms/kitty-shell-integration-0.48.2

Description

Shell integration scripts for kitty, a GPU-based terminal

Added to portage

2026-08-01

kitty-terminfo - 0.48.2
Ebuild name:

x11-terms/kitty-terminfo-0.48.2

Description

Terminfo for kitty, a GPU-based terminal emulator

Added to portage

2026-08-01

knot - 3.5.5-r2
Ebuild name:

net-dns/knot-3.5.5-r2

Description

High-performance authoritative-only DNS server

Added to portage

2026-08-01

knot - 3.5.6
Ebuild name:

net-dns/knot-3.5.6

Description

High-performance authoritative-only DNS server

Added to portage

2026-08-01

lrzip - 0.7.1
Ebuild name:

app-arch/lrzip-0.7.1

Description

Long Range ZIP or Lzma RZIP optimized for compressing large files

Added to portage

2026-08-01

m17n-db - 1.8.14
Ebuild name:

dev-db/m17n-db-1.8.14

Description

Database for the m17n library

Added to portage

2026-08-01

matlab - 9999
Ebuild name:

app-emacs/matlab-9999

Description

Major modes for MATLAB .m and .tlc files

Added to portage

2026-08-01

mediawiki - 2.3.1
Ebuild name:

app-emacs/mediawiki-2.3.1

Description

MediaWiki client for Emacs

Added to portage

2026-08-01

meson-mode - 0.4
Ebuild name:

app-emacs/meson-mode-0.4

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-08-01

meson-mode - 9999
Ebuild name:

app-emacs/meson-mode-9999

Description

A GNU Emacs major mode for Meson build-system files

Added to portage

2026-08-01

mgorny-dev-scripts - 85
Ebuild name:

app-portage/mgorny-dev-scripts-85

Description

Handy scripts for ebuild development and more

Added to portage

2026-08-01

mlterm - 3.9.5
Ebuild name:

x11-terms/mlterm-3.9.5

Description

A multi-lingual terminal emulator

Added to portage

2026-08-01

nginx - 1.29.5-r2
Ebuild name:

www-servers/nginx-1.29.5-r2

Description

Added to portage

2026-08-01

nginx - 1.29.7-r3
Ebuild name:

www-servers/nginx-1.29.7-r3

Description

Added to portage

2026-08-01

nginx - 1.30.0-r2
Ebuild name:

www-servers/nginx-1.30.0-r2

Description

Added to portage

2026-08-01

nginx - 1.30.2-r2
Ebuild name:

www-servers/nginx-1.30.2-r2

Description

Added to portage

2026-08-01

nginx - 1.30.3-r2
Ebuild name:

www-servers/nginx-1.30.3-r2

Description

Added to portage

2026-08-01

nginx - 1.30.4-r1
Ebuild name:

www-servers/nginx-1.30.4-r1

Description

Added to portage

2026-08-01

nginx - 1.31.1-r2
Ebuild name:

www-servers/nginx-1.31.1-r2

Description

Added to portage

2026-08-01

nginx - 1.31.2-r2
Ebuild name:

www-servers/nginx-1.31.2-r2

Description

Added to portage

2026-08-01

nginx - 1.31.3-r1
Ebuild name:

www-servers/nginx-1.31.3-r1

Description

Added to portage

2026-08-01

ngx-acme - 0.3.1-r1
Ebuild name:

www-nginx/ngx-acme-0.3.1-r1

Description

An NGINX module with the implementation of the ACMEv2 protocol

Added to portage

2026-08-01

pebble - 5.2.1-r1
Ebuild name:

dev-python/pebble-5.2.1-r1

Description

Threading and multiprocessing eye-candy

Added to portage

2026-08-01

peewee - 4.3.0
Ebuild name:

dev-python/peewee-4.3.0

Description

Small Python ORM

Added to portage

2026-08-01

php - 8.3.33
Ebuild name:

dev-lang/php-8.3.33

Description

The PHP language runtime engine

Added to portage

2026-08-01

php - 8.4.24
Ebuild name:

dev-lang/php-8.4.24

Description

The PHP language runtime engine

Added to portage

2026-08-01

pkgcheck - 0.10.42
Ebuild name:

dev-util/pkgcheck-0.10.42

Description

pkgcore-based QA utility for ebuild repos

Added to portage

2026-08-01

pkgcore - 0.12.37
Ebuild name:

sys-apps/pkgcore-0.12.37

Description

a framework for package management

Added to portage

2026-08-01

pkgdev - 0.2.16
Ebuild name:

dev-util/pkgdev-0.2.16

Description

Collection of tools for Gentoo development

Added to portage

2026-08-01

pyglet - 2.1.16
Ebuild name:

dev-python/pyglet-2.1.16

Description

Cross-platform windowing and multimedia library for Python

Added to portage

2026-08-01

pysnmp - 7.1.28
Ebuild name:

dev-python/pysnmp-7.1.28

Description

Python SNMP library

Added to portage

2026-08-01

python-discovery - 1.5.1
Ebuild name:

dev-python/python-discovery-1.5.1

Description

Python interpreter discovery

Added to portage

2026-08-01

python-engineio - 4.13.4
Ebuild name:

dev-python/python-engineio-4.13.4

Description

Python implementation of the Engine.IO realtime server

Added to portage

2026-08-01

redis-knot - 3.5.6
Ebuild name:

net-dns/redis-knot-3.5.6

Description

Redis module for Knot DNS

Added to portage

2026-08-01

shtab - 1.9.2
Ebuild name:

dev-python/shtab-1.9.2

Description

Automagic shell tab completion for Python CLI applications

Added to portage

2026-08-01

snakeoil - 0.11.3
Ebuild name:

dev-python/snakeoil-0.11.3

Description

misc common functionality and useful optimizations

Added to portage

2026-08-01

tifffile - 2026.7.31
Ebuild name:

dev-python/tifffile-2026.7.31

Description

Read and write TIFF files

Added to portage

2026-08-01

time-machine - 3.3.0
Ebuild name:

dev-python/time-machine-3.3.0

Description

Travel through time in your tests

Added to portage

2026-08-01

traitlets - 5.16.0
Ebuild name:

dev-python/traitlets-5.16.0

Description

A configuration system for Python applications

Added to portage

2026-08-01

trakit - 0.3.0
Ebuild name:

dev-python/trakit-0.3.0

Description

Guess additional information from titles in media tracks

Added to portage

2026-08-01

translate-toolkit - 3.19.17
Ebuild name:

dev-python/translate-toolkit-3.19.17

Description

Toolkit to convert between many translation formats

Added to portage

2026-08-01

tree-sitter - 0.26.11
Ebuild name:

dev-libs/tree-sitter-0.26.11

Description

Tree-sitter is a parser generator tool and an incremental parsing libr

Added to portage

2026-08-01

tree-sitter-cli - 0.26.11
Ebuild name:

dev-util/tree-sitter-cli-0.26.11

Description

Command-line tool for creating and testing tree-sitter grammars

Added to portage

2026-08-01

trimesh - 5.0.0
Ebuild name:

dev-python/trimesh-5.0.0

Description

Python library for loading and using triangular meshes

Added to portage

2026-08-01

uv - 0.12.1
Ebuild name:

dev-python/uv-0.12.1

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-08-01

uv-build - 0.12.1
Ebuild name:

dev-python/uv-build-0.12.1

Description

PEP517 uv build backend

Added to portage

2026-08-01

wayfire - 0.11.0
Ebuild name:

gui-wm/wayfire-0.11.0

Description

compiz like 3D wayland compositor

Added to portage

2026-08-01

wayfire-plugins-extra - 0.11.0_pre20260801
Ebuild name:

gui-libs/wayfire-plugins-extra-0.11.0_pre20260801

Description

extra plugins for wayfire

Added to portage

2026-08-01

wcm - 0.11.0_pre20260801
Ebuild name:

gui-apps/wcm-0.11.0_pre20260801

Description

Wayfire Config Manager

Added to portage

2026-08-01

websockets - 17.0.1
Ebuild name:

dev-python/websockets-17.0.1

Description

Library for building WebSocket servers and clients in Python

Added to portage

2026-08-01

wf-config - 0.11.0
Ebuild name:

gui-libs/wf-config-0.11.0

Description

library for managing wayfire configuration files

Added to portage

2026-08-01

wf-shell - 0.11.0_pre20260801
Ebuild name:

gui-apps/wf-shell-0.11.0_pre20260801

Description

Compiz like 3D wayland compositor

Added to portage

2026-08-01

yq - 3.4.3-r1
Ebuild name:

app-misc/yq-3.4.3-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

yq - 4.1.2-r1
Ebuild name:

app-misc/yq-4.1.2-r1

Description

Command-line YAML processor - jq wrapper for YAML documents

Added to portage

2026-08-01

zsnes - 2.2.2
Ebuild name:

games-emulation/zsnes-2.2.2

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-08-01

zsnes - 2.2.3
Ebuild name:

games-emulation/zsnes-2.2.3

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-08-01

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