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:

80851

userrating:

average rating: 1.2 (50 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.


rate this article:
current rating: average rating: 1.3 (31 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2025-09-16
asciinema - 3.0.0
Ebuild name:

app-misc/asciinema-3.0.0

Description

Terminal session recorder, streamer, and player

Added to portage

2025-09-16

awscli - 1.42.31
Ebuild name:

app-admin/awscli-1.42.31

Description

Universal Command Line Environment for AWS

Added to portage

2025-09-16

blessed - 1.22.0
Ebuild name:

dev-python/blessed-1.22.0

Description

Library for making terminal apps using colors, keyboard input and positio

Added to portage

2025-09-16

boost - 1.89.0
Ebuild name:

dev-libs/boost-1.89.0

Description

Boost Libraries for C++

Added to portage

2025-09-16

boto3 - 1.40.31
Ebuild name:

dev-python/boto3-1.40.31

Description

The AWS SDK for Python

Added to portage

2025-09-16

botocore - 1.40.31
Ebuild name:

dev-python/botocore-1.40.31

Description

Low-level, data-driven core of boto 3

Added to portage

2025-09-16

calamares - 3.3.14-r3
Ebuild name:

app-admin/calamares-3.3.14-r3

Description

Distribution-independent installer framework

Added to portage

2025-09-16

calamares-gentoo-livecd - 3.3.14_p20250915
Ebuild name:

app-misc/calamares-gentoo-livecd-3.3.14_p20250915

Description

Gentoo Linux Calamares installer configuration fo

Added to portage

2025-09-16

dulwich - 0.24.1
Ebuild name:

dev-python/dulwich-0.24.1

Description

Pure-Python implementation of the Git file formats and protocols

Added to portage

2025-09-16

faker - 37.8.0
Ebuild name:

dev-python/faker-37.8.0

Description

A Python package that generates fake data for you

Added to portage

2025-09-16

fastbencode - 0.3.6
Ebuild name:

dev-python/fastbencode-0.3.6

Description

Implementation of bencode with Rust implementation

Added to portage

2025-09-16

firefox - 140.3.0
Ebuild name:

www-client/firefox-140.3.0

Description

Firefox Web Browser

Added to portage

2025-09-16

firefox - 143.0
Ebuild name:

www-client/firefox-143.0

Description

Firefox Web Browser

Added to portage

2025-09-16

fitsio - 1.2.8
Ebuild name:

dev-python/fitsio-1.2.8

Description

Python library to read from and write to FITS files

Added to portage

2025-09-16

freeipmi - 1.6.16
Ebuild name:

sys-libs/freeipmi-1.6.16

Description

Provides Remote-Console and System Management Software as per IPMI v1.5/2.

Added to portage

2025-09-16

gocryptfs - 2.6.1-r1
Ebuild name:

app-crypt/gocryptfs-2.6.1-r1

Description

Encrypted overlay filesystem written in Go

Added to portage

2025-09-16

godot - 4.5
Ebuild name:

dev-games/godot-4.5

Description

Multi-platform 2D and 3D game engine with a feature-rich editor

Added to portage

2025-09-16

httplib2 - 0.31.0
Ebuild name:

dev-python/httplib2-0.31.0

Description

A comprehensive HTTP client library

Added to portage

2025-09-16

hypothesis - 6.138.17
Ebuild name:

dev-python/hypothesis-6.138.17

Description

A library for property based testing

Added to portage

2025-09-16

inline-snapshot - 0.29.0
Ebuild name:

dev-python/inline-snapshot-0.29.0

Description

Create and update inline snapshots in your Python tests

Added to portage

2025-09-16

iozone - 3.507
Ebuild name:

app-benchmarks/iozone-3.507

Description

Filesystem benchmarking program

Added to portage

2025-09-16

iozone - 3.508
Ebuild name:

app-benchmarks/iozone-3.508

Description

Filesystem benchmarking program

Added to portage

2025-09-16

kombu - 5.6.0_beta3
Ebuild name:

dev-python/kombu-5.6.0_beta3

Description

AMQP Messaging Framework for Python

Added to portage

2025-09-16

mkdocs-material - 9.6.20
Ebuild name:

dev-python/mkdocs-material-9.6.20

Description

A Material Design theme for MkDocs

Added to portage

2025-09-16

openipmi - 2.0.37
Ebuild name:

sys-libs/openipmi-2.0.37

Description

Library interface to IPMI

Added to portage

2025-09-16

openpgp-keys-gocryptfs - 20250916
Ebuild name:

sec-keys/openpgp-keys-gocryptfs-20250916

Description

OpenPGP keys used to sign gocryptfs

Added to portage

2025-09-16

paramiko - 4.0.0-r1
Ebuild name:

dev-python/paramiko-4.0.0-r1

Description

SSH2 protocol library

Added to portage

2025-09-16

pixi - 0.55.0
Ebuild name:

dev-util/pixi-0.55.0

Description

A package management and workflow tool

Added to portage

2025-09-16

poetry - 2.2.0
Ebuild name:

dev-python/poetry-2.2.0

Description

A frontend for poetry - a python dependency management and packaging tool

Added to portage

2025-09-16

poetry-core - 2.2.0
Ebuild name:

dev-python/poetry-core-2.2.0

Description

Poetry PEP 517 Build Backend

Added to portage

2025-09-16

protobuf - 6.32.1-r1
Ebuild name:

dev-python/protobuf-6.32.1-r1

Description

Google's Protocol Buffers - Python bindings

Added to portage

2025-09-16

pyicu - 2.15.3
Ebuild name:

dev-python/pyicu-2.15.3

Description

Python bindings for dev-libs/icu

Added to portage

2025-09-16

pytest-check - 2.5.4
Ebuild name:

dev-python/pytest-check-2.5.4

Description

pytest plugin that allows multiple failures per test

Added to portage

2025-09-16

qtconsole - 5.7.0
Ebuild name:

dev-python/qtconsole-5.7.0

Description

Qt-based console for Jupyter with support for rich media output

Added to portage

2025-09-16

racket-mode - 9999
Ebuild name:

app-emacs/racket-mode-9999

Description

Emacs modes for Racket edit, REPL, check-syntax, debug, profile, and mor

Added to portage

2025-09-16

racket-mode - 9999
Ebuild name:

app-emacs/racket-mode-9999

Description

Emacs modes for Racket edit, REPL, check-syntax, debug, profile, and mor

Added to portage

2025-09-16

rainbow-delimiters - 2.1.5
Ebuild name:

app-emacs/rainbow-delimiters-2.1.5

Description

Highlight nested parentheses, brackets, and braces according to

Added to portage

2025-09-16

simdjson - 4.0.2
Ebuild name:

dev-libs/simdjson-4.0.2

Description

SIMD accelerated C++ JSON library

Added to portage

2025-09-16

tuxedo-drivers - 4.15.4
Ebuild name:

app-laptop/tuxedo-drivers-4.15.4

Description

Kernel modules for TUXEDO laptops

Added to portage

2025-09-16

types-gdb - 16.3.0.20250915
Ebuild name:

dev-python/types-gdb-16.3.0.20250915

Description

Typing stubs for gdb

Added to portage

2025-09-16

urwid - 3.0.3
Ebuild name:

dev-python/urwid-3.0.3

Description

Curses-based user interface library for Python

Added to portage

2025-09-16

xlsxwriter - 3.2.9
Ebuild name:

dev-python/xlsxwriter-3.2.9

Description

Python module for creating Excel XLSX files

Added to portage

2025-09-16

xvfbwrapper - 0.2.14
Ebuild name:

dev-python/xvfbwrapper-0.2.14

Description

Python wrapper for running a display inside X virtual framebuffer

Added to portage

2025-09-16

zeep - 4.3.2
Ebuild name:

dev-python/zeep-4.3.2

Description

A modern/fast Python SOAP client based on lxml / requests

Added to portage

2025-09-16

2025-09-15
claude-code - 1.0.113
Ebuild name:

dev-util/claude-code-1.0.113

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2025-09-15

cue - 0.14.1
Ebuild name:

dev-lang/cue-0.14.1

Description

open-source data validation language and inference engine

Added to portage

2025-09-15

dealii - 9.7.1
Ebuild name:

sci-libs/dealii-9.7.1

Description

Solving partial differential equations with the finite element method

Added to portage

2025-09-15

dillo - 3.2.0
Ebuild name:

www-client/dillo-3.2.0

Description

Lean FLTK based web browser

Added to portage

2025-09-15

ffmpeg - 7.1.2
Ebuild name:

media-video/ffmpeg-7.1.2

Description

Complete solution to record/convert/stream audio and video

Added to portage

2025-09-15

ffmpeg-compat - 7.1.2
Ebuild name:

media-video/ffmpeg-compat-7.1.2

Description

Complete solution to record/convert/stream audio and video

Added to portage

2025-09-15

firefox-bin - 143.0
Ebuild name:

www-client/firefox-bin-143.0

Description

Firefox Web Browser

Added to portage

2025-09-15

gcc - 16.0.0_p20250914
Ebuild name:

sys-devel/gcc-16.0.0_p20250914

Description

The GNU Compiler Collection

Added to portage

2025-09-15

git-sources - 6.17_rc6
Ebuild name:

sys-kernel/git-sources-6.17_rc6

Description

The very latest -git version of the Linux kernel

Added to portage

2025-09-15

hw-probe - 1.6.6-r3
Ebuild name:

sys-apps/hw-probe-1.6.6-r3

Description

A tool to probe for hardware, check it's operability and find drivers

Added to portage

2025-09-15

jpegoptim - 1.5.6
Ebuild name:

media-gfx/jpegoptim-1.5.6

Description

Utility to optimize JPEG files

Added to portage

2025-09-15

kochmorse - 3.5.1_p20250730
Ebuild name:

media-radio/kochmorse-3.5.1_p20250730

Description

Morse-code tutor using the Koch method

Added to portage

2025-09-15

libopenmpt - 0.8.3
Ebuild name:

media-libs/libopenmpt-0.8.3

Description

Library to decode tracked music files (modules)

Added to portage

2025-09-15

lidarr-bin - 2.14.2.4785
Ebuild name:

www-apps/lidarr-bin-2.14.2.4785

Description

Looks and smells like Sonarr but made for music

Added to portage

2025-09-15

minisig-keys-ccache - 20250914
Ebuild name:

sec-keys/minisig-keys-ccache-20250914

Description

OpenPGP keys used for ccache

Added to portage

2025-09-15

openmpt123 - 0.8.3
Ebuild name:

media-sound/openmpt123-0.8.3

Description

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

Added to portage

2025-09-15

portage - 3.0.69.1
Ebuild name:

sys-apps/portage-3.0.69.1

Description

The package management and distribution system for Gentoo

Added to portage

2025-09-15

portage - 3.0.69.1-r1
Ebuild name:

sys-apps/portage-3.0.69.1-r1

Description

The package management and distribution system for Gentoo

Added to portage

2025-09-15

postgresql - 13.22-r2
Ebuild name:

dev-db/postgresql-13.22-r2

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

postgresql - 14.19-r2
Ebuild name:

dev-db/postgresql-14.19-r2

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

postgresql - 15.14-r2
Ebuild name:

dev-db/postgresql-15.14-r2

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

postgresql - 16.10-r2
Ebuild name:

dev-db/postgresql-16.10-r2

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

postgresql - 17.6-r1
Ebuild name:

dev-db/postgresql-17.6-r1

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

postgresql - 18_rc1-r2
Ebuild name:

dev-db/postgresql-18_rc1-r2

Description

PostgreSQL RDBMS

Added to portage

2025-09-15

prowlarr-bin - 2.1.1.5185
Ebuild name:

www-apps/prowlarr-bin-2.1.1.5185

Description

An indexer manager/proxy to integrate with your various PVR apps

Added to portage

2025-09-15

puma - 7.0.3
Ebuild name:

www-servers/puma-7.0.3

Description

a simple, fast, threaded, and highly concurrent HTTP 1.1 server for Ruby/Rac

Added to portage

2025-09-15

pyenchant - 3.3.0
Ebuild name:

dev-python/pyenchant-3.3.0

Description

Python bindings for the Enchant spellchecking system

Added to portage

2025-09-15

pyopenssl - 25.2.0
Ebuild name:

dev-python/pyopenssl-25.2.0

Description

Python interface to the OpenSSL library

Added to portage

2025-09-15

python-dbusmock - 0.37.0
Ebuild name:

dev-python/python-dbusmock-0.37.0

Description

Easily create mock objects on D-Bus for software testing

Added to portage

2025-09-15

qsstv - 9.5.11_pre20250212
Ebuild name:

media-radio/qsstv-9.5.11_pre20250212

Description

Amateur radio SSTV software

Added to portage

2025-09-15

scx - 1.0.16
Ebuild name:

sys-kernel/scx-1.0.16

Description

sched_ext schedulers and tools

Added to portage

2025-09-15

slack - 4.46.96
Ebuild name:

net-im/slack-4.46.96

Description

Team collaboration tool

Added to portage

2025-09-15

syd - 3.38.5
Ebuild name:

sys-apps/syd-3.38.5

Description

seccomp and landlock based application sandbox with support for namespaces

Added to portage

2025-09-15

thunar - 4.20.5
Ebuild name:

xfce-base/thunar-4.20.5

Description

File manager for the Xfce desktop environment

Added to portage

2025-09-15

types-docutils - 0.22.0.20250914
Ebuild name:

dev-python/types-docutils-0.22.0.20250914

Description

Typing stubs for docutils

Added to portage

2025-09-15

unionfs-fuse - 3.7
Ebuild name:

sys-fs/unionfs-fuse-3.7

Description

Self-syncing tree-merging file system based on FUSE

Added to portage

2025-09-15

xlsxwriter - 3.2.8
Ebuild name:

dev-python/xlsxwriter-3.2.8

Description

Python module for creating Excel XLSX files

Added to portage

2025-09-15

zstandard - 0.25.0
Ebuild name:

dev-python/zstandard-0.25.0

Description

Zstandard Bindings for Python

Added to portage

2025-09-15

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 70.6 ms