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:

78434

userrating:

average rating: 1.1 (26 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.4 (8 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-07-19
atuin - 18.7.1
Ebuild name:

app-shells/atuin-18.7.1

Description

Shell history manager supporting encrypted synchronisation

Added to portage

2025-07-19

bash - 5.4_alpha_pre20250718
Ebuild name:

app-shells/bash-5.4_alpha_pre20250718

Description

The standard GNU Bourne again shell

Added to portage

2025-07-19

camlp5 - 8.03.06
Ebuild name:

dev-ml/camlp5-8.03.06

Description

A preprocessor-pretty-printer of ocaml

Added to portage

2025-07-19

ebuild-mode - 1.79
Ebuild name:

app-xemacs/ebuild-mode-1.79

Description

Emacs modes for editing ebuilds and other Gentoo specific files

Added to portage

2025-07-19

pcre2-ocaml - 8.0.3
Ebuild name:

dev-ml/pcre2-ocaml-8.0.3

Description

OCaml bindings to PCRE (Perl Compatibility Regular Expressions)

Added to portage

2025-07-19

profanity - 0.15.0
Ebuild name:

net-im/profanity-0.15.0

Description

A console based XMPP client inspired by Irssi

Added to portage

2025-07-19

vivaldi - 7.5.3735.54
Ebuild name:

www-client/vivaldi-7.5.3735.54

Description

A browser for our friends

Added to portage

2025-07-19

2025-07-18
apache-arrow - 21.0.0
Ebuild name:

dev-libs/apache-arrow-21.0.0

Description

A cross-language development platform for in-memory data

Added to portage

2025-07-18

awscli - 1.41.8
Ebuild name:

app-admin/awscli-1.41.8

Description

Universal Command Line Environment for AWS

Added to portage

2025-07-18

boto3 - 1.39.8
Ebuild name:

dev-python/boto3-1.39.8

Description

The AWS SDK for Python

Added to portage

2025-07-18

botocore - 1.39.8
Ebuild name:

dev-python/botocore-1.39.8

Description

Low-level, data-driven core of boto 3

Added to portage

2025-07-18

c-blosc2 - 2.19.1
Ebuild name:

dev-libs/c-blosc2-2.19.1

Description

Blocking, shuffling and lossless compression library

Added to portage

2025-07-18

collectd - 5.12.0-r12
Ebuild name:

app-metrics/collectd-5.12.0-r12

Description

Collects system statistics and provides mechanisms to store the val

Added to portage

2025-07-18

cpuinfo - 2025.03.21
Ebuild name:

dev-libs/cpuinfo-2025.03.21

Description

CPU INFOrmation library

Added to portage

2025-07-18

dist-kernel - 5.10.240
Ebuild name:

virtual/dist-kernel-5.10.240

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

dist-kernel - 5.15.189
Ebuild name:

virtual/dist-kernel-5.15.189

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

dist-kernel - 6.1.146
Ebuild name:

virtual/dist-kernel-6.1.146

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

dist-kernel - 6.12.39
Ebuild name:

virtual/dist-kernel-6.12.39

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

dist-kernel - 6.15.7
Ebuild name:

virtual/dist-kernel-6.15.7

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

dist-kernel - 6.6.99
Ebuild name:

virtual/dist-kernel-6.6.99

Description

Virtual to depend on any Distribution Kernel

Added to portage

2025-07-18

distlib - 0.4.0
Ebuild name:

dev-python/distlib-0.4.0

Description

Low-level components of distutils2/packaging

Added to portage

2025-07-18

elt-patches - 20250718
Ebuild name:

app-portage/elt-patches-20250718

Description

Collection of patches for libtool.eclass

Added to portage

2025-07-18

fastfetch - 2.48.1
Ebuild name:

app-misc/fastfetch-2.48.1

Description

Fast neofetch-like system information tool

Added to portage

2025-07-18

freeradius - 3.2.6-r1
Ebuild name:

net-dialup/freeradius-3.2.6-r1

Description

Highly configurable free RADIUS server

Added to portage

2025-07-18

gentoo-kernel - 5.10.240
Ebuild name:

sys-kernel/gentoo-kernel-5.10.240

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel - 5.15.189
Ebuild name:

sys-kernel/gentoo-kernel-5.15.189

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel - 6.1.146
Ebuild name:

sys-kernel/gentoo-kernel-6.1.146

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel - 6.12.39
Ebuild name:

sys-kernel/gentoo-kernel-6.12.39

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel - 6.15.7
Ebuild name:

sys-kernel/gentoo-kernel-6.15.7

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel - 6.6.99
Ebuild name:

sys-kernel/gentoo-kernel-6.6.99

Description

Linux kernel built with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 5.10.240
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.10.240

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 5.15.189
Ebuild name:

sys-kernel/gentoo-kernel-bin-5.15.189

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 6.1.146
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.1.146

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 6.12.39
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.12.39

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 6.15.7
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.15.7

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-kernel-bin - 6.6.99
Ebuild name:

sys-kernel/gentoo-kernel-bin-6.6.99

Description

Pre-built Linux kernel with Gentoo patches

Added to portage

2025-07-18

gentoo-sources - 5.10.240
Ebuild name:

sys-kernel/gentoo-sources-5.10.240

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

gentoo-sources - 5.15.189
Ebuild name:

sys-kernel/gentoo-sources-5.15.189

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

gentoo-sources - 6.1.146
Ebuild name:

sys-kernel/gentoo-sources-6.1.146

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

gentoo-sources - 6.12.39
Ebuild name:

sys-kernel/gentoo-sources-6.12.39

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

gentoo-sources - 6.15.7
Ebuild name:

sys-kernel/gentoo-sources-6.15.7

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

gentoo-sources - 6.6.99
Ebuild name:

sys-kernel/gentoo-sources-6.6.99

Description

Full sources including the Gentoo patchset for the . kernel tree

Added to portage

2025-07-18

grafana-bin - 11.4.6
Ebuild name:

www-apps/grafana-bin-11.4.6

Description

Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & Open

Added to portage

2025-07-18

grafana-bin - 11.5.6
Ebuild name:

www-apps/grafana-bin-11.5.6

Description

Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & Open

Added to portage

2025-07-18

grafana-bin - 12.0.2
Ebuild name:

www-apps/grafana-bin-12.0.2

Description

Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & Open

Added to portage

2025-07-18

hydra - 9.5-r11
Ebuild name:

net-analyzer/hydra-9.5-r11

Description

Parallelized network login hacker

Added to portage

2025-07-18

iwdevtools - 0.13.0
Ebuild name:

app-portage/iwdevtools-0.13.0

Description

Small tools to aid with Gentoo development, primarily intended for QA

Added to portage

2025-07-18

json - 2.13.0
Ebuild name:

dev-ruby/json-2.13.0

Description

A JSON implementation as a Ruby extension

Added to portage

2025-07-18

jsonschema - 4.24.1
Ebuild name:

dev-python/jsonschema-4.24.1

Description

An implementation of JSON-Schema validation for Python

Added to portage

2025-07-18

ktextaddons - 1.6.0
Ebuild name:

dev-libs/ktextaddons-1.6.0

Description

Various text handling addons

Added to portage

2025-07-18

libqalculate - 5.6.0
Ebuild name:

sci-libs/libqalculate-5.6.0

Description

A modern multi-purpose calculator library

Added to portage

2025-07-18

mkl - 2025.2.0.628
Ebuild name:

sci-libs/mkl-2025.2.0.628

Description

Intel Math Kernel Library

Added to portage

2025-07-18

mongodb-compass-bin - 1.46.6
Ebuild name:

dev-db/mongodb-compass-bin-1.46.6

Description

GUI for MongoDB

Added to portage

2025-07-18

narwhals - 1.47.1
Ebuild name:

dev-python/narwhals-1.47.1

Description

Extremely lightweight compatibility layer between dataframe libraries

Added to portage

2025-07-18

netdata-go-plugin - 1.47.5-r1
Ebuild name:

net-analyzer/netdata-go-plugin-1.47.5-r1

Description

Netdata plugin for collectors written in Go

Added to portage

2025-07-18

nh3 - 0.3.0
Ebuild name:

dev-python/nh3-0.3.0

Description

Ammonia HTML sanitizer Python binding

Added to portage

2025-07-18

nspr - 4.37
Ebuild name:

dev-libs/nspr-4.37

Description

Netscape Portable Runtime

Added to portage

2025-07-18

nvidia-cuda-toolkit - 12.9.1
Ebuild name:

dev-util/nvidia-cuda-toolkit-12.9.1

Description

NVIDIA CUDA Toolkit (compiler and friends)

Added to portage

2025-07-18

opendkim - 2.10.3-r34
Ebuild name:

mail-filter/opendkim-2.10.3-r34

Description

A milter providing DKIM signing and verification

Added to portage

2025-07-18

pgmemcache - 2.3.0-r1
Ebuild name:

dev-db/pgmemcache-2.3.0-r1

Description

A PostgreSQL API based on libmemcached to interface with memcached

Added to portage

2025-07-18

pgpool2 - 4.4.7-r1
Ebuild name:

dev-db/pgpool2-4.4.7-r1

Description

Connection pool server for PostgreSQL

Added to portage

2025-07-18

pikepdf - 9.10.2
Ebuild name:

dev-python/pikepdf-9.10.2

Description

Python library to work with pdf files based on qpdf

Added to portage

2025-07-18

postfix - 3.11_pre20250717
Ebuild name:

mail-mta/postfix-3.11_pre20250717

Description

A fast and secure drop-in replacement for sendmail

Added to portage

2025-07-18

postgresql - 18_beta2
Ebuild name:

dev-db/postgresql-18_beta2

Description

PostgreSQL RDBMS

Added to portage

2025-07-18

proftpd - 1.3.9-r2
Ebuild name:

net-ftp/proftpd-1.3.9-r2

Description

An advanced and very configurable FTP server

Added to portage

2025-07-18

pyarrow - 21.0.0
Ebuild name:

dev-python/pyarrow-21.0.0

Description

Python library for Apache Arrow

Added to portage

2025-07-18

pylibmc - 1.6.3-r2
Ebuild name:

dev-python/pylibmc-1.6.3-r2

Description

Libmemcached wrapper written as a Python extension

Added to portage

2025-07-18

pytest-lazy-fixtures - 1.3.2
Ebuild name:

dev-python/pytest-lazy-fixtures-1.3.2

Description

Allows you to use fixtures in @pytest.mark.parametrize

Added to portage

2025-07-18

pytest-services - 2.2.2
Ebuild name:

dev-python/pytest-services-2.2.2

Description

Collection of fixtures and utility functions to run service proces

Added to portage

2025-07-18

qalculate-gtk - 5.6.0
Ebuild name:

sci-calculators/qalculate-gtk-5.6.0

Description

Modern multi-purpose calculator

Added to portage

2025-07-18

qalculate-qt - 5.6.0
Ebuild name:

sci-calculators/qalculate-qt-5.6.0

Description

Qt-based UI for libqalculate

Added to portage

2025-07-18

recog - 3.1.18
Ebuild name:

dev-ruby/recog-3.1.18

Description

Pattern recognition for hosts, services, and content

Added to portage

2025-07-18

rencode - 1.0.8-r1
Ebuild name:

dev-python/rencode-1.0.8-r1

Description

Serialization similar to bencode from the BitTorrent project

Added to portage

2025-07-18

sigil - 2.6.0
Ebuild name:

app-text/sigil-2.6.0

Description

Multi-platform WYSIWYG ebook editor for ePub format

Added to portage

2025-07-18

simplecov-html - 0.13.2
Ebuild name:

dev-ruby/simplecov-html-0.13.2

Description

Generates a HTML report of your SimpleCov ruby code coverage results

Added to portage

2025-07-18

sogo - 5.2.0-r1
Ebuild name:

gnustep-apps/sogo-5.2.0-r1

Description

Groupware server built around OpenGroupware.org and the SOPE application

Added to portage

2025-07-18

supercollider - 3.14.0_rc2
Ebuild name:

media-sound/supercollider-3.14.0_rc2

Description

Environment and programming language for real time audio synth

Added to portage

2025-07-18

thunar - 4.20.4
Ebuild name:

xfce-base/thunar-4.20.4

Description

File manager for the Xfce desktop environment

Added to portage

2025-07-18

uv - 0.7.22
Ebuild name:

dev-python/uv-0.7.22

Description

A Python package installer and resolver, written in Rust

Added to portage

2025-07-18

uv-build - 0.7.22
Ebuild name:

dev-python/uv-build-0.7.22

Description

PEP517 uv build backend

Added to portage

2025-07-18

vanilla-kernel - 5.10.240
Ebuild name:

sys-kernel/vanilla-kernel-5.10.240

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-kernel - 5.15.189
Ebuild name:

sys-kernel/vanilla-kernel-5.15.189

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-kernel - 6.1.146
Ebuild name:

sys-kernel/vanilla-kernel-6.1.146

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-kernel - 6.12.39
Ebuild name:

sys-kernel/vanilla-kernel-6.12.39

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-kernel - 6.15.7
Ebuild name:

sys-kernel/vanilla-kernel-6.15.7

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-kernel - 6.6.99
Ebuild name:

sys-kernel/vanilla-kernel-6.6.99

Description

Linux kernel built from vanilla upstream sources

Added to portage

2025-07-18

vanilla-sources - 5.10.240
Ebuild name:

sys-kernel/vanilla-sources-5.10.240

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 5.15.189
Ebuild name:

sys-kernel/vanilla-sources-5.15.189

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 5.4.296
Ebuild name:

sys-kernel/vanilla-sources-5.4.296

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 6.1.146
Ebuild name:

sys-kernel/vanilla-sources-6.1.146

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 6.12.39
Ebuild name:

sys-kernel/vanilla-sources-6.12.39

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 6.15.7
Ebuild name:

sys-kernel/vanilla-sources-6.15.7

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

vanilla-sources - 6.6.99
Ebuild name:

sys-kernel/vanilla-sources-6.6.99

Description

Full sources for the Linux kernel

Added to portage

2025-07-18

yaz - 5.35.1-r1
Ebuild name:

dev-libs/yaz-5.35.1-r1

Description

C/C++ toolkit for Z39.50v3 clients and servers

Added to portage

2025-07-18

yubikey-manager - 5.7.0-r2
Ebuild name:

app-crypt/yubikey-manager-5.7.0-r2

Description

Python library and command line tool for configuring a YubiKey

Added to portage

2025-07-18

yubikey-manager - 5.7.2
Ebuild name:

app-crypt/yubikey-manager-5.7.2

Description

Python library and command line tool for configuring a YubiKey

Added to portage

2025-07-18

yubikey-manager-qt - 1.2.5
Ebuild name:

app-crypt/yubikey-manager-qt-1.2.5

Description

Cross-platform application for configuring any YubiKey over all

Added to portage

2025-07-18

yubioath-flutter-bin - 6.1.0-r3
Ebuild name:

app-crypt/yubioath-flutter-bin-6.1.0-r3

Description

Yubico Authenticator for TOTP

Added to portage

2025-07-18

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: 66.3 ms