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:

82575

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
2025-12-23
alsa-lib - 1.2.15.1-r1
Ebuild name:

media-libs/alsa-lib-1.2.15.1-r1

Description

Advanced Linux Sound Architecture Library

Added to portage

2025-12-23

fuse - 3.18.1
Ebuild name:

sys-fs/fuse-3.18.1

Description

An interface for filesystems implemented in userspace

Added to portage

2025-12-23

gherkin-official - 37.0.1
Ebuild name:

dev-python/gherkin-official-37.0.1

Description

Gherkin parser/compiler for Python

Added to portage

2025-12-23

lxqt-panel - 2.3.2
Ebuild name:

lxqt-base/lxqt-panel-2.3.2

Description

LXQt desktop panel and plugins

Added to portage

2025-12-23

mcelog - 208
Ebuild name:

app-admin/mcelog-208

Description

A tool to log and decode Machine Check Exceptions

Added to portage

2025-12-23

org-roam - 2.3.0
Ebuild name:

app-emacs/org-roam-2.3.0

Description

Rudimentary Roam replica with Org-mode

Added to portage

2025-12-23

org-roam - 2.3.1
Ebuild name:

app-emacs/org-roam-2.3.1

Description

Rudimentary Roam replica with Org-mode

Added to portage

2025-12-23

org-roam - 9999
Ebuild name:

app-emacs/org-roam-9999

Description

Rudimentary Roam replica with Org-mode

Added to portage

2025-12-23

xterm - 406
Ebuild name:

x11-terms/xterm-406

Description

Terminal Emulator for X Windows

Added to portage

2025-12-23

2025-12-22
adwaita-icon-theme - 49.0
Ebuild name:

x11-themes/adwaita-icon-theme-49.0

Description

GNOME default icon theme

Added to portage

2025-12-22

apscheduler - 3.11.2
Ebuild name:

dev-python/apscheduler-3.11.2

Description

In-process task scheduler with Cron-like capabilities

Added to portage

2025-12-22

asahi-sources - 6.17.11_p1
Ebuild name:

sys-kernel/asahi-sources-6.17.11_p1

Description

Asahi Linux kernel sources

Added to portage

2025-12-22

asyncssh - 2.22.0
Ebuild name:

dev-python/asyncssh-2.22.0

Description

Asynchronous SSHv2 client and server library

Added to portage

2025-12-22

bitcoin-core - 30.1
Ebuild name:

net-p2p/bitcoin-core-30.1

Description

Reference implementation of the Bitcoin cryptocurrency

Added to portage

2025-12-22

ctypes-sh - 1.2_p20240626
Ebuild name:

app-shells/ctypes-sh-1.2_p20240626

Description

Foreign function interface for bash

Added to portage

2025-12-22

dasbus - 1.7
Ebuild name:

dev-python/dasbus-1.7

Description

DBus library in Python 3

Added to portage

2025-12-22

derper - 1.92.1
Ebuild name:

net-vpn/derper-1.92.1

Description

DERP server for tailscale network

Added to portage

2025-12-22

erlang - 28.3
Ebuild name:

dev-lang/erlang-28.3

Description

Erlang programming language, runtime environment and libraries (OTP)

Added to portage

2025-12-22

exo - 1.88.0
Ebuild name:

app-admin/exo-1.88.0

Description

Command-line tool for everything at Exoscale compute, storage, dns

Added to portage

2025-12-22

expected-lite - 0.10.0
Ebuild name:

dev-cpp/expected-lite-0.10.0

Description

Expected objects in C++11 and later in a single-file header-only libra

Added to portage

2025-12-22

fex-xtajit - 2512
Ebuild name:

app-emulation/fex-xtajit-2512

Description

A wine emulation dll for running x86 application on an arm64 host

Added to portage

2025-12-22

furo - 2025.12.19-r1
Ebuild name:

dev-python/furo-2025.12.19-r1

Description

Clean customisable Sphinx documentation theme

Added to portage

2025-12-22

furo - 2025.9.25-r1
Ebuild name:

dev-python/furo-2025.9.25-r1

Description

Clean customisable Sphinx documentation theme

Added to portage

2025-12-22

gcc - 16.0.0_p20251221
Ebuild name:

sys-devel/gcc-16.0.0_p20251221

Description

The GNU Compiler Collection

Added to portage

2025-12-22

git-sources - 6.19_rc2
Ebuild name:

sys-kernel/git-sources-6.19_rc2

Description

The very latest -git version of the Linux kernel

Added to portage

2025-12-22

gnome-backgrounds - 49.0
Ebuild name:

x11-themes/gnome-backgrounds-49.0

Description

A set of backgrounds packaged with the GNOME desktop

Added to portage

2025-12-22

gnome-terminal - 3.58.0
Ebuild name:

x11-terms/gnome-terminal-3.58.0

Description

A terminal emulator for GNOME

Added to portage

2025-12-22

gvfs - 1.56.1-r3
Ebuild name:

gnome-base/gvfs-1.56.1-r3

Description

Virtual filesystem implementation for GIO

Added to portage

2025-12-22

gvfs - 1.58.0
Ebuild name:

gnome-base/gvfs-1.58.0

Description

Virtual filesystem implementation for GIO

Added to portage

2025-12-22

hcloud - 1.58.0
Ebuild name:

app-admin/hcloud-1.58.0

Description

A command-line interface for Hetzner Cloud

Added to portage

2025-12-22

hwloc - 2.12.2
Ebuild name:

sys-apps/hwloc-2.12.2

Description

Displays the hardware topology in convenient formats

Added to portage

2025-12-22

i18n - 1.14.8
Ebuild name:

dev-ruby/i18n-1.14.8

Description

Add Internationalization support to your Ruby application

Added to portage

2025-12-22

idea-community - 2025.3.1
Ebuild name:

dev-util/idea-community-2025.3.1

Description

A complete toolset for web, mobile and enterprise development

Added to portage

2025-12-22

importlib-metadata - 8.7.1
Ebuild name:

dev-python/importlib-metadata-8.7.1

Description

Read metadata from Python packages

Added to portage

2025-12-22

intervaltree - 3.2.0-r1
Ebuild name:

dev-python/intervaltree-3.2.0-r1

Description

Editable interval tree data structure for Python 2 and 3

Added to portage

2025-12-22

jaraco-functools - 4.4.0
Ebuild name:

dev-python/jaraco-functools-4.4.0

Description

Additional functions used by other projects by developer jaraco

Added to portage

2025-12-22

kernel-hardening-checker - 0.6.17.1
Ebuild name:

app-admin/kernel-hardening-checker-0.6.17.1

Description

A tool for checking the security hardening options of t

Added to portage

2025-12-22

koleo-cli - 0.2.137.26
Ebuild name:

app-misc/koleo-cli-0.2.137.26

Description

A simple CLI for koleo.pl railway planner

Added to portage

2025-12-22

langkit - 25.0.0-r6
Ebuild name:

dev-ada/langkit-25.0.0-r6

Description

A Python framework to generate language parsers

Added to portage

2025-12-22

libnotify - 0.8.7
Ebuild name:

x11-libs/libnotify-0.8.7

Description

A library for sending desktop notifications

Added to portage

2025-12-22

libsigc++ - 3.8.0
Ebuild name:

dev-libs/libsigc++-3.8.0

Description

Typesafe callback system for standard C++

Added to portage

2025-12-22

limine - 10.5.0
Ebuild name:

sys-boot/limine-10.5.0

Description

Limine is a modern, advanced, and portable BIOS/UEFI multiprotocol bootloade

Added to portage

2025-12-22

localsearch - 3.10.2
Ebuild name:

app-misc/localsearch-3.10.2

Description

Indexer and search engine that powers desktop search for core GNOME com

Added to portage

2025-12-22

lxterminal - 0.4.0_p20230917-r1
Ebuild name:

lxde-base/lxterminal-0.4.0_p20230917-r1

Description

Lightweight vte-based tabbed terminal emulator for LXDE

Added to portage

2025-12-22

mcfly - 0.9.3
Ebuild name:

app-shells/mcfly-0.9.3

Description

Context-aware bash history search replacement (ctrl-r)

Added to portage

2025-12-22

mpv - 0.41.0
Ebuild name:

media-video/mpv-0.41.0

Description

Media player for the command line

Added to portage

2025-12-22

mpvqt - 1.1.1-r2
Ebuild name:

media-libs/mpvqt-1.1.1-r2

Description

libmpv wrapper for QtQuick2 and QML

Added to portage

2025-12-22

msgraph - 0.2.3-r1
Ebuild name:

net-libs/msgraph-0.2.3-r1

Description

GLib-based library for accessing online serive APIs using MS Graph protoc

Added to portage

2025-12-22

msgraph - 0.3.3
Ebuild name:

net-libs/msgraph-0.3.3

Description

GLib-based library for accessing online serive APIs using MS Graph protocol.

Added to portage

2025-12-22

musescore - 4.6.5
Ebuild name:

media-sound/musescore-4.6.5

Description

WYSIWYG Music Score Typesetter

Added to portage

2025-12-22

mydumper - 0.21.2.2
Ebuild name:

dev-db/mydumper-0.21.2.2

Description

A high-performance multi-threaded backup (and restore) toolset for MySQL

Added to portage

2025-12-22

nautilus - 49.2
Ebuild name:

gnome-base/nautilus-49.2

Description

Default file manager for the GNOME desktop

Added to portage

2025-12-22

nginx - 1.29.4
Ebuild name:

www-servers/nginx-1.29.4

Description

Added to portage

2025-12-22

openmpi - 5.0.9
Ebuild name:

sys-cluster/openmpi-5.0.9

Description

A high-performance message passing library (MPI)

Added to portage

2025-12-22

orca - 49.5
Ebuild name:

app-accessibility/orca-49.5

Description

Extensible screen reader that provides access to the desktop

Added to portage

2025-12-22

pmix - 5.0.9
Ebuild name:

sys-cluster/pmix-5.0.9

Description

The Process Management Interface (PMI) Exascale

Added to portage

2025-12-22

pnp4nagios - 0.6.26_p20241118
Ebuild name:

net-analyzer/pnp4nagios-0.6.26_p20241118

Description

A performance data analyzer for nagios

Added to portage

2025-12-22

prrte - 3.0.12
Ebuild name:

sys-cluster/prrte-3.0.12

Description

PMIx Reference RunTime Environment

Added to portage

2025-12-22

pyfakefs - 6.0.0
Ebuild name:

dev-python/pyfakefs-6.0.0

Description

A fake file system that mocks the Python file system modules

Added to portage

2025-12-22

pygresql - 6.2.0
Ebuild name:

dev-python/pygresql-6.2.0

Description

A Python interface for the PostgreSQL database

Added to portage

2025-12-22

pypdf - 6.5.0
Ebuild name:

dev-python/pypdf-6.5.0

Description

Python library to work with PDF files

Added to portage

2025-12-22

pyro5 - 5.16
Ebuild name:

dev-python/pyro5-5.16

Description

Distributed object middleware for Python (RPC)

Added to portage

2025-12-22

qemu - 10.0.7
Ebuild name:

app-emulation/qemu-10.0.7

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2025-12-22

qemu - 10.1.3
Ebuild name:

app-emulation/qemu-10.1.3

Description

QEMU + Kernel-based Virtual Machine userland tools

Added to portage

2025-12-22

qgis - 3.44.6
Ebuild name:

sci-geosciences/qgis-3.44.6

Description

User friendly Geographic Information System

Added to portage

2025-12-22

qmidiarp - 0.7.1_p20251217-r1
Ebuild name:

media-sound/qmidiarp-0.7.1_p20251217-r1

Description

Arpeggiator, sequencer and MIDI LFO for ALSA

Added to portage

2025-12-22

reportlab - 4.4.7
Ebuild name:

dev-python/reportlab-4.4.7

Description

Tools for generating printable PDF documents from any data source

Added to portage

2025-12-22

rich-click - 1.9.5
Ebuild name:

dev-python/rich-click-1.9.5

Description

Format click help output nicely with rich

Added to portage

2025-12-22

rosegarden - 25.12
Ebuild name:

media-sound/rosegarden-25.12

Description

MIDI and audio sequencer and notation editor

Added to portage

2025-12-22

rtkit - 0.14
Ebuild name:

sys-auth/rtkit-0.14

Description

Realtime Policy and Watchdog Daemon

Added to portage

2025-12-22

sbsigntools - 0.9.5
Ebuild name:

app-crypt/sbsigntools-0.9.5

Description

Utilities for signing and verifying files for UEFI Secure Boot

Added to portage

2025-12-22

scdrand - 0.3.5
Ebuild name:

app-crypt/scdrand-0.3.5

Description

Feed kernel entropy pool from smartcard's TRNG

Added to portage

2025-12-22

sdmon - 0.9.0_p20250201
Ebuild name:

sys-block/sdmon-0.9.0_p20250201

Description

Get SD-card health data

Added to portage

2025-12-22

simdutf - 7.7.1
Ebuild name:

dev-cpp/simdutf-7.7.1

Description

Unicode validation and transcoding at billions of characters per second

Added to portage

2025-12-22

stalwart-cli - 0.15.1
Ebuild name:

net-mail/stalwart-cli-0.15.1

Description

Stalwart Mail Server command line utility

Added to portage

2025-12-22

stalwart-mail - 0.15.1
Ebuild name:

net-mail/stalwart-mail-0.15.1

Description

Stalwart Mail Server

Added to portage

2025-12-22

steve - 1.3.0
Ebuild name:

dev-build/steve-1.3.0

Description

A load-balancing jobserver for Gentoo

Added to portage

2025-12-22

system-config-printer - 1.5.18-r3
Ebuild name:

app-admin/system-config-printer-1.5.18-r3

Description

Graphical user interface for CUPS administration

Added to portage

2025-12-22

tifffile - 2025.12.20
Ebuild name:

dev-python/tifffile-2025.12.20

Description

Read and write TIFF files

Added to portage

2025-12-22

tinysparql - 3.10.1
Ebuild name:

app-misc/tinysparql-3.10.1

Description

Low-footprint RDF triple store with SPARQL 1.1 interface

Added to portage

2025-12-22

types-setuptools - 80.9.0.20251221
Ebuild name:

dev-python/types-setuptools-80.9.0.20251221

Description

Typing stubs for setuptools

Added to portage

2025-12-22

uritools - 6.0.1
Ebuild name:

dev-python/uritools-6.0.1

Description

RFC 3986-compliant URI parsing, classification and composition

Added to portage

2025-12-22

uvicorn - 0.40.0
Ebuild name:

dev-python/uvicorn-0.40.0

Description

Lightning-fast ASGI server implementation

Added to portage

2025-12-22

vss-text - 25.0.0
Ebuild name:

dev-ada/vss-text-25.0.0

Description

A high level string and text processing library

Added to portage

2025-12-22

vte - 0.80.4-r1
Ebuild name:

gui-libs/vte-0.80.4-r1

Description

Library providing a virtual terminal emulator widget

Added to portage

2025-12-22

vte - 0.80.4-r1
Ebuild name:

x11-libs/vte-0.80.4-r1

Description

Library providing a virtual terminal emulator widget

Added to portage

2025-12-22

vte - 0.82.2
Ebuild name:

gui-libs/vte-0.82.2

Description

Library providing a virtual terminal emulator widget

Added to portage

2025-12-22

vte - 0.82.2
Ebuild name:

x11-libs/vte-0.82.2

Description

Library providing a virtual terminal emulator widget

Added to portage

2025-12-22

vte-common - 0.82.2
Ebuild name:

gui-libs/vte-common-0.82.2

Description

Library providing a virtual terminal emulator widget

Added to portage

2025-12-22

webkit-gtk - 2.50.4-r410
Ebuild name:

net-libs/webkit-gtk-2.50.4-r410

Description

Open source web browser engine

Added to portage

2025-12-22

webkit-gtk - 2.50.4-r600
Ebuild name:

net-libs/webkit-gtk-2.50.4-r600

Description

Open source web browser engine

Added to portage

2025-12-22

wings - 2.2.6.1-r1
Ebuild name:

media-gfx/wings-2.2.6.1-r1

Description

Wings 3D is an advanced subdivision modeler

Added to portage

2025-12-22

wings - 2.3-r1
Ebuild name:

media-gfx/wings-2.3-r1

Description

Wings 3D is an advanced subdivision modeler

Added to portage

2025-12-22

wings - 2.4-r1
Ebuild name:

media-gfx/wings-2.4-r1

Description

Wings 3D is an advanced subdivision modeler

Added to portage

2025-12-22

wings - 2.4.1
Ebuild name:

media-gfx/wings-2.4.1

Description

Wings 3D is an advanced subdivision modeler

Added to portage

2025-12-22

xen - 4.20.2
Ebuild name:

app-emulation/xen-4.20.2

Description

The Xen virtual machine monitor

Added to portage

2025-12-22

xen-tools - 4.20.2
Ebuild name:

app-emulation/xen-tools-4.20.2

Description

Xen tools including QEMU and xl

Added to portage

2025-12-22

xfce4-terminal - 1.1.4-r1
Ebuild name:

x11-terms/xfce4-terminal-1.1.4-r1

Description

A terminal emulator for the Xfce desktop environment

Added to portage

2025-12-22

xfce4-terminal - 1.1.5-r1
Ebuild name:

x11-terms/xfce4-terminal-1.1.5-r1

Description

A terminal emulator for the Xfce desktop environment

Added to portage

2025-12-22

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