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:

77514

userrating:

average rating: 1.2 (8 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-06-22
Alien-Build - 2.840.0-r1
Ebuild name:

dev-perl/Alien-Build-2.840.0-r1

Description

Build external dependencies for use in CPAN

Added to portage

2025-06-22

App-Nopaste - 1.13.0-r1
Ebuild name:

dev-perl/App-Nopaste-1.13.0-r1

Description

Easy access to any pastebin

Added to portage

2025-06-22

Browser-Open - 0.40.0-r2
Ebuild name:

dev-perl/Browser-Open-0.40.0-r2

Description

Open a browser at a given URL

Added to portage

2025-06-22

DBD-Mock - 1.590.0
Ebuild name:

dev-perl/DBD-Mock-1.590.0

Description

Mock database driver for testing

Added to portage

2025-06-22

DBIx-Migration - 0.300.0
Ebuild name:

dev-perl/DBIx-Migration-0.300.0

Description

Seamless DB schema up- and downgrades

Added to portage

2025-06-22

MooX-SetOnce - 0.1.3
Ebuild name:

dev-perl/MooX-SetOnce-0.1.3

Description

Write-once attributes for Moo

Added to portage

2025-06-22

PerlX-Maybe - 1.202.0
Ebuild name:

dev-perl/PerlX-Maybe-1.202.0

Description

Return a pair only if they are both defined

Added to portage

2025-06-22

String-Expand - 0.40.0
Ebuild name:

dev-perl/String-Expand-0.40.0

Description

string utility functions for expanding variables in self-referential

Added to portage

2025-06-22

Test-API - 0.10.0
Ebuild name:

dev-perl/Test-API-0.10.0

Description

Test a list of subroutines provided by a module

Added to portage

2025-06-22

Test-DatabaseRow - 2.40.0
Ebuild name:

dev-perl/Test-DatabaseRow-2.40.0

Description

Simple database tests

Added to portage

2025-06-22

chrony_exporter - 0.12.1
Ebuild name:

app-metrics/chrony_exporter-0.12.1

Description

Chrony NTP exporter for Prometheus

Added to portage

2025-06-22

darktable - 5.2.0
Ebuild name:

media-gfx/darktable-5.2.0

Description

A virtual lighttable and darkroom for photographers

Added to portage

2025-06-22

datastructures - 0.3.3
Ebuild name:

dev-gap/datastructures-0.3.3

Description

Collection of standard data structures for GAP

Added to portage

2025-06-22

engauge - 9999
Ebuild name:

media-gfx/engauge-9999

Description

Convert an image file showing a graph or map into numbers

Added to portage

2025-06-22

fastfetch - 2.46.0
Ebuild name:

app-misc/fastfetch-2.46.0

Description

Fast neofetch-like system information tool

Added to portage

2025-06-22

fetchmail - 6.5.4
Ebuild name:

net-mail/fetchmail-6.5.4

Description

the legendary remote-mail retrieval and forwarding utility

Added to portage

2025-06-22

gcc - 12.4.1_p20250618
Ebuild name:

sys-devel/gcc-12.4.1_p20250618

Description

The GNU Compiler Collection

Added to portage

2025-06-22

gcc - 13.4.1_p20250619
Ebuild name:

sys-devel/gcc-13.4.1_p20250619

Description

The GNU Compiler Collection

Added to portage

2025-06-22

gcc - 14.3.1_p20250620
Ebuild name:

sys-devel/gcc-14.3.1_p20250620

Description

The GNU Compiler Collection

Added to portage

2025-06-22

gcc - 15.1.1_p20250621
Ebuild name:

sys-devel/gcc-15.1.1_p20250621

Description

The GNU Compiler Collection

Added to portage

2025-06-22

geeqie - 2.6.1
Ebuild name:

media-gfx/geeqie-2.6.1

Description

A lightweight GTK image viewer forked from GQview

Added to portage

2025-06-22

gnustep-base - 1.31.1-r1
Ebuild name:

gnustep-base/gnustep-base-1.31.1-r1

Description

A library of general-purpose, non-graphical Objective C objects

Added to portage

2025-06-22

i2p - 2.9.0
Ebuild name:

net-vpn/i2p-2.9.0

Description

A privacy-centric, anonymous network

Added to portage

2025-06-22

jaraco-collections - 5.2.1
Ebuild name:

dev-python/jaraco-collections-5.2.1

Description

Models and classes to supplement the stdlib collections module

Added to portage

2025-06-22

jaraco-functools - 4.2.1
Ebuild name:

dev-python/jaraco-functools-4.2.1

Description

Additional functions used by other projects by developer jaraco

Added to portage

2025-06-22

kmymoney - 5.2.0
Ebuild name:

app-office/kmymoney-5.2.0

Description

Personal finance manager based on KDE Frameworks

Added to portage

2025-06-22

ktimetracker - 6.0.0
Ebuild name:

app-office/ktimetracker-6.0.0

Description

Todo management and time tracker

Added to portage

2025-06-22

libalkimia - 8.2.0
Ebuild name:

app-office/libalkimia-8.2.0

Description

Library with common classes and functionality used by KDE finance appli

Added to portage

2025-06-22

libdecor - 0.2.3
Ebuild name:

gui-libs/libdecor-0.2.3

Description

A client-side decorations library for Wayland clients

Added to portage

2025-06-22

libp11 - 0.4.15
Ebuild name:

dev-libs/libp11-0.4.15

Description

Abstraction layer to simplify PKCS11 API

Added to portage

2025-06-22

libxml2 - 2.13.8-r1
Ebuild name:

dev-libs/libxml2-2.13.8-r1

Description

XML C parser and toolkit

Added to portage

2025-06-22

libxml2 - 2.14.4-r1
Ebuild name:

dev-libs/libxml2-2.14.4-r1

Description

XML C parser and toolkit

Added to portage

2025-06-22

mmv - 2.10
Ebuild name:

app-misc/mmv-2.10

Description

Move/copy/append/link multiple files according to a set of wildcard patterns

Added to portage

2025-06-22

pciutils - 3.14.0
Ebuild name:

sys-apps/pciutils-3.14.0

Description

Various utilities dealing with the PCI bus

Added to portage

2025-06-22

pdm - 2.25.3
Ebuild name:

dev-python/pdm-2.25.3

Description

Python package and dependency manager supporting the latest PEP standards

Added to portage

2025-06-22

pkcs11-dump - 0.3.5
Ebuild name:

app-crypt/pkcs11-dump-0.3.5

Description

Utilities for PKCS11 token content dump

Added to portage

2025-06-22

pkcs11-helper - 1.30.0
Ebuild name:

dev-libs/pkcs11-helper-1.30.0

Description

PKCS11 helper library

Added to portage

2025-06-22

posframe - 1.4.4
Ebuild name:

app-emacs/posframe-1.4.4

Description

Pop up a frame at point

Added to portage

2025-06-22

pybtex - 0.25.0
Ebuild name:

dev-python/pybtex-0.25.0

Description

BibTeX-compatible bibliography processor

Added to portage

2025-06-22

pygments - 2.19.2
Ebuild name:

dev-python/pygments-2.19.2

Description

Pygments is a syntax highlighting package written in Python

Added to portage

2025-06-22

pymdown-extensions - 10.16
Ebuild name:

dev-python/pymdown-extensions-10.16

Description

Extensions for Python Markdown

Added to portage

2025-06-22

skim - 0.20.1
Ebuild name:

app-misc/skim-0.20.1

Description

Command-line fuzzy finder

Added to portage

2025-06-22

sqlglot - 26.30.0
Ebuild name:

dev-python/sqlglot-26.30.0

Description

An easily customizable SQL parser and transpiler

Added to portage

2025-06-22

starlette - 0.47.1
Ebuild name:

dev-python/starlette-0.47.1

Description

The little ASGI framework that shines

Added to portage

2025-06-22

sudo - 1.9.17
Ebuild name:

app-admin/sudo-1.9.17

Description

Allows users or groups to run commands as other users

Added to portage

2025-06-22

tempest - 44.0.0
Ebuild name:

dev-python/tempest-44.0.0

Description

OpenStack Integration Testing

Added to portage

2025-06-22

tempora - 5.8.1
Ebuild name:

dev-python/tempora-5.8.1

Description

Objects and routines pertaining to date and time

Added to portage

2025-06-22

vivaldi - 7.4.3684.55
Ebuild name:

www-client/vivaldi-7.4.3684.55

Description

A browser for our friends

Added to portage

2025-06-22

vivaldi-snapshot - 7.5.3731.3
Ebuild name:

www-client/vivaldi-snapshot-7.5.3731.3

Description

A browser for our friends

Added to portage

2025-06-22

xca - 2.9.0-r1
Ebuild name:

app-crypt/xca-2.9.0-r1

Description

A GUI to OpenSSL, RSA public keys, certificates, signing requests etc

Added to portage

2025-06-22

2025-06-21
Net-CIDR - 0.260.0
Ebuild name:

dev-perl/Net-CIDR-0.260.0

Description

Manipulate netblock lists in CIDR notation

Added to portage

2025-06-21

QAdwaitaDecorations - 0.1.6
Ebuild name:

x11-themes/QAdwaitaDecorations-0.1.6

Description

Qt decoration plugin implementing Adwaita-like client-side dec

Added to portage

2025-06-21

QGnomePlatform - 0.9.2-r6
Ebuild name:

x11-themes/QGnomePlatform-0.9.2-r6

Description

A Qt Platform Theme aimed to accommodate GNOME settings

Added to portage

2025-06-21

amavisd-new - 2.13.1
Ebuild name:

mail-filter/amavisd-new-2.13.1

Description

High-performance interface between the MTA and content checkers

Added to portage

2025-06-21

apsw - 3.50.1.0
Ebuild name:

dev-python/apsw-3.50.1.0

Description

APSW - Another Python SQLite Wrapper

Added to portage

2025-06-21

awscli - 1.40.40
Ebuild name:

app-admin/awscli-1.40.40

Description

Universal Command Line Environment for AWS

Added to portage

2025-06-21

boto3 - 1.38.41
Ebuild name:

dev-python/boto3-1.38.41

Description

The AWS SDK for Python

Added to portage

2025-06-21

botocore - 1.38.41
Ebuild name:

dev-python/botocore-1.38.41

Description

Low-level, data-driven core of boto 3

Added to portage

2025-06-21

cfn-lint - 1.36.1
Ebuild name:

dev-python/cfn-lint-1.36.1

Description

CloudFormation Linter

Added to portage

2025-06-21

claude-code - 1.0.30
Ebuild name:

dev-util/claude-code-1.0.30

Description

Claude Code - an agentic coding tool by Anthropic

Added to portage

2025-06-21

clipmenu - 9999
Ebuild name:

x11-misc/clipmenu-9999

Description

Clipboard management

Added to portage

2025-06-21

criu - 4.1
Ebuild name:

sys-process/criu-4.1

Description

Utility to checkpoint/restore a process tree

Added to portage

2025-06-21

crun - 1.21
Ebuild name:

app-containers/crun-1.21

Description

Fast and low-memory footprint OCI Container Runtime fully written in C

Added to portage

2025-06-21

cstruct - 6.1
Ebuild name:

dev-python/cstruct-6.1

Description

C-style structs for Python

Added to portage

2025-06-21

dosbox-staging - 0.82.2
Ebuild name:

games-emulation/dosbox-staging-0.82.2

Description

Modernized DOSBox soft-fork

Added to portage

2025-06-21

dtrace - 2.0.3
Ebuild name:

dev-debug/dtrace-2.0.3

Description

Dynamic BPF-based system-wide tracing tool

Added to portage

2025-06-21

duplicity - 3.0.5
Ebuild name:

app-backup/duplicity-3.0.5

Description

Secure backup system using gnupg to encrypt data

Added to portage

2025-06-21

easy-rsa - 3.2.3
Ebuild name:

app-crypt/easy-rsa-3.2.3

Description

Small RSA key management package, based on OpenSSL

Added to portage

2025-06-21

element - 1.11.104
Ebuild name:

www-apps/element-1.11.104

Description

A glossy Matrix collaboration client for the web

Added to portage

2025-06-21

flake8 - 7.3.0
Ebuild name:

dev-python/flake8-7.3.0

Description

A wrapper around PyFlakes, pep8 & mccabe

Added to portage

2025-06-21

free42 - 3.3.6
Ebuild name:

app-emulation/free42-3.3.6

Description

An HP-42S Calculator Simulator

Added to portage

2025-06-21

gradle-bin - 8.14.2
Ebuild name:

dev-java/gradle-bin-8.14.2

Description

A project automation and build tool with a Groovy based DSL

Added to portage

2025-06-21

gtk-vnc - 1.5.0
Ebuild name:

net-libs/gtk-vnc-1.5.0

Description

VNC viewer widget for GTK

Added to portage

2025-06-21

highway - 1.2.0
Ebuild name:

dev-cpp/highway-1.2.0

Description

Performance-portable, length-agnostic SIMD with runtime dispatch

Added to portage

2025-06-21

hypothesis - 6.135.14
Ebuild name:

dev-python/hypothesis-6.135.14

Description

A library for property based testing

Added to portage

2025-06-21

isa-l - 2.31.1-r2
Ebuild name:

dev-libs/isa-l-2.31.1-r2

Description

Intelligent Storage Acceleration Library

Added to portage

2025-06-21

kdsingleapplication - 1.2.0
Ebuild name:

dev-libs/kdsingleapplication-1.2.0

Description

KDAB's helper class for single-instance policy applications

Added to portage

2025-06-21

librime-lua - 20240819212322-r1
Ebuild name:

app-i18n/librime-lua-20240819212322-r1

Description

Lua module for RIME

Added to portage

2025-06-21

libucontext - 1.3.2
Ebuild name:

sys-libs/libucontext-1.3.2

Description

ucontext implementation featuring glibc-compatible ABI

Added to portage

2025-06-21

liburing - 2.11
Ebuild name:

sys-libs/liburing-2.11

Description

Efficient I/O with io_uring

Added to portage

2025-06-21

lxqt-build-tools - 2.2.1
Ebuild name:

dev-util/lxqt-build-tools-2.2.1

Description

LXQt Build Tools

Added to portage

2025-06-21

mac - 11.18
Ebuild name:

media-sound/mac-11.18

Description

Monkey's Audio Codecs

Added to portage

2025-06-21

magic_enum - 0.9.7
Ebuild name:

dev-cpp/magic_enum-0.9.7

Description

Static reflection for enums in header-only C++

Added to portage

2025-06-21

mako - 1.10.0
Ebuild name:

gui-apps/mako-1.10.0

Description

A lightweight notification daemon for Wayland. Works on Sway

Added to portage

2025-06-21

mycli - 1.31.2
Ebuild name:

dev-db/mycli-1.31.2

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2025-06-21

nanoc - 4.13.5
Ebuild name:

www-apps/nanoc-4.13.5

Description

nanoc is a simple but very flexible static site generator written in Ruby

Added to portage

2025-06-21

nanoc-cli - 4.13.5
Ebuild name:

www-apps/nanoc-cli-4.13.5

Description

nanoc is a simple but very flexible static site generator written in Ruby

Added to portage

2025-06-21

nanoc-core - 4.13.5
Ebuild name:

www-apps/nanoc-core-4.13.5

Description

nanoc is a simple but very flexible static site generator written in Rub

Added to portage

2025-06-21

nextcloud - 30.0.12
Ebuild name:

www-apps/nextcloud-30.0.12

Description

Personal cloud that runs on your own server

Added to portage

2025-06-21

nextcloud - 31.0.6
Ebuild name:

www-apps/nextcloud-31.0.6

Description

Personal cloud that runs on your own server

Added to portage

2025-06-21

nextcloud-client - 3.16.6
Ebuild name:

net-misc/nextcloud-client-3.16.6

Description

Desktop Syncing Client for Nextcloud

Added to portage

2025-06-21

nghttp2 - 1.66.0
Ebuild name:

net-libs/nghttp2-1.66.0

Description

HTTP/2 C Library

Added to portage

2025-06-21

openrc - 0.62.4
Ebuild name:

sys-apps/openrc-0.62.4

Description

OpenRC manages the services, startup and shutdown of a host

Added to portage

2025-06-21

owncloud-client - 5.3.2.15463
Ebuild name:

net-misc/owncloud-client-5.3.2.15463

Description

Synchronize files from ownCloud Server with your computer

Added to portage

2025-06-21

pch-session - 47.0
Ebuild name:

gnome-extra/pch-session-47.0

Description

Unofficial gnome based session with different default settings and ext

Added to portage

2025-06-21

plus42 - 1.3.8
Ebuild name:

app-emulation/plus42-1.3.8

Description

An Enhanced HP-42S Calculator Simulator

Added to portage

2025-06-21

posframe - 1.4.4
Ebuild name:

app-emacs/posframe-1.4.4

Description

Pop up a frame at point

Added to portage

2025-06-21

pov-mode - 3.3-r1
Ebuild name:

app-emacs/pov-mode-3.3-r1

Description

Major mode for Povray scene files

Added to portage

2025-06-21

pov-mode - 3.3-r1
Ebuild name:

app-emacs/pov-mode-3.3-r1

Description

Major mode for Povray scene files

Added to portage

2025-06-21

pycodestyle - 2.14.0
Ebuild name:

dev-python/pycodestyle-2.14.0

Description

Python style guide checker (fka pep8)

Added to portage

2025-06-21

pyflakes - 3.4.0
Ebuild name:

dev-python/pyflakes-3.4.0

Description

Passive checker for Python programs

Added to portage

2025-06-21

rfc3161-client - 1.0.3
Ebuild name:

dev-python/rfc3161-client-1.0.3

Description

An Opinionated Python RFC3161 Client

Added to portage

2025-06-21

scrcpy - 3.3.1
Ebuild name:

app-mobilephone/scrcpy-3.3.1

Description

Display and control your Android device

Added to portage

2025-06-21

sigstore - 3.6.4
Ebuild name:

dev-python/sigstore-3.6.4

Description

A tool for signing Python package distributions

Added to portage

2025-06-21

spice - 0.16.0
Ebuild name:

app-emulation/spice-0.16.0

Description

SPICE server

Added to portage

2025-06-21

spice-protocol - 0.14.5
Ebuild name:

app-emulation/spice-protocol-0.14.5

Description

Headers defining the SPICE protocol

Added to portage

2025-06-21

tarlz - 0.28
Ebuild name:

app-arch/tarlz-0.28

Description

A parallel archiver combining tar and lzip

Added to portage

2025-06-21

typer - 0.16.0
Ebuild name:

dev-python/typer-0.16.0

Description

Build great CLIs. Easy to code. Based on Python type hints

Added to portage

2025-06-21

virglrenderer - 1.1.1
Ebuild name:

media-libs/virglrenderer-1.1.1

Description

Library used implement a virtual 3D GPU used by qemu

Added to portage

2025-06-21

xca - 2.9.0-r1
Ebuild name:

app-crypt/xca-2.9.0-r1

Description

A GUI to OpenSSL, RSA public keys, certificates, signing requests etc

Added to portage

2025-06-21

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