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:

89500

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-10-24
chocolate-doom - 3.1.1-r1
Ebuild name:

games-fps/chocolate-doom-3.1.1-r1

Description

A Doom source port that is minimalist and historically accurate

Added to portage

2026-10-24

fangfrisch - 1.9.3
Ebuild name:

app-antivirus/fangfrisch-1.9.3

Description

Update and verify unofficial Clam Anti-Virus signatures

Added to portage

2026-10-24

git-lfs - 3.8.1
Ebuild name:

dev-vcs/git-lfs-3.8.1

Description

Command line extension and specification for managing large files with git

Added to portage

2026-10-24

openssl-compat - 1.1.1w
Ebuild name:

dev-libs/openssl-compat-1.1.1w

Description

Full-strength general purpose cryptography library (including SSL an

Added to portage

2026-10-24

openssl-compat - 3.6.5
Ebuild name:

dev-libs/openssl-compat-3.6.5

Description

Full-strength general purpose cryptography library (including SSL and

Added to portage

2026-10-24

2026-10-23
apparmor - 5.0.2
Ebuild name:

sys-apps/apparmor-5.0.2

Description

Userspace utils and init scripts for the AppArmor application security syst

Added to portage

2026-10-23

apparmor-profiles - 5.0.2
Ebuild name:

sec-policy/apparmor-profiles-5.0.2

Description

A collection of profiles for the AppArmor application security s

Added to portage

2026-10-23

apparmor-utils - 5.0.2
Ebuild name:

sys-apps/apparmor-utils-5.0.2

Description

Additional userspace utils to assist with AppArmor profile management

Added to portage

2026-10-23

asm - 9.11.1
Ebuild name:

dev-java/asm-9.11.1

Description

Bytecode manipulation framework for Java

Added to portage

2026-10-23

baloo - 6.31.0-r2
Ebuild name:

kde-frameworks/baloo-6.31.0-r2

Description

Framework for searching and managing metadata

Added to portage

2026-10-23

batik - 1.18-r3
Ebuild name:

dev-java/batik-1.18-r3

Description

XML Graphics Batik

Added to portage

2026-10-23

batik - 1.20
Ebuild name:

dev-java/batik-1.20

Description

XML Graphics Batik

Added to portage

2026-10-23

breezy - 3.3.23
Ebuild name:

dev-vcs/breezy-3.3.23

Description

Distributed Version Control System with a Friendly UI

Added to portage

2026-10-23

brotlicffi - 1.2.1.0
Ebuild name:

dev-python/brotlicffi-1.2.1.0

Description

Python binding to the Brotli library

Added to portage

2026-10-23

buildah - 1.46.0
Ebuild name:

app-containers/buildah-1.46.0

Description

A tool that facilitates building OCI images

Added to portage

2026-10-23

byte-buddy - 1.18.15
Ebuild name:

dev-java/byte-buddy-1.18.15

Description

Offers convenience for attaching an agent to the local or a remote VM

Added to portage

2026-10-23

container-libs - 0.70.0
Ebuild name:

app-containers/container-libs-0.70.0

Description

Several utilities from the containers project

Added to portage

2026-10-23

coredns - 1.15.0
Ebuild name:

net-dns/coredns-1.15.0

Description

CoreDNS is a DNS server that chains plugins

Added to portage

2026-10-23

courier - 2.0.8-r1
Ebuild name:

mail-mta/courier-2.0.8-r1

Description

An MTA designed specifically for maildirs

Added to portage

2026-10-23

courier - 2.0.9
Ebuild name:

mail-mta/courier-2.0.9

Description

An MTA designed specifically for maildirs

Added to portage

2026-10-23

coverage - 7.17.0
Ebuild name:

dev-python/coverage-7.17.0

Description

Code coverage measurement for Python

Added to portage

2026-10-23

dulwich - 1.2.19
Ebuild name:

dev-python/dulwich-1.2.19

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2026-10-23

ebuild-mode - 1.89
Ebuild name:

app-xemacs/ebuild-mode-1.89

Description

Emacs modes for editing ebuilds and other Gentoo specific files

Added to portage

2026-10-23

ensurepip-pip - 26.2.1-r1
Ebuild name:

dev-python/ensurepip-pip-26.2.1-r1

Description

Shared pip wheel for ensurepip Python module

Added to portage

2026-10-23

ensurepip-pip - 26.2.2-r1
Ebuild name:

dev-python/ensurepip-pip-26.2.2-r1

Description

Shared pip wheel for ensurepip Python module

Added to portage

2026-10-23

fastapi - 0.161.1
Ebuild name:

dev-python/fastapi-0.161.1

Description

High performance framework, easy to learn, fast to code, ready for produ

Added to portage

2026-10-23

flask-paginate - 2026.10.22
Ebuild name:

dev-python/flask-paginate-2026.10.22

Description

Pagination support for flask

Added to portage

2026-10-23

fop - 2.10-r3
Ebuild name:

dev-java/fop-2.10-r3

Description

XML Graphics Format Object Processor All-In-One

Added to portage

2026-10-23

fop - 2.12
Ebuild name:

dev-java/fop-2.12

Description

XML Graphics Format Object Processor All-In-One

Added to portage

2026-10-23

gdb - 18.1-r1
Ebuild name:

dev-debug/gdb-18.1-r1

Description

GNU debugger

Added to portage

2026-10-23

glycin-loaders - 2.2.4
Ebuild name:

media-libs/glycin-loaders-2.2.4

Description

Loaders for glycin clients (glycin crate or libglycin)

Added to portage

2026-10-23

google-api-core - 2.43.0
Ebuild name:

dev-python/google-api-core-2.43.0

Description

Core Library for Google Client Libraries

Added to portage

2026-10-23

googleapis-common-protos - 1.76.0
Ebuild name:

dev-python/googleapis-common-protos-1.76.0

Description

Python classes generated from the common protos in the g

Added to portage

2026-10-23

gr-fosphor - 0.0_p20260330-r2
Ebuild name:

net-analyzer/gr-fosphor-0.0_p20260330-r2

Description

gnuradio fosphor block (GPU spectrum display)

Added to portage

2026-10-23

gr-paint - 0.0_p20250824-r2
Ebuild name:

net-wireless/gr-paint-0.0_p20250824-r2

Description

Paints monochrome images into the waterfall of a receiver

Added to portage

2026-10-23

grpcio - 1.84.1
Ebuild name:

dev-python/grpcio-1.84.1

Description

HTTP/2-based RPC framework

Added to portage

2026-10-23

grpcio-status - 1.84.1
Ebuild name:

dev-python/grpcio-status-1.84.1

Description

Reference package for GRPC Python status proto mapping

Added to portage

2026-10-23

gruvbox-theme - 1.30.4
Ebuild name:

app-emacs/gruvbox-theme-1.30.4

Description

Gruvbox is a retro groove color scheme, now in Emacs

Added to portage

2026-10-23

gruvbox-theme - 9999
Ebuild name:

app-emacs/gruvbox-theme-9999

Description

Gruvbox is a retro groove color scheme, now in Emacs

Added to portage

2026-10-23

h4x0r - 0.13-r1
Ebuild name:

app-emacs/h4x0r-0.13-r1

Description

Aid in writing like a script kiddie does

Added to portage

2026-10-23

hypothesis - 6.170.8
Ebuild name:

dev-python/hypothesis-6.170.8

Description

A library for property based testing

Added to portage

2026-10-23

importlib-metadata - 9.1.0
Ebuild name:

dev-python/importlib-metadata-9.1.0

Description

Read metadata from Python packages

Added to portage

2026-10-23

iotop-c - 1.33
Ebuild name:

sys-process/iotop-c-1.33

Description

top utility for IO (C port)

Added to portage

2026-10-23

jellyfin-bin - 12.3
Ebuild name:

www-apps/jellyfin-bin-12.3

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-10-23

jetring - 0.31
Ebuild name:

app-crypt/jetring-0.31

Description

GPG keyring maintenance using changesets

Added to portage

2026-10-23

jetring - 0.32
Ebuild name:

app-crypt/jetring-0.32

Description

GPG keyring maintenance using changesets

Added to portage

2026-10-23

jitterentropy - 3.6.0
Ebuild name:

app-crypt/jitterentropy-3.6.0

Description

Hardware RNG based on CPU timing jitter

Added to portage

2026-10-23

jitterentropy - 3.6.3
Ebuild name:

app-crypt/jitterentropy-3.6.3

Description

Hardware RNG based on CPU timing jitter

Added to portage

2026-10-23

jitterentropy-rngd - 1.2.8
Ebuild name:

app-crypt/jitterentropy-rngd-1.2.8

Description

Jitter RNG daemon

Added to portage

2026-10-23

johntheripper - 1.8.0-r2
Ebuild name:

app-crypt/johntheripper-1.8.0-r2

Description

fast password cracker

Added to portage

2026-10-23

johntheripper - 1.9.0
Ebuild name:

app-crypt/johntheripper-1.9.0

Description

fast password cracker

Added to portage

2026-10-23

johntheripper-jumbo - 1.9.0_p20240102
Ebuild name:

app-crypt/johntheripper-jumbo-1.9.0_p20240102

Description

Fast password cracker, community enhanced version

Added to portage

2026-10-23

kddockwidgets - 2.5.1
Ebuild name:

gui-libs/kddockwidgets-2.5.1

Description

KDAB's Dock Widget Framework for Qt

Added to portage

2026-10-23

keepassxc - 2.8.0
Ebuild name:

app-admin/keepassxc-2.8.0

Description

KeePassXC - KeePass Cross-platform Community Edition

Added to portage

2026-10-23

keepassxc - 2.8.0_beta1
Ebuild name:

app-admin/keepassxc-2.8.0_beta1

Description

KeePassXC - KeePass Cross-platform Community Edition

Added to portage

2026-10-23

libapparmor - 5.0.2
Ebuild name:

sys-libs/libapparmor-5.0.2

Description

Library to support AppArmor userspace utilities

Added to portage

2026-10-23

mdbook - 0.5.4-r1
Ebuild name:

app-text/mdbook-0.5.4-r1

Description

Create a book from markdown files

Added to portage

2026-10-23

memory-allocator - 0.2.1
Ebuild name:

dev-python/memory-allocator-0.2.1

Description

An extension class for memory allocation in cython

Added to portage

2026-10-23

mmix - 20261012
Ebuild name:

dev-lang/mmix-20261012

Description

Donald Knuth's MMIX Assembler and Simulator

Added to portage

2026-10-23

nvidia-drivers - 595.44.16
Ebuild name:

x11-drivers/nvidia-drivers-595.44.16

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2026-10-23

openh264 - 2.7.0
Ebuild name:

media-libs/openh264-2.7.0

Description

Cisco OpenH264 library and Gecko Media Plugin for Mozilla packages

Added to portage

2026-10-23

openjdk - 17.0.21.0.2_p1
Ebuild name:

dev-java/openjdk-17.0.21.0.2_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-23

openjdk - 21.0.13.0.2_p1
Ebuild name:

dev-java/openjdk-21.0.13.0.2_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-23

openjdk - 25.0.5.0.2_p1
Ebuild name:

dev-java/openjdk-25.0.5.0.2_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-23

openjdk - 27.0.1.0.2_p1
Ebuild name:

dev-java/openjdk-27.0.1.0.2_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-23

openjdk - 28_alpha21
Ebuild name:

dev-java/openjdk-28_alpha21

Description

Open source implementation of the Java programming language

Added to portage

2026-10-23

openjdk-bin - 28_alpha21
Ebuild name:

dev-java/openjdk-bin-28_alpha21

Description

Prebuilt Java JDK binaries provided by Eclipse Temurin

Added to portage

2026-10-23

openpgp-keys-apache-xmlgraphics - 20260128
Ebuild name:

sec-keys/openpgp-keys-apache-xmlgraphics-20260128

Description

OpenPGP keys used by xmlgraphics.apache.org/commo

Added to portage

2026-10-23

openpgp-keys-apparmor - 20260924
Ebuild name:

sec-keys/openpgp-keys-apparmor-20260924

Description

OpenPGP keys used by AppArmor

Added to portage

2026-10-23

openpgp-keys-keepassxc - 20261023
Ebuild name:

sec-keys/openpgp-keys-keepassxc-20261023

Description

OpenPGP key used for KeePassXC releases

Added to portage

2026-10-23

openstacksdk - 4.22.0
Ebuild name:

dev-python/openstacksdk-4.22.0

Description

A collection of libraries for building applications to work with Ope

Added to portage

2026-10-23

pandas - 3.1.0
Ebuild name:

dev-python/pandas-3.1.0

Description

Powerful data structures for data analysis and statistics

Added to portage

2026-10-23

passt - 2026.10.02
Ebuild name:

net-misc/passt-2026.10.02

Description

User-mode networking daemons for VMs and namespaces, replacement for Slir

Added to portage

2026-10-23

pixi - 0.83.0-r1
Ebuild name:

dev-util/pixi-0.83.0-r1

Description

A package management and workflow tool

Added to portage

2026-10-23

podman - 5.8.9
Ebuild name:

app-containers/podman-5.8.9

Description

A tool for managing OCI containers and pods with Docker-compatible CLI

Added to portage

2026-10-23

pycargoebuild - 0.17.2
Ebuild name:

app-portage/pycargoebuild-0.17.2

Description

A generator for Rust/Cargo ebuilds written in Python

Added to portage

2026-10-23

pycparser - 3.12
Ebuild name:

dev-python/pycparser-3.12

Description

C parser and AST generator written in Python

Added to portage

2026-10-23

python-openstackclient - 10.5.0
Ebuild name:

dev-python/python-openstackclient-10.5.0

Description

A client for the OpenStack APIs

Added to portage

2026-10-23

qemu - 10.0.14
Ebuild name:

app-emulation/qemu-10.0.14

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-23

qemu - 10.2.4
Ebuild name:

app-emulation/qemu-10.2.4

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-23

qemu - 11.1.2
Ebuild name:

app-emulation/qemu-11.1.2

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-10-23

qemu-qmp - 0.0.6
Ebuild name:

dev-python/qemu-qmp-0.0.6

Description

QEMU Monitor Protocol library

Added to portage

2026-10-23

qtbase - 6.12.0-r1
Ebuild name:

dev-qt/qtbase-6.12.0-r1

Description

Cross-platform application development framework

Added to portage

2026-10-23

qtdeclarative - 6.12.0-r1
Ebuild name:

dev-qt/qtdeclarative-6.12.0-r1

Description

Qt Declarative (Quick 2)

Added to portage

2026-10-23

semi - 1.14.7_p20251130
Ebuild name:

app-emacs/semi-1.14.7_p20251130

Description

A library to provide MIME feature for GNU Emacs

Added to portage

2026-10-23

soapysdrplay - 0.5.3
Ebuild name:

net-wireless/soapysdrplay-0.5.3

Description

Soapy SDR plugin for SDRPlay

Added to portage

2026-10-23

spidermonkey - 153.5.1
Ebuild name:

dev-lang/spidermonkey-153.5.1

Description

Mozilla's JavaScript engine written in C and C++

Added to portage

2026-10-23

svglib - 2.3.1
Ebuild name:

dev-python/svglib-2.3.1

Description

Pure-Python library for reading and converting SVG

Added to portage

2026-10-23

syncthing - 2.1.7
Ebuild name:

net-p2p/syncthing-2.1.7

Description

Open Source Continuous File Synchronization

Added to portage

2026-10-23

timescaledb - 2.31.0
Ebuild name:

dev-db/timescaledb-2.31.0

Description

Open-source time-series SQL database

Added to portage

2026-10-23

tzlocal - 5.4.5
Ebuild name:

dev-python/tzlocal-5.4.5

Description

tzinfo object for the local timezone

Added to portage

2026-10-23

unicode-segmentation-rs - 1.0.0
Ebuild name:

dev-python/unicode-segmentation-rs-1.0.0

Description

Unicode segmentation and width for Python using Rust

Added to portage

2026-10-23

virtualenv - 21.14.13
Ebuild name:

dev-python/virtualenv-21.14.13

Description

Virtual Python Environment builder

Added to portage

2026-10-23

wanderlust - 2.15.9_p20251029
Ebuild name:

app-emacs/wanderlust-2.15.9_p20251029

Description

Yet Another Message Interface on Emacsen

Added to portage

2026-10-23

xmlgraphics-commons - 2.12
Ebuild name:

dev-java/xmlgraphics-commons-2.12

Description

XML Graphics Commons

Added to portage

2026-10-23

xvfbwrapper - 0.2.36
Ebuild name:

dev-python/xvfbwrapper-0.2.36

Description

Python wrapper for running a display inside X virtual framebuffer

Added to portage

2026-10-23

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