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:

84137

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-04-02
accelerate - 1.7.0-r2
Ebuild name:

sci-ml/accelerate-1.7.0-r2

Description

Run your *raw* PyTorch training script on any kind of device

Added to portage

2026-04-02

awscli - 1.44.71
Ebuild name:

app-admin/awscli-1.44.71

Description

Universal Command Line Environment for AWS

Added to portage

2026-04-02

bicho - 0.0.18
Ebuild name:

dev-ruby/bicho-0.0.18

Description

ruby Bugzilla access library

Added to portage

2026-04-02

boto3 - 1.42.81
Ebuild name:

dev-python/boto3-1.42.81

Description

The AWS SDK for Python

Added to portage

2026-04-02

botocore - 1.42.81
Ebuild name:

dev-python/botocore-1.42.81

Description

Low-level, data-driven core of boto 3

Added to portage

2026-04-02

dbus-fast - 4.0.3
Ebuild name:

dev-python/dbus-fast-4.0.3

Description

A faster version of dbus-next

Added to portage

2026-04-02

dropbox - 246.4.3513
Ebuild name:

net-misc/dropbox-246.4.3513

Description

Dropbox daemon (pretends to be GUI-less)

Added to portage

2026-04-02

environs - 15.0.0
Ebuild name:

dev-python/environs-15.0.0

Description

Python library for simplified environment variable parsing

Added to portage

2026-04-02

inifile - 3.0.0
Ebuild name:

dev-ruby/inifile-3.0.0

Description

Native Ruby package for reading and writing INI files

Added to portage

2026-04-02

kmscon - 9.3.3
Ebuild name:

sys-apps/kmscon-9.3.3

Description

KMS/DRM based virtual Console Emulator

Added to portage

2026-04-02

matlab - 9999
Ebuild name:

app-emacs/matlab-9999

Description

Major modes for MATLAB .m and .tlc files

Added to portage

2026-04-02

mediawiki - 1.43.8
Ebuild name:

www-apps/mediawiki-1.43.8

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2026-04-02

mediawiki - 1.44.5
Ebuild name:

www-apps/mediawiki-1.44.5

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2026-04-02

mediawiki - 1.45.3
Ebuild name:

www-apps/mediawiki-1.45.3

Description

The MediaWiki wiki web application (as used on wikipedia.org)

Added to portage

2026-04-02

mercurial - 7.2.1
Ebuild name:

dev-vcs/mercurial-7.2.1

Description

Scalable distributed SCM

Added to portage

2026-04-02

mesa - 26.0.4
Ebuild name:

media-libs/mesa-26.0.4

Description

OpenGL-like graphic library for Linux

Added to portage

2026-04-02

mesa_clc - 26.0.4
Ebuild name:

dev-util/mesa_clc-26.0.4

Description

mesa_clc tool used for building OpenCL C to SPIR-V

Added to portage

2026-04-02

pdm-backend - 2.4.8
Ebuild name:

dev-python/pdm-backend-2.4.8

Description

A PEP 517 backend for PDM that supports PEP 621 metadata

Added to portage

2026-04-02

phlex - 1.11.0
Ebuild name:

dev-ruby/phlex-1.11.0

Description

A framework for building object-oriented views in Ruby

Added to portage

2026-04-02

phlex - 2.2.1
Ebuild name:

dev-ruby/phlex-2.2.1

Description

A framework for building object-oriented views in Ruby

Added to portage

2026-04-02

phlex - 2.3.0
Ebuild name:

dev-ruby/phlex-2.3.0

Description

A framework for building object-oriented views in Ruby

Added to portage

2026-04-02

phlex - 2.3.1
Ebuild name:

dev-ruby/phlex-2.3.1

Description

A framework for building object-oriented views in Ruby

Added to portage

2026-04-02

phonenumbers - 9.0.27
Ebuild name:

dev-python/phonenumbers-9.0.27

Description

Python port of Google's libphonenumber

Added to portage

2026-04-02

pikopixel - 1.0_beta10-r3
Ebuild name:

gnustep-apps/pikopixel-1.0_beta10-r3

Description

a free application for drawing & editing pixel-art images

Added to portage

2026-04-02

pillow - 12.2.0
Ebuild name:

dev-python/pillow-12.2.0

Description

Python Imaging Library (fork)

Added to portage

2026-04-02

python-lsp-ruff - 2.3.1
Ebuild name:

dev-python/python-lsp-ruff-2.3.1

Description

Ruff linting plugin for the Python LSP Server

Added to portage

2026-04-02

qemu - 10.2.2
Ebuild name:

app-emulation/qemu-10.2.2

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2026-04-02

quiche - 0.28.0
Ebuild name:

net-libs/quiche-0.28.0

Description

Implementation of the QUIC transport protocol and HTTP/3

Added to portage

2026-04-02

safeeyes - 3.3.2
Ebuild name:

x11-misc/safeeyes-3.3.2

Description

Linux alternative to EyeLeo

Added to portage

2026-04-02

setxkbmap - 1.3.5
Ebuild name:

x11-apps/setxkbmap-1.3.5

Description

Controls the keyboard layout of a running X server

Added to portage

2026-04-02

stripe - 15.0.1
Ebuild name:

dev-python/stripe-15.0.1

Description

Stripe Python bindings

Added to portage

2026-04-02

types-psutil - 7.2.2.20260402
Ebuild name:

dev-python/types-psutil-7.2.2.20260402

Description

Typing stubs for psutil

Added to portage

2026-04-02

types-python-dateutil - 2.9.0.20260402
Ebuild name:

dev-python/types-python-dateutil-2.9.0.20260402

Description

Typing stubs for python-dateutil

Added to portage

2026-04-02

types-setuptools - 82.0.0.20260402
Ebuild name:

dev-python/types-setuptools-82.0.0.20260402

Description

Typing stubs for setuptools

Added to portage

2026-04-02

uv - 0.11.3
Ebuild name:

dev-python/uv-0.11.3

Description

A Python package installer and resolver, written in Rust

Added to portage

2026-04-02

uv-build - 0.11.3
Ebuild name:

dev-python/uv-build-0.11.3

Description

PEP517 uv build backend

Added to portage

2026-04-02

2026-04-01
aiohttp - 3.13.5
Ebuild name:

dev-python/aiohttp-3.13.5

Description

HTTP client/server for asyncio

Added to portage

2026-04-01

ansible-compat - 26.3.0
Ebuild name:

dev-python/ansible-compat-26.3.0

Description

Contains functions that facilitate working with various versions o

Added to portage

2026-04-01

asterisk-g729 - 20.0.3.1.10-r2
Ebuild name:

net-misc/asterisk-g729-20.0.3.1.10-r2

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

asterisk-g729 - 20.0.3.1.11-r1
Ebuild name:

net-misc/asterisk-g729-20.0.3.1.11-r1

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

asterisk-g729 - 21.0.3.1.10-r2
Ebuild name:

net-misc/asterisk-g729-21.0.3.1.10-r2

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

asterisk-g729 - 21.0.3.1.11-r1
Ebuild name:

net-misc/asterisk-g729-21.0.3.1.11-r1

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

asterisk-g729 - 22.0.3.1.10-r2
Ebuild name:

net-misc/asterisk-g729-22.0.3.1.10-r2

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

asterisk-g729 - 22.0.3.1.11-r1
Ebuild name:

net-misc/asterisk-g729-22.0.3.1.11-r1

Description

G.729 codec and supporting files for asterisk

Added to portage

2026-04-01

awscli - 1.44.70
Ebuild name:

app-admin/awscli-1.44.70

Description

Universal Command Line Environment for AWS

Added to portage

2026-04-01

blueprint-compiler - 0.20.4
Ebuild name:

dev-util/blueprint-compiler-0.20.4

Description

Compiler for Blueprint, a markup language for GTK user interface

Added to portage

2026-04-01

boto3 - 1.42.80
Ebuild name:

dev-python/boto3-1.42.80

Description

The AWS SDK for Python

Added to portage

2026-04-01

botocore - 1.42.80
Ebuild name:

dev-python/botocore-1.42.80

Description

Low-level, data-driven core of boto 3

Added to portage

2026-04-01

cfn-lint - 1.48.0
Ebuild name:

dev-python/cfn-lint-1.48.0

Description

CloudFormation Linter

Added to portage

2026-04-01

clang - 23.0.0_pre20260331
Ebuild name:

dev-python/clang-23.0.0_pre20260331

Description

Python bindings for llvm-core/clang

Added to portage

2026-04-01

clang - 23.0.0_pre20260331
Ebuild name:

llvm-core/clang-23.0.0_pre20260331

Description

C language family frontend for LLVM

Added to portage

2026-04-01

clang-common - 23.0.0_pre20260331
Ebuild name:

llvm-core/clang-common-23.0.0_pre20260331

Description

Common files shared between multiple slots of clang

Added to portage

2026-04-01

compiler-rt - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/compiler-rt-23.0.0_pre20260331

Description

Compiler runtime library for clang (built-in part)

Added to portage

2026-04-01

compiler-rt-sanitizers - 23.0.0_pre20260331
Ebuild name:

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

Description

Compiler runtime libraries for clang (sanit

Added to portage

2026-04-01

coq - 9.2.0
Ebuild name:

sci-mathematics/coq-9.2.0

Description

Coq/Rocq is a proof assistant written in O'Caml

Added to portage

2026-04-01

devcontainer - 0.85.0
Ebuild name:

app-containers/devcontainer-0.85.0

Description

Reference implementation of the Development Containers specifica

Added to portage

2026-04-01

flang - 23.0.0_pre20260331
Ebuild name:

llvm-core/flang-23.0.0_pre20260331

Description

LLVM's Fortran frontend

Added to portage

2026-04-01

flang-rt - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/flang-rt-23.0.0_pre20260331

Description

LLVM's Fortran runtime

Added to portage

2026-04-01

flask-compress - 1.24
Ebuild name:

dev-python/flask-compress-1.24

Description

Compress responses in your Flask app with gzip

Added to portage

2026-04-01

gnumach - 1.8_p20260330
Ebuild name:

sys-kernel/gnumach-1.8_p20260330

Description

GNU Mach microkernel, for the Hurd

Added to portage

2026-04-01

guile-git - 0.11.0
Ebuild name:

dev-scheme/guile-git-0.11.0

Description

Guile bindings of git

Added to portage

2026-04-01

hurd - 0.9_p20260331
Ebuild name:

sys-kernel/hurd-0.9_p20260331

Description

GNU Hurd is the GNU project's replacement for UNIX

Added to portage

2026-04-01

incus - 6.23
Ebuild name:

app-containers/incus-6.23

Description

Modern, secure and powerful system container and virtual machine manager

Added to portage

2026-04-01

jellyfin-bin - 10.11.7
Ebuild name:

www-apps/jellyfin-bin-10.11.7

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2026-04-01

ksmbd-tools - 3.5.6
Ebuild name:

net-fs/ksmbd-tools-3.5.6

Description

cifsd/ksmbd kernel server userspace utilities

Added to portage

2026-04-01

kup - 0.3.6-r8
Ebuild name:

dev-util/kup-0.3.6-r8

Description

kernel.org uploader tool

Added to portage

2026-04-01

libclc - 23.0.0_pre20260331
Ebuild name:

llvm-core/libclc-23.0.0_pre20260331

Description

OpenCL C library

Added to portage

2026-04-01

libcxx - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/libcxx-23.0.0_pre20260331

Description

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

Added to portage

2026-04-01

libcxxabi - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/libcxxabi-23.0.0_pre20260331

Description

Low level support for a standard C++ library

Added to portage

2026-04-01

libgcc - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/libgcc-23.0.0_pre20260331

Description

Compiler runtime library for clang, compatible with libgcc_

Added to portage

2026-04-01

libopenmpt - 0.8.6
Ebuild name:

media-libs/libopenmpt-0.8.6

Description

Library to decode tracked music files (modules)

Added to portage

2026-04-01

libunwind - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/libunwind-23.0.0_pre20260331

Description

C++ runtime stack unwinder from LLVM

Added to portage

2026-04-01

lit - 23.0.0_pre20260331
Ebuild name:

dev-python/lit-23.0.0_pre20260331

Description

A stand-alone install of the LLVM suite testing tool

Added to portage

2026-04-01

lld - 23.0.0_pre20260331
Ebuild name:

llvm-core/lld-23.0.0_pre20260331

Description

The LLVM linker (link editor)

Added to portage

2026-04-01

lldb - 23.0.0_pre20260331
Ebuild name:

llvm-core/lldb-23.0.0_pre20260331

Description

The LLVM debugger

Added to portage

2026-04-01

llvm - 23.0.0_pre20260331
Ebuild name:

dev-ml/llvm-23.0.0_pre20260331

Description

OCaml bindings for LLVM

Added to portage

2026-04-01

llvm - 23.0.0_pre20260331
Ebuild name:

llvm-core/llvm-23.0.0_pre20260331

Description

Low Level Virtual Machine

Added to portage

2026-04-01

llvm-common - 23.0.0_pre20260331
Ebuild name:

llvm-core/llvm-common-23.0.0_pre20260331

Description

Common files shared between multiple slots of LLVM

Added to portage

2026-04-01

mediawiki - 2.3.1
Ebuild name:

app-emacs/mediawiki-2.3.1

Description

MediaWiki client for Emacs

Added to portage

2026-04-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-04-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-04-01

metamath-mode - 0_p20221005
Ebuild name:

app-emacs/metamath-mode-0_p20221005

Description

Major GNU Emacs mode for metamath files

Added to portage

2026-04-01

mig - 1.8_p20260123
Ebuild name:

dev-util/mig-1.8_p20260123

Description

GNU Mach 3.0 interface generator (IDL compiler)

Added to portage

2026-04-01

mlir - 23.0.0_pre20260331
Ebuild name:

llvm-core/mlir-23.0.0_pre20260331

Description

Multi-Level Intermediate Representation (library only)

Added to portage

2026-04-01

motif - 2.5.1-r1
Ebuild name:

x11-libs/motif-2.5.1-r1

Description

The Motif user interface component toolkit

Added to portage

2026-04-01

mypy - 1.20.0
Ebuild name:

dev-python/mypy-1.20.0

Description

Optional static typing for Python

Added to portage

2026-04-01

nprolog - 4.90
Ebuild name:

dev-lang/nprolog-4.90

Description

Interpreter and compiler to be compatible with Arity/Prolog32

Added to portage

2026-04-01

openmp - 23.0.0_pre20260331
Ebuild name:

llvm-runtimes/openmp-23.0.0_pre20260331

Description

OpenMP runtime libraries for LLVM/clang compiler

Added to portage

2026-04-01

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

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

Description

OpenMP target library for amdgcn devices

Added to portage

2026-04-01

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

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

Description

OpenMP target library for nvptx64 devic

Added to portage

2026-04-01

openmp-spirv64-intel - 23.0.0_pre20260331
Ebuild name:

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

Description

OpenMP target library for spirv64 Intel devic

Added to portage

2026-04-01

openmpt123 - 0.8.6
Ebuild name:

media-sound/openmpt123-0.8.6

Description

libopenmpt-based command line player for tracked music files (modules)

Added to portage

2026-04-01

opentimelineio - 0.18.1
Ebuild name:

media-libs/opentimelineio-0.18.1

Description

Open Source API and interchange format for editorial timeline info

Added to portage

2026-04-01

orjson - 3.11.8
Ebuild name:

dev-python/orjson-3.11.8

Description

Fast, correct Python JSON library supporting dataclasses, datetimes, and n

Added to portage

2026-04-01

pandas - 3.0.2
Ebuild name:

dev-python/pandas-3.0.2

Description

Powerful data structures for data analysis and statistics

Added to portage

2026-04-01

picom - 13
Ebuild name:

x11-misc/picom-13

Description

A lightweight compositor for X11 (previously a compton fork)

Added to portage

2026-04-01

polly - 23.0.0_pre20260331
Ebuild name:

llvm-core/polly-23.0.0_pre20260331

Description

Polyhedral optimizations for LLVM

Added to portage

2026-04-01

protontricks - 1.14.1
Ebuild name:

app-emulation/protontricks-1.14.1

Description

app-emulation/winetricks wrapper for Proton (Steam Play) games

Added to portage

2026-04-01

pybind11 - 3.0.3
Ebuild name:

dev-python/pybind11-3.0.3

Description

AST-based Python refactoring library

Added to portage

2026-04-01

pydantic - 2.13.0_beta3
Ebuild name:

dev-python/pydantic-2.13.0_beta3

Description

Data parsing and validation using Python type hints

Added to portage

2026-04-01

sbcl - 2.6.3
Ebuild name:

dev-lisp/sbcl-2.6.3

Description

Steel Bank Common Lisp (SBCL) is an implementation of ANSI Common Lisp

Added to portage

2026-04-01

simdjson - 4.6.0
Ebuild name:

dev-libs/simdjson-4.6.0

Description

SIMD accelerated C++ JSON library

Added to portage

2026-04-01

typescript - 6.0.2
Ebuild name:

dev-lang/typescript-6.0.2

Description

Superset of JavaScript with optional static typing, classes and interface

Added to portage

2026-04-01

vivaldi-snapshot - 7.10.3995.3
Ebuild name:

www-client/vivaldi-snapshot-7.10.3995.3

Description

A browser for our friends

Added to portage

2026-04-01

xpra-html5 - 20
Ebuild name:

www-apps/xpra-html5-20

Description

HTML5 client to connect to any xpra server

Added to portage

2026-04-01

xz-utils - 5.8.3
Ebuild name:

app-arch/xz-utils-5.8.3

Description

Utils for managing LZMA compressed files

Added to portage

2026-04-01

zenburn-theme - 2.9.0
Ebuild name:

app-emacs/zenburn-theme-2.9.0

Description

Zenburn color theme for Emacs

Added to portage

2026-04-01

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