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:

43904

userrating:

average rating: 1.5 (4 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: 2.5 (2 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back



Other free services
toURL.org
Shorten long
URLs to short
links like
http://tourl.org/2
tourl.org
.
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
www.reversednslookup.org

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
2018-12-10
android-studio - 3.2.1.0.181.5056338
Ebuild name:

dev-util/android-studio-3.2.1.0.181.5056338

Description

A new Android development environment based on IntelliJ

Added to portage

2018-12-10

attica - 5.53.0
Ebuild name:

kde-frameworks/attica-5.53.0

Description

Framework providing access to Open Collaboration Services

Added to portage

2018-12-10

baloo - 5.53.0
Ebuild name:

kde-frameworks/baloo-5.53.0

Description

Framework for searching and managing metadata

Added to portage

2018-12-10

bluez-qt - 5.53.0
Ebuild name:

kde-frameworks/bluez-qt-5.53.0

Description

Qt wrapper for Bluez 5 DBus API

Added to portage

2018-12-10

breeze-icons - 5.53.0
Ebuild name:

kde-frameworks/breeze-icons-5.53.0

Description

Breeze SVG icon theme

Added to portage

2018-12-10

breeze-icons-rcc - 5.53.0
Ebuild name:

kde-frameworks/breeze-icons-rcc-5.53.0

Description

Breeze SVG icon theme binary resource

Added to portage

2018-12-10

extra-cmake-modules - 5.53.0
Ebuild name:

kde-frameworks/extra-cmake-modules-5.53.0

Description

Extra modules and scripts for CMake

Added to portage

2018-12-10

frameworkintegration - 5.53.0
Ebuild name:

kde-frameworks/frameworkintegration-5.53.0

Description

Framework for integrating Qt applications with KDE Plasm

Added to portage

2018-12-10

kactivities - 5.53.0
Ebuild name:

kde-frameworks/kactivities-5.53.0

Description

Framework for working with KDE activities

Added to portage

2018-12-10

kactivities-stats - 5.53.0
Ebuild name:

kde-frameworks/kactivities-stats-5.53.0

Description

Framework for getting the usage statistics collected by the

Added to portage

2018-12-10

kapidox - 5.53.0
Ebuild name:

kde-frameworks/kapidox-5.53.0

Description

Framework for building KDE API documentation in a standard format and

Added to portage

2018-12-10

karchive - 5.53.0
Ebuild name:

kde-frameworks/karchive-5.53.0

Description

Framework for reading, creation, and manipulation of various archive

Added to portage

2018-12-10

kauth - 5.53.0
Ebuild name:

kde-frameworks/kauth-5.53.0

Description

Framework to let applications perform actions as a privileged user

Added to portage

2018-12-10

kbookmarks - 5.53.0
Ebuild name:

kde-frameworks/kbookmarks-5.53.0

Description

Framework for managing bookmarks stored in XBEL format

Added to portage

2018-12-10

kcmutils - 5.53.0
Ebuild name:

kde-frameworks/kcmutils-5.53.0

Description

Framework to work with KDE System Settings modules

Added to portage

2018-12-10

kcodecs - 5.53.0
Ebuild name:

kde-frameworks/kcodecs-5.53.0

Description

Framework for manipulating strings using various encodings

Added to portage

2018-12-10

kcompletion - 5.53.0
Ebuild name:

kde-frameworks/kcompletion-5.53.0

Description

Framework for common completion tasks such as filename or URL com

Added to portage

2018-12-10

kconfig - 5.53.0
Ebuild name:

kde-frameworks/kconfig-5.53.0

Description

Framework for reading and writing configuration

Added to portage

2018-12-10

kconfigwidgets - 5.53.0
Ebuild name:

kde-frameworks/kconfigwidgets-5.53.0

Description

Framework providing an assortment of configuration-related wid

Added to portage

2018-12-10

kcoreaddons - 5.53.1
Ebuild name:

kde-frameworks/kcoreaddons-5.53.1

Description

Framework for solving common problems such as caching, randomisat

Added to portage

2018-12-10

kcrash - 5.53.0
Ebuild name:

kde-frameworks/kcrash-5.53.0

Description

Framework for intercepting and handling application crashes

Added to portage

2018-12-10

kdbusaddons - 5.53.0
Ebuild name:

kde-frameworks/kdbusaddons-5.53.0

Description

Framework for registering services and applications per freedeskt

Added to portage

2018-12-10

kdeclarative - 5.53.0
Ebuild name:

kde-frameworks/kdeclarative-5.53.0

Description

Framework providing integration of QML and KDE work spaces

Added to portage

2018-12-10

kded - 5.53.0
Ebuild name:

kde-frameworks/kded-5.53.0

Description

Central daemon of KDE workspaces

Added to portage

2018-12-10

kdelibs4support - 5.53.0
Ebuild name:

kde-frameworks/kdelibs4support-5.53.0

Description

Framework easing the development transition from KDELibs 4 to

Added to portage

2018-12-10

kdesignerplugin - 5.53.0
Ebuild name:

kde-frameworks/kdesignerplugin-5.53.0

Description

Framework providing plugins to use KDE frameworks widgets in

Added to portage

2018-12-10

kdesu - 5.53.0
Ebuild name:

kde-frameworks/kdesu-5.53.0

Description

Framework to handle super user actions

Added to portage

2018-12-10

kdewebkit - 5.53.0
Ebuild name:

kde-frameworks/kdewebkit-5.53.0

Description

Framework providing KDE integration of QtWebKit

Added to portage

2018-12-10

kdnssd - 5.53.0
Ebuild name:

kde-frameworks/kdnssd-5.53.0

Description

Framework for network service discovery using Zeroconf

Added to portage

2018-12-10

kdoctools - 5.53.0
Ebuild name:

kde-frameworks/kdoctools-5.53.0

Description

Tools to generate documentation in various formats from DocBook fil

Added to portage

2018-12-10

kemoticons - 5.53.0
Ebuild name:

kde-frameworks/kemoticons-5.53.0

Description

Framework for converting text emoticons to graphical representatio

Added to portage

2018-12-10

kfilemetadata - 5.53.0
Ebuild name:

kde-frameworks/kfilemetadata-5.53.0

Description

Library for extracting file metadata

Added to portage

2018-12-10

kglobalaccel - 5.53.0
Ebuild name:

kde-frameworks/kglobalaccel-5.53.0

Description

Framework to handle global shortcuts

Added to portage

2018-12-10

kguiaddons - 5.53.0
Ebuild name:

kde-frameworks/kguiaddons-5.53.0

Description

Framework providing assorted high-level user interface components

Added to portage

2018-12-10

kholidays - 5.53.0
Ebuild name:

kde-frameworks/kholidays-5.53.0

Description

Library to determine holidays and other special events for a geogra

Added to portage

2018-12-10

khtml - 5.53.0
Ebuild name:

kde-frameworks/khtml-5.53.0

Description

KHTML web rendering engine

Added to portage

2018-12-10

ki18n - 5.53.0
Ebuild name:

kde-frameworks/ki18n-5.53.0

Description

Framework based on Gettext for internationalizing user interface text

Added to portage

2018-12-10

kiconthemes - 5.53.0
Ebuild name:

kde-frameworks/kiconthemes-5.53.0

Description

Framework for icon theming and configuration

Added to portage

2018-12-10

kidletime - 5.53.0
Ebuild name:

kde-frameworks/kidletime-5.53.0

Description

Framework for detection and notification of device idle time

Added to portage

2018-12-10

kimageformats - 5.53.0
Ebuild name:

kde-frameworks/kimageformats-5.53.0

Description

Framework providing additional format plugins for Qt's image I/

Added to portage

2018-12-10

kinit - 5.53.0
Ebuild name:

kde-frameworks/kinit-5.53.0

Description

Helper library to speed up start of applications on KDE work spaces

Added to portage

2018-12-10

kio - 5.53.0
Ebuild name:

kde-frameworks/kio-5.53.0

Description

Framework providing transparent file and data management

Added to portage

2018-12-10

kirigami - 5.53.0
Ebuild name:

kde-frameworks/kirigami-5.53.0

Description

Lightweight user interface framework for mobile and convergent appli

Added to portage

2018-12-10

kitemmodels - 5.53.0
Ebuild name:

kde-frameworks/kitemmodels-5.53.0

Description

Framework providing data models to help with tasks such as sortin

Added to portage

2018-12-10

kitemviews - 5.53.0
Ebuild name:

kde-frameworks/kitemviews-5.53.0

Description

Framework providing additional widgets for item models

Added to portage

2018-12-10

kjobwidgets - 5.53.0
Ebuild name:

kde-frameworks/kjobwidgets-5.53.0

Description

Framework providing assorted widgets for showing the progress of

Added to portage

2018-12-10

kjs - 5.53.0
Ebuild name:

kde-frameworks/kjs-5.53.0

Description

ECMAScipt compatible parser and engine

Added to portage

2018-12-10

kjsembed - 5.53.0
Ebuild name:

kde-frameworks/kjsembed-5.53.0

Description

Framework binding JavaScript objects to QObjects

Added to portage

2018-12-10

mcfly - 0.2.5
Ebuild name:

app-shells/mcfly-0.2.5

Description

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

Added to portage

2018-12-10

u-boot-tools - 2018.11
Ebuild name:

dev-embedded/u-boot-tools-2018.11

Description

utilities for working with Das U-Boot

Added to portage

2018-12-10

2018-12-09
Test-More-UTF8 - 0.50.0
Ebuild name:

dev-perl/Test-More-UTF8-0.50.0

Description

Enhancing Test for UTF8-based projects

Added to portage

2018-12-09

Text-Template - 1.530.0
Ebuild name:

dev-perl/Text-Template-1.530.0

Description

Expand template text with embedded Perl

Added to portage

2018-12-09

Text-VimColor - 0.290.0
Ebuild name:

dev-perl/Text-VimColor-0.290.0

Description

Syntax highlighting using vim

Added to portage

2018-12-09

aspell-en - 2018.04.16.0
Ebuild name:

app-dicts/aspell-en-2018.04.16.0

Description

Added to portage

2018-12-09

autoprefixer-rails - 9.4.2
Ebuild name:

dev-ruby/autoprefixer-rails-9.4.2

Description

Add vendor prefixes to CSS rules using values from the Can I Use

Added to portage

2018-12-09

backports - 3.11.4
Ebuild name:

dev-ruby/backports-3.11.4

Description

Backports of Ruby features for older Ruby

Added to portage

2018-12-09

cargo - 1.31.0
Ebuild name:

virtual/cargo-1.31.0

Description

Package manager for Rust

Added to portage

2018-12-09

chunky_png - 1.3.11
Ebuild name:

dev-ruby/chunky_png-1.3.11

Description

Pure Ruby library that can read and write PNG images

Added to portage

2018-12-09

faraday - 0.15.4
Ebuild name:

dev-ruby/faraday-0.15.4

Description

HTTP/REST API client library with pluggable components

Added to portage

2018-12-09

fast_gettext - 1.8.0
Ebuild name:

dev-ruby/fast_gettext-1.8.0

Description

GetText but 3.5x faster, 560x less memory, clean namespace and threadsa

Added to portage

2018-12-09

gcc - 7.4.0
Ebuild name:

sys-devel/gcc-7.4.0

Description

The GNU Compiler Collection

Added to portage

2018-12-09

icalendar - 4.0.3
Ebuild name:

dev-python/icalendar-4.0.3

Description

Package used for parsing and generating iCalendar files (RFC 2445)

Added to portage

2018-12-09

nasm - 2.14-r1
Ebuild name:

dev-lang/nasm-2.14-r1

Description

groovy little assembler

Added to portage

2018-12-09

nvidia-drivers - 415.22
Ebuild name:

x11-drivers/nvidia-drivers-415.22

Description

NVIDIA Accelerated Graphics Driver

Added to portage

2018-12-09

pip3line - 3.5.5
Ebuild name:

app-misc/pip3line-3.5.5

Description

Raw bytes manipulation, transformations (decoding and more) and interceptio

Added to portage

2018-12-09

rust - 1.31.0
Ebuild name:

dev-lang/rust-1.31.0

Description

Systems programming language from Mozilla

Added to portage

2018-12-09

rust - 1.31.0
Ebuild name:

virtual/rust-1.31.0

Description

Virtual for Rust language compiler

Added to portage

2018-12-09

rust-bin - 1.31.0
Ebuild name:

dev-lang/rust-bin-1.31.0

Description

Systems programming language from Mozilla

Added to portage

2018-12-09

tpm-tools - 1.3.9.1-r1
Ebuild name:

app-crypt/tpm-tools-1.3.9.1-r1

Description

TrouSerS' support tools for the Trusted Platform Modules

Added to portage

2018-12-09

xfce4-mpc-plugin - 0.5.1
Ebuild name:

xfce-extra/xfce4-mpc-plugin-0.5.1

Description

Music Player Daemon (mpd) panel plugin

Added to portage

2018-12-09

rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2018 Sascha Nitsch Unternehmensberatung UG(haftungsbeschänkt)
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: 47.4 ms