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:

88750

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-09-28
4ti2 - 1.6.10-r1
Ebuild name:

sci-mathematics/4ti2-1.6.10-r1

Description

Software package for algebraic, geometric and combinatorial problems

Added to portage

2026-09-28

4ti2 - 1.6.15
Ebuild name:

sci-mathematics/4ti2-1.6.15

Description

Software package for algebraic, geometric and combinatorial problems

Added to portage

2026-09-28

aiohttp - 3.14.3-r1
Ebuild name:

dev-python/aiohttp-3.14.3-r1

Description

HTTP client/server for asyncio

Added to portage

2026-09-28

chrome-binary-plugins - 156.0.8072.0_alpha
Ebuild name:

www-plugins/chrome-binary-plugins-156.0.8072.0_alpha

Description

Binary plugins from Google Chrome for use in C

Added to portage

2026-09-28

coverage - 7.16.2
Ebuild name:

dev-python/coverage-7.16.2

Description

Code coverage measurement for Python

Added to portage

2026-09-28

cypari2 - 2.2.4-r1
Ebuild name:

dev-python/cypari2-2.2.4-r1

Description

Cython interface to PARI

Added to portage

2026-09-28

egl-wayland - 1.1.23
Ebuild name:

gui-libs/egl-wayland-1.1.23

Description

NVIDIA wayland EGL external platform library

Added to portage

2026-09-28

elementary-xfce-icon-theme - 0.23
Ebuild name:

x11-themes/elementary-xfce-icon-theme-0.23

Description

Elementary icons forked from upstream, extended and main

Added to portage

2026-09-28

ffmpeg-soc-udev-rules - 0
Ebuild name:

media-video/ffmpeg-soc-udev-rules-0

Description

Common udev rules for ffmpeg and ffmpeg-compat with USE=soc

Added to portage

2026-09-28

gcc - 14.4.1_p20260924
Ebuild name:

sys-devel/gcc-14.4.1_p20260924

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 15.3.1_p20260925
Ebuild name:

sys-devel/gcc-15.3.1_p20260925

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 16.2.1_p20260926
Ebuild name:

sys-devel/gcc-16.2.1_p20260926

Description

The GNU Compiler Collection

Added to portage

2026-09-28

gcc - 17.0.0_p20260927
Ebuild name:

sys-devel/gcc-17.0.0_p20260927

Description

The GNU Compiler Collection

Added to portage

2026-09-28

ghostscript-gpl - 10.08.0
Ebuild name:

app-text/ghostscript-gpl-10.08.0

Description

Interpreter for the PostScript language and PDF

Added to portage

2026-09-28

git-sources - 7.3_rc5
Ebuild name:

sys-kernel/git-sources-7.3_rc5

Description

The very latest -git version of the Linux kernel

Added to portage

2026-09-28

glpk - 5.0-r5
Ebuild name:

sci-mathematics/glpk-5.0-r5

Description

GNU Linear Programming Kit

Added to portage

2026-09-28

google-chrome-unstable - 156.0.8072.0
Ebuild name:

www-client/google-chrome-unstable-156.0.8072.0

Description

The web browser from Google

Added to portage

2026-09-28

gramps - 6.0.8-r1
Ebuild name:

app-misc/gramps-6.0.8-r1

Description

Community genealogy program aiming to be both intuitive and feature-comple

Added to portage

2026-09-28

hashcat - 7.1.2-r1
Ebuild name:

app-crypt/hashcat-7.1.2-r1

Description

World's fastest and most advanced password recovery utility

Added to portage

2026-09-28

hypothesis - 6.168.2
Ebuild name:

dev-python/hypothesis-6.168.2

Description

A library for property based testing

Added to portage

2026-09-28

imagemagick - 7.1.2.32
Ebuild name:

media-gfx/imagemagick-7.1.2.32

Description

A collection of tools and libraries for many image formats

Added to portage

2026-09-28

intel-graphics-compiler - 2.41.9-r1
Ebuild name:

dev-util/intel-graphics-compiler-2.41.9-r1

Description

LLVM-based OpenCL compiler for OpenCL targetting Intel G

Added to portage

2026-09-28

lmdb - 1.0.2
Ebuild name:

dev-db/lmdb-1.0.2

Description

An ultra-fast, ultra-compact key-value embedded data store

Added to portage

2026-09-28

meson - 1.12.1
Ebuild name:

dev-build/meson-1.12.1

Description

Open source build system

Added to portage

2026-09-28

microsoft-edge - 154.0.4258.37
Ebuild name:

www-client/microsoft-edge-154.0.4258.37

Description

The web browser from Microsoft

Added to portage

2026-09-28

microsoft-edge-beta - 155.0.4283.18
Ebuild name:

www-client/microsoft-edge-beta-155.0.4283.18

Description

The web browser from Microsoft

Added to portage

2026-09-28

netcdf-cxx - 4.3.1-r2
Ebuild name:

sci-libs/netcdf-cxx-4.3.1-r2

Description

C++ library for netCDF

Added to portage

2026-09-28

opera - 136.0.6008.52
Ebuild name:

www-client/opera-136.0.6008.52

Description

A fast and secure web browser

Added to portage

2026-09-28

opera-developer - 137.0.6029.0
Ebuild name:

www-client/opera-developer-137.0.6029.0

Description

A fast and secure web browser

Added to portage

2026-09-28

opera-gx - 135.0.5973.153
Ebuild name:

www-client/opera-gx-135.0.5973.153

Description

Opera, but for 'gamers'

Added to portage

2026-09-28

pari - 2.17.4
Ebuild name:

sci-mathematics/pari-2.17.4

Description

Computer-aided number theory C library and tools

Added to portage

2026-09-28

peewee - 4.5.2
Ebuild name:

dev-python/peewee-4.5.2

Description

Small Python ORM

Added to portage

2026-09-28

pytest-mock - 3.16.0
Ebuild name:

dev-python/pytest-mock-3.16.0

Description

Thin-wrapper around the mock package for easier use with pytest

Added to portage

2026-09-28

python-slugify - 9.1.2
Ebuild name:

dev-python/python-slugify-9.1.2

Description

A Python Slugify application that handles Unicode

Added to portage

2026-09-28

siegfried - 1.11.9
Ebuild name:

app-misc/siegfried-1.11.9

Description

Signature-based file format identification

Added to portage

2026-09-28

sqlglot - 30.20.0
Ebuild name:

dev-python/sqlglot-30.20.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2026-09-28

tox - 4.64.4
Ebuild name:

dev-python/tox-4.64.4

Description

virtualenv-based automation of test activities

Added to portage

2026-09-28

v4l2loopback - 0.15.4
Ebuild name:

media-video/v4l2loopback-0.15.4

Description

v4l2 loopback device whose output is its own input

Added to portage

2026-09-28

vivaldi - 8.2.4133.64
Ebuild name:

www-client/vivaldi-8.2.4133.64

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi - 8.2.4133.68
Ebuild name:

www-client/vivaldi-8.2.4133.68

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi-snapshot - 8.3.4161.3
Ebuild name:

www-client/vivaldi-snapshot-8.3.4161.3

Description

A browser for our friends

Added to portage

2026-09-28

vivaldi-snapshot - 8.3.4171.3
Ebuild name:

www-client/vivaldi-snapshot-8.3.4171.3

Description

A browser for our friends

Added to portage

2026-09-28

werkzeug - 3.1.9
Ebuild name:

dev-python/werkzeug-3.1.9

Description

Collection of various utilities for WSGI applications

Added to portage

2026-09-28

wrapt - 2.5.0
Ebuild name:

dev-python/wrapt-2.5.0

Description

Module for decorators, wrappers and monkey patching

Added to portage

2026-09-28

2026-09-27
atuin - 18.23.0
Ebuild name:

app-shells/atuin-18.23.0

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2026-09-27

avrdude - 8.3
Ebuild name:

dev-embedded/avrdude-8.3

Description

AVR Downloader/UploaDEr

Added to portage

2026-09-27

baikal - 0.12.1
Ebuild name:

www-apps/baikal-0.12.1

Description

Lightweight CalDAV+CardDAV server

Added to portage

2026-09-27

cattrs - 26.2.1
Ebuild name:

dev-python/cattrs-26.2.1

Description

Composable complex class support for attrs and dataclasses

Added to portage

2026-09-27

clinfo - 3.1.26.09.26
Ebuild name:

dev-util/clinfo-3.1.26.09.26

Description

A tool to display info about the system's OpenCL capabilities

Added to portage

2026-09-27

cpptest - 2.0.1
Ebuild name:

dev-util/cpptest-2.0.1

Description

Simple but powerful unit testing framework for C++

Added to portage

2026-09-27

deprecated - 3.0.0
Ebuild name:

dev-python/deprecated-3.0.0

Description

Python @deprecated decorator to deprecate old API

Added to portage

2026-09-27

drupal - 10.6.18
Ebuild name:

www-apps/drupal-10.6.18

Description

PHP-based open-source platform and content management system

Added to portage

2026-09-27

drupal - 11.3.17
Ebuild name:

www-apps/drupal-11.3.17

Description

PHP-based open-source platform and content management system

Added to portage

2026-09-27

drupal - 11.4.8
Ebuild name:

www-apps/drupal-11.4.8

Description

PHP-based open-source platform and content management system

Added to portage

2026-09-27

filelock - 4.0.4
Ebuild name:

dev-python/filelock-4.0.4

Description

A platform independent file lock for Python

Added to portage

2026-09-27

gexiv2 - 0.14.7-r1
Ebuild name:

media-libs/gexiv2-0.14.7-r1

Description

GObject-based wrapper around the Exiv2 library

Added to portage

2026-09-27

gtk+ - 2.24.33-r4
Ebuild name:

x11-libs/gtk+-2.24.33-r4

Description

Gimp ToolKit +

Added to portage

2026-09-27

identify - 2.6.20
Ebuild name:

dev-python/identify-2.6.20

Description

File identification library for Python

Added to portage

2026-09-27

inotify-tools - 4.26.262
Ebuild name:

sys-fs/inotify-tools-4.26.262

Description

Set of command-line programs providing a simple interface to inotify

Added to portage

2026-09-27

intel-microcode - 20260925_p20260925
Ebuild name:

sys-firmware/intel-microcode-20260925_p20260925

Description

Intel IA32/IA64 microcode update data

Added to portage

2026-09-27

knowit - 0.7.1
Ebuild name:

dev-python/knowit-0.7.1

Description

Know better your media files

Added to portage

2026-09-27

libvmaf - 3.2.1
Ebuild name:

media-libs/libvmaf-3.2.1

Description

C libary for Netflix's Perceptual video quality assessment

Added to portage

2026-09-27

meson-python - 0.22.0
Ebuild name:

dev-python/meson-python-0.22.0

Description

Meson PEP 517 Python build backend

Added to portage

2026-09-27

multidict - 7.0.0
Ebuild name:

dev-python/multidict-7.0.0

Description

multidict implementation

Added to portage

2026-09-27

netcdf - 4.10.1-r1
Ebuild name:

sci-libs/netcdf-4.10.1-r1

Description

Scientific library and interface for array oriented data access

Added to portage

2026-09-27

netcdf - 4.9.3-r3
Ebuild name:

sci-libs/netcdf-4.9.3-r3

Description

Scientific library and interface for array oriented data access

Added to portage

2026-09-27

networkmanager - 1.58.1-r2
Ebuild name:

net-misc/networkmanager-1.58.1-r2

Description

A set of co-operative tools that make networking simple and strai

Added to portage

2026-09-27

nodeenv - 1.11.0
Ebuild name:

dev-python/nodeenv-1.11.0

Description

Node.js virtual environment builder

Added to portage

2026-09-27

owasp-java-encoder - 1.4.1
Ebuild name:

dev-java/owasp-java-encoder-1.4.1

Description

OWASP Java Encoder

Added to portage

2026-09-27

papers - 50.3
Ebuild name:

app-text/papers-50.3

Description

A document viewer for the GNOME desktop

Added to portage

2026-09-27

pikepdf - 10.14.0
Ebuild name:

dev-python/pikepdf-10.14.0

Description

Python library to work with pdf files based on qpdf

Added to portage

2026-09-27

pkgcheck - 0.10.45
Ebuild name:

dev-util/pkgcheck-0.10.45

Description

pkgcore-based QA utility for ebuild repos

Added to portage

2026-09-27

pkgcore - 0.12.44
Ebuild name:

sys-apps/pkgcore-0.12.44

Description

a framework for package management

Added to portage

2026-09-27

platformdirs - 4.12.0
Ebuild name:

dev-python/platformdirs-4.12.0

Description

A small Python module for determining appropriate platform-specific

Added to portage

2026-09-27

postfix - 3.12_pre20260925
Ebuild name:

mail-mta/postfix-3.12_pre20260925

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2026-09-27

qpdf - 12.4.2
Ebuild name:

app-text/qpdf-12.4.2

Description

Command-line tool for structural, content-preserving transformation of PDF fil

Added to portage

2026-09-27

rope - 1.15.0
Ebuild name:

dev-python/rope-1.15.0

Description

Python refactoring library

Added to portage

2026-09-27

shader-slang - 2026.18.3
Ebuild name:

dev-util/shader-slang-2026.18.3

Description

Making it easier to work with shaders

Added to portage

2026-09-27

umockdev - 0.19.9
Ebuild name:

dev-util/umockdev-0.19.9

Description

Mock hardware devices for creating unit tests

Added to portage

2026-09-27

vips - 8.18.7
Ebuild name:

media-libs/vips-8.18.7

Description

VIPS Image Processing Library

Added to portage

2026-09-27

virtualenv - 21.13.0
Ebuild name:

dev-python/virtualenv-21.13.0

Description

Virtual Python Environment builder

Added to portage

2026-09-27

zsnes - 2.3.3
Ebuild name:

games-emulation/zsnes-2.3.3

Description

Fork of the classic Super Nintendo emulator

Added to portage

2026-09-27

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