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:

89686

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-30
affine - 3.0.1
Ebuild name:

sci-geosciences/affine-3.0.1

Description

Affine transformation matrices

Added to portage

2026-10-30

deluge - 2.1.1-r10
Ebuild name:

net-p2p/deluge-2.1.1-r10

Description

BitTorrent client with a client/server model

Added to portage

2026-10-30

deluge - 2.2.0-r3
Ebuild name:

net-p2p/deluge-2.2.0-r3

Description

BitTorrent client with a client/server model

Added to portage

2026-10-30

flux - 2.10.0
Ebuild name:

sys-cluster/flux-2.10.0

Description

Flux is a tool for keeping Kubernetes clusters in sync

Added to portage

2026-10-30

kirigami-addons - 1.16.0
Ebuild name:

dev-libs/kirigami-addons-1.16.0

Description

Visual end user components for Kirigami-based applications

Added to portage

2026-10-30

kismet - 2026.10.1
Ebuild name:

net-wireless/kismet-2026.10.1

Description

IEEE 802.11 wireless LAN sniffer

Added to portage

2026-10-30

kubelogin - 1.36.4
Ebuild name:

sys-cluster/kubelogin-1.36.4

Description

kubectl plugin for Kubernetes OpenID Connect authentication

Added to portage

2026-10-30

kubeseal - 0.41.2
Ebuild name:

sys-cluster/kubeseal-0.41.2

Description

Client-side utility for one-way encrypted secrets in kubernetes

Added to portage

2026-10-30

libtorrent-rasterbar - 2.0.15
Ebuild name:

net-libs/libtorrent-rasterbar-2.0.15

Description

C++ BitTorrent implementation focusing on efficiency and scala

Added to portage

2026-10-30

obs-studio - 33.0.1
Ebuild name:

media-video/obs-studio-33.0.1

Description

Software for Recording and Streaming Live Video Content

Added to portage

2026-10-30

qbittorrent - 5.1.4-r2
Ebuild name:

net-p2p/qbittorrent-5.1.4-r2

Description

BitTorrent client in C++ and Qt

Added to portage

2026-10-30

qbittorrent - 5.2.4-r1
Ebuild name:

net-p2p/qbittorrent-5.2.4-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-10-30

qbittorrent - 5.3.0-r1
Ebuild name:

net-p2p/qbittorrent-5.3.0-r1

Description

BitTorrent client in C++ and Qt

Added to portage

2026-10-30

rasterio - 1.5.2
Ebuild name:

sci-geosciences/rasterio-1.5.2

Description

Rasterio reads and writes geospatial raster datasets

Added to portage

2026-10-30

reaper-bin - 7.84
Ebuild name:

media-sound/reaper-bin-7.84

Description

Digital audio workstation

Added to portage

2026-10-30

uwsm - 0.27.1
Ebuild name:

gui-apps/uwsm-0.27.1

Description

Universal Wayland Session Manager

Added to portage

2026-10-30

virtctl - 1.9.1
Ebuild name:

sys-cluster/virtctl-1.9.1

Description

Control virtual machine related operations on your kubernetes cluster

Added to portage

2026-10-30

2026-10-29
android-studio - 2026.2.2.8
Ebuild name:

dev-util/android-studio-2026.2.2.8

Description

Android development environment based on IntelliJ IDEA

Added to portage

2026-10-29

asdf - 3.3.7
Ebuild name:

dev-lisp/asdf-3.3.7

Description

ASDF is Another System Definition Facility for Common Lisp

Added to portage

2026-10-29

aws-c-s3 - 1.5.1
Ebuild name:

dev-libs/aws-c-s3-1.5.1

Description

AWS C S3 async library

Added to portage

2026-10-29

cachetools - 7.2.7
Ebuild name:

dev-python/cachetools-7.2.7

Description

Extensible memoizing collections and decorators

Added to portage

2026-10-29

cfn-lint - 1.59.0
Ebuild name:

dev-python/cfn-lint-1.59.0

Description

CloudFormation Linter

Added to portage

2026-10-29

cli-helpers - 2.15.3
Ebuild name:

dev-python/cli-helpers-2.15.3

Description

Python helpers for common CLI tasks

Added to portage

2026-10-29

clozurecl - 1.14
Ebuild name:

dev-lisp/clozurecl-1.14

Description

Common Lisp implementation, derived from Digitool's MCL product

Added to portage

2026-10-29

editorconfig-core-c - 0.12.11
Ebuild name:

app-text/editorconfig-core-c-0.12.11

Description

EditorConfig core library written in C

Added to portage

2026-10-29

editorconfig-core-c - 0.12.11-r1
Ebuild name:

app-text/editorconfig-core-c-0.12.11-r1

Description

EditorConfig core library written in C

Added to portage

2026-10-29

faker - 40.44.0
Ebuild name:

dev-python/faker-40.44.0

Description

A Python package that generates fake data for you

Added to portage

2026-10-29

fastsimdjson - 0.9.0
Ebuild name:

dev-python/fastsimdjson-0.9.0

Description

fast JSON in Python

Added to portage

2026-10-29

flake8 - 7.5.0
Ebuild name:

dev-python/flake8-7.5.0

Description

A wrapper around PyFlakes, pep8 & mccabe

Added to portage

2026-10-29

gentoo-reminders - 0.1.0
Ebuild name:

app-portage/gentoo-reminders-0.1.0

Description

Generate reminder emails for Gentoo package maintainers

Added to portage

2026-10-29

ggml - 0.28.0
Ebuild name:

sci-ml/ggml-0.28.0

Description

Tensor library for machine learning

Added to portage

2026-10-29

google-api-core - 2.43.1
Ebuild name:

dev-python/google-api-core-2.43.1

Description

Core Library for Google Client Libraries

Added to portage

2026-10-29

gpxsee - 16.19
Ebuild name:

sci-geosciences/gpxsee-16.19

Description

Viewer and analyzer that supports gpx, tcx, kml, fit, igc and nmea fil

Added to portage

2026-10-29

hermes - 3.2
Ebuild name:

dev-util/hermes-3.2

Description

Lua based testing manager

Added to portage

2026-10-29

hspec - 2.11.18
Ebuild name:

dev-haskell/hspec-2.11.18

Description

A Testing Framework for Haskell

Added to portage

2026-10-29

hspec-core - 2.11.18
Ebuild name:

dev-haskell/hspec-core-2.11.18

Description

A Testing Framework for Haskell

Added to portage

2026-10-29

hspec-discover - 2.11.18
Ebuild name:

dev-haskell/hspec-discover-2.11.18

Description

Automatically discover and run Hspec tests

Added to portage

2026-10-29

hspec-meta - 2.11.18
Ebuild name:

dev-haskell/hspec-meta-2.11.18

Description

A version of Hspec which is used to test Hspec itself

Added to portage

2026-10-29

httplib2 - 0.32.1
Ebuild name:

dev-python/httplib2-0.32.1

Description

A comprehensive HTTP client library

Added to portage

2026-10-29

imageio-ffmpeg - 0.7.0
Ebuild name:

dev-python/imageio-ffmpeg-0.7.0

Description

FFMPEG wrapper for Python

Added to portage

2026-10-29

keepsecret - 26.08.2
Ebuild name:

app-crypt/keepsecret-26.08.2

Description

Password manager GUI for SecretService providers

Added to portage

2026-10-29

keybase - 6.0.2
Ebuild name:

app-crypt/keybase-6.0.2

Description

Keybase client

Added to portage

2026-10-29

keybase - 6.2.4
Ebuild name:

app-crypt/keybase-6.2.4

Description

Keybase client

Added to portage

2026-10-29

keybase - 9999
Ebuild name:

app-crypt/keybase-9999

Description

Keybase client

Added to portage

2026-10-29

lmod - 9.4.5
Ebuild name:

sys-cluster/lmod-9.4.5

Description

Environment Module System based on Lua

Added to portage

2026-10-29

maturin - 1.16.0
Ebuild name:

dev-util/maturin-1.16.0

Description

Build and publish crates with pyo3, rust-cpython and cffi bindings

Added to portage

2026-10-29

mypy - 2.4.1
Ebuild name:

dev-python/mypy-2.4.1

Description

Optional static typing for Python

Added to portage

2026-10-29

netpbm - 11.16.2
Ebuild name:

media-libs/netpbm-11.16.2

Description

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

Added to portage

2026-10-29

netpbm - 11.2.31
Ebuild name:

media-libs/netpbm-11.2.31

Description

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

Added to portage

2026-10-29

nodejs - 24.22.2
Ebuild name:

net-libs/nodejs-24.22.2

Description

A JavaScript runtime built on Chrome's V8 JavaScript engine

Added to portage

2026-10-29

ollama - 0.40.10
Ebuild name:

sci-ml/ollama-0.40.10

Description

Get up and running with Llama 3, Mistral, Gemma, and other language models

Added to portage

2026-10-29

openjdk - 17.0.21.0.3_p1
Ebuild name:

dev-java/openjdk-17.0.21.0.3_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-29

openjdk - 21.0.13.0.3_p1
Ebuild name:

dev-java/openjdk-21.0.13.0.3_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-29

openjdk - 25.0.5.0.3_p1
Ebuild name:

dev-java/openjdk-25.0.5.0.3_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-29

openjdk - 27.0.1.0.3_p1
Ebuild name:

dev-java/openjdk-27.0.1.0.3_p1

Description

Open source implementation of the Java programming language

Added to portage

2026-10-29

openjdk-jre-bin - 17.0.21_p9
Ebuild name:

dev-java/openjdk-jre-bin-17.0.21_p9

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-10-29

openjdk-jre-bin - 21.0.13_p9
Ebuild name:

dev-java/openjdk-jre-bin-21.0.13_p9

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-10-29

openjdk-jre-bin - 25.0.5_p8
Ebuild name:

dev-java/openjdk-jre-bin-25.0.5_p8

Description

Prebuilt Java JRE binaries provided by Eclipse Temurin

Added to portage

2026-10-29

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

sec-keys/openpgp-keys-gentoo-developers-20261026

Description

Gentoo Authority Keys (GLEP 79)

Added to portage

2026-10-29

oslo-config - 10.8.0
Ebuild name:

dev-python/oslo-config-10.8.0

Description

Oslo Configuration API

Added to portage

2026-10-29

paste - 3.11.0
Ebuild name:

dev-python/paste-3.11.0

Description

Tools for using a Web Server Gateway Interface stack

Added to portage

2026-10-29

pkginfo - 2.0
Ebuild name:

dev-python/pkginfo-2.0

Description

Provides an API for querying the distutils metadata written in a PKG-INFO fi

Added to portage

2026-10-29

plasma-workspace - 6.8.2-r1
Ebuild name:

kde-plasma/plasma-workspace-6.8.2-r1

Description

KDE Plasma workspace

Added to portage

2026-10-29

plex-media-server - 1.43.5.11079
Ebuild name:

media-tv/plex-media-server-1.43.5.11079

Description

Free media library that is intended for use with a plex cli

Added to portage

2026-10-29

pmix - 5.0.4-r2
Ebuild name:

sys-cluster/pmix-5.0.4-r2

Description

The Process Management Interface (PMI) Exascale

Added to portage

2026-10-29

pmix - 5.0.9-r1
Ebuild name:

sys-cluster/pmix-5.0.9-r1

Description

The Process Management Interface (PMI) Exascale

Added to portage

2026-10-29

pmix - 6.1.0-r1
Ebuild name:

sys-cluster/pmix-6.1.0-r1

Description

The Process Management Interface (PMI) Exascale

Added to portage

2026-10-29

prrte - 3.0.12-r1
Ebuild name:

sys-cluster/prrte-3.0.12-r1

Description

PMIx Reference RunTime Environment

Added to portage

2026-10-29

prrte - 3.0.7-r2
Ebuild name:

sys-cluster/prrte-3.0.7-r2

Description

PMIx Reference RunTime Environment

Added to portage

2026-10-29

pydantic-settings - 2.16.2
Ebuild name:

dev-python/pydantic-settings-2.16.2

Description

Settings management using Pydantic

Added to portage

2026-10-29

pyflakes - 4.1.0
Ebuild name:

dev-python/pyflakes-4.1.0

Description

Passive checker for Python programs

Added to portage

2026-10-29

pypdf - 6.21.4
Ebuild name:

dev-python/pypdf-6.21.4

Description

Python library to work with PDF files

Added to portage

2026-10-29

pytest-forked - 1.7.5-r1
Ebuild name:

dev-python/pytest-forked-1.7.5-r1

Description

Run tests in isolated forked subprocesses

Added to portage

2026-10-29

python-engineio - 4.15.1
Ebuild name:

dev-python/python-engineio-4.15.1

Description

Python implementation of the Engine.IO realtime server

Added to portage

2026-10-29

pytorch - 2.15.0
Ebuild name:

sci-ml/pytorch-2.15.0

Description

Tensors and Dynamic neural networks in Python with strong GPU acceleration

Added to portage

2026-10-29

rivet - 4.1.4
Ebuild name:

sci-physics/rivet-4.1.4

Description

Robust Independent Validation of Experiment and Theory toolkit

Added to portage

2026-10-29

rq - 3.0.0
Ebuild name:

dev-python/rq-3.0.0

Description

Simple, lightweight library for creating and processing background jobs

Added to portage

2026-10-29

simdjson - 5.0.8
Ebuild name:

dev-libs/simdjson-5.0.8

Description

SIMD accelerated C++ JSON library

Added to portage

2026-10-29

spidermonkey - 153.6.0
Ebuild name:

dev-lang/spidermonkey-153.6.0

Description

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

Added to portage

2026-10-29

uiop - 3.3.7
Ebuild name:

dev-lisp/uiop-3.3.7

Description

UIOP is a portability layer spun off ASDF3

Added to portage

2026-10-29

urwid - 5.0.0
Ebuild name:

dev-python/urwid-5.0.0

Description

Curses-based user interface library for Python

Added to portage

2026-10-29

wordpress - 6.4.14
Ebuild name:

www-apps/wordpress-6.4.14

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 6.5.14
Ebuild name:

www-apps/wordpress-6.5.14

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 6.6.11
Ebuild name:

www-apps/wordpress-6.6.11

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 6.7.11
Ebuild name:

www-apps/wordpress-6.7.11

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 6.8.12
Ebuild name:

www-apps/wordpress-6.8.12

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 6.9.11
Ebuild name:

www-apps/wordpress-6.9.11

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 7.0.8
Ebuild name:

www-apps/wordpress-7.0.8

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

wordpress - 7.1.4
Ebuild name:

www-apps/wordpress-7.1.4

Description

Wordpress PHP and MySQL based content management system (CMS)

Added to portage

2026-10-29

xlsxwriter - 3.3.1
Ebuild name:

dev-python/xlsxwriter-3.3.1

Description

Python module for creating Excel XLSX files

Added to portage

2026-10-29

xmrig - 6.26.0-r1
Ebuild name:

net-misc/xmrig-6.26.0-r1

Description

RandomX, CryptoNight, KawPow, AstroBWT, and Argon2 CPU/GPU miner

Added to portage

2026-10-29

yoda - 2.1.4
Ebuild name:

sci-physics/yoda-2.1.4

Description

Yet more Objects for (High Energy Physics) Data Analysis

Added to portage

2026-10-29

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