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:

82340

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-08
basket - 2.49b_p20251207
Ebuild name:

kde-misc/basket-2.49b_p20251207

Description

Multiple information organizer - a DropDrawers clone

Added to portage

2025-12-08

blas-lapack-aux-wrapper - 4
Ebuild name:

sci-libs/blas-lapack-aux-wrapper-4

Description

BLAS/LAPACK wrappers for FlexiBLAS

Added to portage

2025-12-08

fsautocomplete - 0.82.0
Ebuild name:

dev-dotnet/fsautocomplete-0.82.0

Description

F language server using the Language Server Protocol

Added to portage

2025-12-08

gcc - 16.0.0_p20251207
Ebuild name:

sys-devel/gcc-16.0.0_p20251207

Description

The GNU Compiler Collection

Added to portage

2025-12-08

guildmaster - 0_pre20250712
Ebuild name:

dev-build/guildmaster-0_pre20250712

Description

FIFO-like jobserver node via CUSE

Added to portage

2025-12-08

incus - 6.19.1
Ebuild name:

app-containers/incus-6.19.1

Description

Modern, secure and powerful system container and virtual machine manage

Added to portage

2025-12-08

mistletoe - 1.5.1
Ebuild name:

dev-python/mistletoe-1.5.1

Description

A fast, extensible Markdown parser in pure Python

Added to portage

2025-12-08

pymdown-extensions - 10.18
Ebuild name:

dev-python/pymdown-extensions-10.18

Description

Extensions for Python Markdown

Added to portage

2025-12-08

pypdf - 6.4.1
Ebuild name:

dev-python/pypdf-6.4.1

Description

Python library to work with PDF files

Added to portage

2025-12-08

pyzstd - 0.19.0
Ebuild name:

dev-python/pyzstd-0.19.0

Description

Support for Zstandard (zstd) compression

Added to portage

2025-12-08

racket-mode - 1_p20251107
Ebuild name:

app-emacs/racket-mode-1_p20251107

Description

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

Added to portage

2025-12-08

rsyslog - 8.2512.0
Ebuild name:

app-admin/rsyslog-8.2512.0

Description

An enhanced multi-threaded syslogd with database support and more

Added to portage

2025-12-08

spawn - 25.0.0-r4
Ebuild name:

dev-ada/spawn-25.0.0-r4

Description

Simple API to spawn processes

Added to portage

2025-12-08

xterm - 404
Ebuild name:

x11-terms/xterm-404

Description

Terminal Emulator for X Windows

Added to portage

2025-12-08

xvfbwrapper - 0.2.16
Ebuild name:

dev-python/xvfbwrapper-0.2.16

Description

Python wrapper for running a display inside X virtual framebuffer

Added to portage

2025-12-08

yt-dlp - 2025.12.08
Ebuild name:

net-misc/yt-dlp-2025.12.08

Description

youtube-dl fork with additional features and fixes

Added to portage

2025-12-08

yt-dlp-ejs - 0.3.2
Ebuild name:

dev-python/yt-dlp-ejs-0.3.2

Description

External JavaScript for yt-dlp supporting many runtimes

Added to portage

2025-12-08

2025-12-07
aruba - 2.3.3
Ebuild name:

dev-util/aruba-2.3.3

Description

Cucumber steps for driving out command line applications

Added to portage

2025-12-07

backports-zstd - 1.2.0
Ebuild name:

dev-python/backports-zstd-1.2.0

Description

Backport of PEP-784 adding Zstandard to the standard library

Added to portage

2025-12-07

certbot - 5.2.1
Ebuild name:

app-crypt/certbot-5.2.1

Description

Let's Encrypt client to automate deployment of X.509 certificates

Added to portage

2025-12-07

cvmfs - 2.13.3
Ebuild name:

net-fs/cvmfs-2.13.3

Description

HTTP read-only file system for distributing software

Added to portage

2025-12-07

dist-kernel - 5.10.247
Ebuild name:

virtual/dist-kernel-5.10.247

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 5.15.197
Ebuild name:

virtual/dist-kernel-5.15.197

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.1.159
Ebuild name:

virtual/dist-kernel-6.1.159

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.12.61
Ebuild name:

virtual/dist-kernel-6.12.61

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.17.11
Ebuild name:

virtual/dist-kernel-6.17.11

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

dist-kernel - 6.6.119
Ebuild name:

virtual/dist-kernel-6.6.119

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-12-07

django-timezone-field - 7.2.1
Ebuild name:

dev-python/django-timezone-field-7.2.1

Description

A Django app providing database and form fields for timezone

Added to portage

2025-12-07

evolution - 3.58.2-r1
Ebuild name:

mail-client/evolution-3.58.2-r1

Description

Integrated mail, addressbook and calendaring functionality

Added to portage

2025-12-07

findimports - 2.8.0
Ebuild name:

dev-python/findimports-2.8.0

Description

Python module import analysis tool

Added to portage

2025-12-07

gcc - 15.2.1_p20251206
Ebuild name:

sys-devel/gcc-15.2.1_p20251206

Description

The GNU Compiler Collection

Added to portage

2025-12-07

geant - 4.11.4.0
Ebuild name:

sci-physics/geant-4.11.4.0

Description

Toolkit for simulation of passage of particles through matter

Added to portage

2025-12-07

geant-data - 4.11.4
Ebuild name:

sci-physics/geant-data-4.11.4

Description

Data files for Geant4 physical processes

Added to portage

2025-12-07

gentoo-kernel - 5.10.247
Ebuild name:

sys-kernel/gentoo-kernel-5.10.247

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 5.15.197
Ebuild name:

sys-kernel/gentoo-kernel-5.15.197

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.1.159
Ebuild name:

sys-kernel/gentoo-kernel-6.1.159

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.12.61
Ebuild name:

sys-kernel/gentoo-kernel-6.12.61

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.17.11
Ebuild name:

sys-kernel/gentoo-kernel-6.17.11

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel - 6.6.119
Ebuild name:

sys-kernel/gentoo-kernel-6.6.119

Description

Linux kernel built with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 5.10.247
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.247

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 5.15.197
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.197

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.1.159
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.159

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.12.61
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.61

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.17.11
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.17.11

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-kernel-bin - 6.6.119
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.119

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-12-07

gentoo-sources - 5.10.247
Ebuild name:

sys-kernel/gentoo-sources-5.10.247

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 5.15.197
Ebuild name:

sys-kernel/gentoo-sources-5.15.197

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.1.159
Ebuild name:

sys-kernel/gentoo-sources-6.1.159

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.12.61
Ebuild name:

sys-kernel/gentoo-sources-6.12.61

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.17.11
Ebuild name:

sys-kernel/gentoo-sources-6.17.11

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

gentoo-sources - 6.6.119
Ebuild name:

sys-kernel/gentoo-sources-6.6.119

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-12-07

ibus-typing-booster - 2.28.6
Ebuild name:

app-i18n/ibus-typing-booster-2.28.6

Description

Completion input method for IBus

Added to portage

2025-12-07

kwallet-pam - 6.4.5-r1
Ebuild name:

kde-plasma/kwallet-pam-6.4.5-r1

Description

PAM module to not enter KWallet password again after login

Added to portage

2025-12-07

kwallet-pam - 6.5.3-r1
Ebuild name:

kde-plasma/kwallet-pam-6.5.3-r1

Description

PAM module to not enter KWallet password again after login

Added to portage

2025-12-07

libfilezilla - 0.51.1-r1
Ebuild name:

dev-libs/libfilezilla-0.51.1-r1

Description

C++ library offering some basic functionality for platform-independ

Added to portage

2025-12-07

libfilezilla - 0.52.0-r1
Ebuild name:

dev-libs/libfilezilla-0.52.0-r1

Description

C++ library offering some basic functionality for platform-independ

Added to portage

2025-12-07

librt - 0.7.3
Ebuild name:

dev-python/librt-0.7.3

Description

Mypyc runtime library

Added to portage

2025-12-07

libtmux - 0.51.0
Ebuild name:

dev-python/libtmux-0.51.0

Description

Typed library that provides an ORM wrapper for tmux, a terminal multiplex

Added to portage

2025-12-07

libutf8proc - 2.11.2
Ebuild name:

dev-libs/libutf8proc-2.11.2

Description

A clean C Library for processing UTF-8 Unicode data

Added to portage

2025-12-07

meson - 1.9.2
Ebuild name:

dev-build/meson-1.9.2

Description

Open source build system

Added to portage

2025-12-07

nss - 3.119
Ebuild name:

dev-libs/nss-3.119

Description

Mozilla's Network Security Services library that implements PKI support

Added to portage

2025-12-07

pacparser - 1.4.6
Ebuild name:

net-libs/pacparser-1.4.6

Description

Library to parse proxy auto-config files

Added to portage

2025-12-07

perf - 6.18
Ebuild name:

dev-util/perf-6.18

Description

Userland tools for Linux Performance Counters

Added to portage

2025-12-07

postfix - 3.10.7
Ebuild name:

mail-mta/postfix-3.10.7

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2025-12-07

pudb - 2025.1.5
Ebuild name:

dev-python/pudb-2025.1.5

Description

A full-screen, console-based Python debugger

Added to portage

2025-12-07

pytest - 9.0.2
Ebuild name:

dev-python/pytest-9.0.2

Description

Simple powerful testing with Python

Added to portage

2025-12-07

root - 6.38.00
Ebuild name:

sci-physics/root-6.38.00

Description

C++ data analysis framework and interpreter from CERN

Added to portage

2025-12-07

rqrcode - 3.1.1
Ebuild name:

dev-ruby/rqrcode-3.1.1

Description

Library for encoding QR Codes

Added to portage

2025-12-07

rqrcode_core - 2.0.1
Ebuild name:

dev-ruby/rqrcode_core-2.0.1

Description

Library for encoding QR Codes

Added to portage

2025-12-07

selenium - 4.39.0
Ebuild name:

dev-python/selenium-4.39.0

Description

Python language binding for Selenium Remote Control

Added to portage

2025-12-07

selenium-manager - 4.39.0
Ebuild name:

dev-util/selenium-manager-4.39.0

Description

CLI tool that manages the browser/driver infrastructure required b

Added to portage

2025-12-07

sequel - 5.99.0
Ebuild name:

dev-ruby/sequel-5.99.0

Description

A lightweight database toolkit for Ruby

Added to portage

2025-12-07

sys-filesystem - 1.5.5
Ebuild name:

dev-ruby/sys-filesystem-1.5.5

Description

Cross-platform interface for filesystem information

Added to portage

2025-12-07

trimesh - 4.10.1
Ebuild name:

dev-python/trimesh-4.10.1

Description

Python library for loading and using triangular meshes

Added to portage

2025-12-07

uftrace - 0.18.1
Ebuild name:

dev-util/uftrace-0.18.1

Description

Function (graph) tracer for user-space

Added to portage

2025-12-07

vanilla-kernel - 5.10.247
Ebuild name:

sys-kernel/vanilla-kernel-5.10.247

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 5.15.197
Ebuild name:

sys-kernel/vanilla-kernel-5.15.197

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.1.159
Ebuild name:

sys-kernel/vanilla-kernel-6.1.159

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.12.61
Ebuild name:

sys-kernel/vanilla-kernel-6.12.61

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.17.11
Ebuild name:

sys-kernel/vanilla-kernel-6.17.11

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-kernel - 6.6.119
Ebuild name:

sys-kernel/vanilla-kernel-6.6.119

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-12-07

vanilla-sources - 5.10.247
Ebuild name:

sys-kernel/vanilla-sources-5.10.247

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 5.15.197
Ebuild name:

sys-kernel/vanilla-sources-5.15.197

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 5.4.302
Ebuild name:

sys-kernel/vanilla-sources-5.4.302

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.1.159
Ebuild name:

sys-kernel/vanilla-sources-6.1.159

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.12.61
Ebuild name:

sys-kernel/vanilla-sources-6.12.61

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.17.11
Ebuild name:

sys-kernel/vanilla-sources-6.17.11

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

vanilla-sources - 6.6.119
Ebuild name:

sys-kernel/vanilla-sources-6.6.119

Description

Full sources for the Linux kernel

Added to portage

2025-12-07

webrick - 1.9.2
Ebuild name:

dev-ruby/webrick-1.9.2

Description

An HTTP server toolkit

Added to portage

2025-12-07

yard - 0.9.38
Ebuild name:

dev-ruby/yard-0.9.38

Description

Documentation generation tool for the Ruby programming language

Added to portage

2025-12-07

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