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:

82101

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.


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-11-17
asttokens - 3.0.1
Ebuild name:

dev-python/asttokens-3.0.1

Description

Annotate Python AST trees with source text and token information

Added to portage

2025-11-17

backrefs - 6.1
Ebuild name:

dev-python/backrefs-6.1

Description

Wrapper around re or regex that adds additional back references

Added to portage

2025-11-17

boogie - 3.5.5-r1
Ebuild name:

dev-lang/boogie-3.5.5-r1

Description

SMT-based program verifier

Added to portage

2025-11-17

chromium - 142.0.7444.162
Ebuild name:

www-client/chromium-142.0.7444.162

Description

Open-source version of Google Chrome web browser

Added to portage

2025-11-17

click - 8.3.1-r1
Ebuild name:

dev-python/click-8.3.1-r1

Description

A Python package for creating beautiful command line interfaces

Added to portage

2025-11-17

csharp-gentoodotnetinfo - 2.0.0-r1
Ebuild name:

dev-dotnet/csharp-gentoodotnetinfo-2.0.0-r1

Description

.NET information tool for Gentoo

Added to portage

2025-11-17

dbus-fast - 2.46.4
Ebuild name:

dev-python/dbus-fast-2.46.4

Description

A faster version of dbus-next

Added to portage

2025-11-17

dbus-fast - 3.1.2
Ebuild name:

dev-python/dbus-fast-3.1.2

Description

A faster version of dbus-next

Added to portage

2025-11-17

direwolf - 1.8.1
Ebuild name:

media-radio/direwolf-1.8.1

Description

Decoded Information from Radio Emissions for Windows Or Linux Fans

Added to portage

2025-11-17

dirty-equals - 0.11.0
Ebuild name:

dev-python/dirty-equals-0.11.0

Description

Doing dirty (but extremely useful) things with equals

Added to portage

2025-11-17

dotnet-outdated - 4.6.4-r2
Ebuild name:

dev-dotnet/dotnet-outdated-4.6.4-r2

Description

Display and update outdated NuGet packages in a project

Added to portage

2025-11-17

easycrypt - 2025.11
Ebuild name:

sci-mathematics/easycrypt-2025.11

Description

Computer-Aided Cryptographic Proofs

Added to portage

2025-11-17

eisl - 5.58
Ebuild name:

dev-lang/eisl-5.58

Description

Interpreter and compiler compatible with the ISLisp standard

Added to portage

2025-11-17

fastfetch - 2.55.1
Ebuild name:

app-misc/fastfetch-2.55.1

Description

Fast neofetch-like system information tool

Added to portage

2025-11-17

gcc - 16.0.0_p20251116
Ebuild name:

sys-devel/gcc-16.0.0_p20251116

Description

The GNU Compiler Collection

Added to portage

2025-11-17

gettext_i18n_rails - 2.1.0
Ebuild name:

dev-ruby/gettext_i18n_rails-2.1.0

Description

FastGettext / Rails integration

Added to portage

2025-11-17

git - 2.51.2-r2
Ebuild name:

dev-vcs/git-2.51.2-r2

Description

Stupid content tracker distributed VCS designed for speed and efficiency

Added to portage

2025-11-17

git-filter-repo - 2.47.0-r1
Ebuild name:

dev-vcs/git-filter-repo-2.47.0-r1

Description

Quickly rewrite git repository history (filter-branch replacement

Added to portage

2025-11-17

git-sources - 6.18_rc6
Ebuild name:

sys-kernel/git-sources-6.18_rc6

Description

The very latest -git version of the Linux kernel

Added to portage

2025-11-17

gitea - 1.25.1
Ebuild name:

www-apps/gitea-1.25.1

Description

A painless self-hosted Git service

Added to portage

2025-11-17

haproxy - 3.2.8-r1
Ebuild name:

net-proxy/haproxy-3.2.8-r1

Description

A TCP/HTTP reverse proxy for high availability environments

Added to portage

2025-11-17

hypothesis - 6.148.1
Ebuild name:

dev-python/hypothesis-6.148.1

Description

A library for property based testing

Added to portage

2025-11-17

jellyfin-bin - 10.11.3
Ebuild name:

www-apps/jellyfin-bin-10.11.3

Description

Jellyfin puts you in control of managing and streaming your media

Added to portage

2025-11-17

keyring - 25.7.0
Ebuild name:

dev-python/keyring-25.7.0

Description

Provides access to the system keyring service

Added to portage

2025-11-17

mattermost-desktop-bin - 6.0.1_rc2
Ebuild name:

net-im/mattermost-desktop-bin-6.0.1_rc2

Description

Mattermost Desktop application

Added to portage

2025-11-17

nprolog - 4.76
Ebuild name:

dev-lang/nprolog-4.76

Description

Interpreter and compiler to be compatible with Arity/Prolog32

Added to portage

2025-11-17

omemo-dr - 1.1.0
Ebuild name:

dev-python/omemo-dr-1.1.0

Description

OMEMO Crypto Library

Added to portage

2025-11-17

onedrive - 2.5.9
Ebuild name:

net-misc/onedrive-2.5.9

Description

Free Client for OneDrive on Linux

Added to portage

2025-11-17

poke - 3.0
Ebuild name:

app-emacs/poke-3.0

Description

Emacs meets GNU poke

Added to portage

2025-11-17

poke - 3.2
Ebuild name:

app-emacs/poke-3.2

Description

Emacs meets GNU poke

Added to portage

2025-11-17

poke-mode - 3.0
Ebuild name:

app-emacs/poke-mode-3.0

Description

Major mode for editing Poke programs

Added to portage

2025-11-17

polymode - 0.2.2_p20220322
Ebuild name:

app-emacs/polymode-0.2.2_p20220322

Description

Framework for Multiple Major Modes in Emacs

Added to portage

2025-11-17

popup - 0.5.9
Ebuild name:

app-emacs/popup-0.5.9

Description

Visual popup interface library for Emacs

Added to portage

2025-11-17

portage - 3.0.72
Ebuild name:

sys-apps/portage-3.0.72

Description

The package management and distribution system for Gentoo

Added to portage

2025-11-17

pypdf - 6.3.0
Ebuild name:

dev-python/pypdf-6.3.0

Description

Python library to work with PDF files

Added to portage

2025-11-17

pytest-localftpserver - 1.5.0
Ebuild name:

dev-python/pytest-localftpserver-1.5.0

Description

A PyTest plugin which provides an FTP fixture for your tests

Added to portage

2025-11-17

pythran - 0.18.1
Ebuild name:

dev-python/pythran-0.18.1

Description

Ahead of Time compiler for numeric kernels

Added to portage

2025-11-17

rpds-py - 0.29.0
Ebuild name:

dev-python/rpds-py-0.29.0

Description

Python bindings to Rust's persistent data structures (rpds)

Added to portage

2025-11-17

ruamel-yaml-clib - 0.2.15
Ebuild name:

dev-python/ruamel-yaml-clib-0.2.15

Description

C-based reader/scanner and emitter for dev-python/ruamel-yaml

Added to portage

2025-11-17

tempel - 1.8
Ebuild name:

app-emacs/tempel-1.8

Description

Templates with in-buffer field editing for GNU Emacs

Added to portage

2025-11-17

vertico - 2.6
Ebuild name:

app-emacs/vertico-2.6

Description

Vertical interactive completion

Added to portage

2025-11-17

xelb - 0.22
Ebuild name:

app-emacs/xelb-0.22

Description

X protocol Emacs Lisp Binding

Added to portage

2025-11-17

xfce4-panel - 4.21.1
Ebuild name:

xfce-base/xfce4-panel-4.21.1

Description

Panel for the Xfce desktop environment

Added to portage

2025-11-17

2025-11-16
86Box - 5.2-r1
Ebuild name:

app-emulation/86Box-5.2-r1

Description

Emulator of x86-based machines based on PCem

Added to portage

2025-11-16

ansible-pylibssh - 1.3.0
Ebuild name:

dev-python/ansible-pylibssh-1.3.0

Description

Python bindings for libssh client specific to Ansible use case

Added to portage

2025-11-16

aotriton-bin - 0.11b-r1
Ebuild name:

sci-libs/aotriton-bin-0.11b-r1

Description

Ahead of Time (AOT) Triton Math Library (binary package)

Added to portage

2025-11-16

curl - 8.17.0-r1
Ebuild name:

net-misc/curl-8.17.0-r1

Description

A Client that groks URLs

Added to portage

2025-11-16

elasticsearch - 8.19.2
Ebuild name:

dev-ruby/elasticsearch-8.19.2

Description

Ruby integrations for ES, elasticsearch module

Added to portage

2025-11-16

elasticsearch - 9.2.0
Ebuild name:

dev-ruby/elasticsearch-9.2.0

Description

Ruby integrations for ES, elasticsearch module

Added to portage

2025-11-16

elasticsearch-api - 8.19.2
Ebuild name:

dev-ruby/elasticsearch-api-8.19.2

Description

Ruby integrations for ES, elasticsearch-api module

Added to portage

2025-11-16

elasticsearch-api - 9.2.0
Ebuild name:

dev-ruby/elasticsearch-api-9.2.0

Description

Ruby integrations for ES, elasticsearch-api module

Added to portage

2025-11-16

erb - 6.0.0
Ebuild name:

dev-ruby/erb-6.0.0

Description

An easy to use but powerful templating system for Ruby

Added to portage

2025-11-16

fake-py - 0.11.10
Ebuild name:

dev-python/fake-py-0.11.10

Description

Minimalistic, standalone alternative fake data generator with no depende

Added to portage

2025-11-16

filezilla - 3.69.5
Ebuild name:

net-ftp/filezilla-3.69.5

Description

FTP client with lots of useful features and an intuitive interface

Added to portage

2025-11-16

fish - 4.2.1
Ebuild name:

app-shells/fish-4.2.1

Description

Friendly Interactive SHell

Added to portage

2025-11-16

fzf - 0.67.0
Ebuild name:

app-shells/fzf-0.67.0

Description

General-purpose command-line fuzzy finder, written in Golang

Added to portage

2025-11-16

gcc - 15.2.1_p20251115
Ebuild name:

sys-devel/gcc-15.2.1_p20251115

Description

The GNU Compiler Collection

Added to portage

2025-11-16

goland - 2025.2.4
Ebuild name:

dev-util/goland-2025.2.4

Description

Golang IDE by JetBrains

Added to portage

2025-11-16

hipBLASLt - 7.1.0-r2
Ebuild name:

sci-libs/hipBLASLt-7.1.0-r2

Description

General matrix-matrix operations library for AMD Instinct accelerators

Added to portage

2025-11-16

hypothesis - 6.148.0
Ebuild name:

dev-python/hypothesis-6.148.0

Description

A library for property based testing

Added to portage

2025-11-16

mocha - 2.8.2
Ebuild name:

dev-ruby/mocha-2.8.2

Description

Mocking and stubbing using a syntax like that of JMock and SchMock

Added to portage

2025-11-16

pg_background - 1.5
Ebuild name:

dev-db/pg_background-1.5

Description

Postgres Background Worker

Added to portage

2025-11-16

popwin - 1.0.0
Ebuild name:

app-emacs/popwin-1.0.0

Description

Popup window manager for Emacs

Added to portage

2025-11-16

pycharm-community - 2025.2.4
Ebuild name:

dev-util/pycharm-community-2025.2.4

Description

Intelligent Python IDE with unique code assistance and analysis

Added to portage

2025-11-16

pycharm-professional - 2025.2.4
Ebuild name:

dev-util/pycharm-professional-2025.2.4

Description

Intelligent Python IDE with unique code assistance and analy

Added to portage

2025-11-16

pytest-localftpserver - 1.4.0
Ebuild name:

dev-python/pytest-localftpserver-1.4.0

Description

A PyTest plugin which provides an FTP fixture for your tests

Added to portage

2025-11-16

rmg - 0.8.7
Ebuild name:

games-emulation/rmg-0.8.7

Description

Rosalie's Mupen GUI

Added to portage

2025-11-16

rocm_bandwidth_test - 7.1.0-r1
Ebuild name:

dev-util/rocm_bandwidth_test-7.1.0-r1

Description

Bandwidth test for ROCm

Added to portage

2025-11-16

signal-desktop-bin - 7.79.0
Ebuild name:

net-im/signal-desktop-bin-7.79.0

Description

Allows you to send and receive messages of Signal Messenger on you

Added to portage

2025-11-16

sshfs - 3.7.5
Ebuild name:

net-fs/sshfs-3.7.5

Description

Fuse-filesystem utilizing the sftp service

Added to portage

2025-11-16

starship - 1.24.1
Ebuild name:

app-shells/starship-1.24.1

Description

The minimal, blazing-fast, and infinitely customizable prompt for any sh

Added to portage

2025-11-16

syd - 3.45.0
Ebuild name:

sys-apps/syd-3.45.0

Description

seccomp and landlock based application sandbox with support for namespaces

Added to portage

2025-11-16

syd-tui - 0.2.2
Ebuild name:

sys-apps/syd-tui-0.2.2

Description

Syd's Terminal User Interface

Added to portage

2025-11-16

systemtap - 5.4
Ebuild name:

dev-debug/systemtap-5.4

Description

Linux trace/probe tool

Added to portage

2025-11-16

tavern - 3.0.1
Ebuild name:

dev-python/tavern-3.0.1

Description

A tool, library, and Pytest plugin for testing RESTful APIs

Added to portage

2025-11-16

types-psutil - 7.0.0.20251116
Ebuild name:

dev-python/types-psutil-7.0.0.20251116

Description

Typing stubs for psutil

Added to portage

2025-11-16

vivaldi - 7.7.3851.48
Ebuild name:

www-client/vivaldi-7.7.3851.48

Description

A browser for our friends

Added to portage

2025-11-16

vivaldi-snapshot - 7.7.3851.44
Ebuild name:

www-client/vivaldi-snapshot-7.7.3851.44

Description

A browser for our friends

Added to portage

2025-11-16

xmlstarlet - 1.6.1-r5
Ebuild name:

app-text/xmlstarlet-1.6.1-r5

Description

A set of tools to transform, query, validate, and edit XML documents

Added to portage

2025-11-16

zope-interface - 8.1.1
Ebuild name:

dev-python/zope-interface-8.1.1

Description

Interfaces for Python

Added to portage

2025-11-16

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.7 ms