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:

48212

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
2019-08-24
GromacsWrapper - 0.8.0
Ebuild name:

sci-chemistry/GromacsWrapper-0.8.0

Description

Python framework for Gromacs

Added to portage

2019-08-24

ccrypt - 1.11
Ebuild name:

app-crypt/ccrypt-1.11

Description

Encryption and decryption

Added to portage

2019-08-24

chromium - 77.0.3865.42
Ebuild name:

www-client/chromium-77.0.3865.42

Description

Open-source version of Google Chrome web browser

Added to portage

2019-08-24

diskimage-builder - 2.26.1
Ebuild name:

app-emulation/diskimage-builder-2.26.1

Description

Golden Disk Image builder.

Added to portage

2019-08-24

displaycal - 3.8.5.0
Ebuild name:

media-gfx/displaycal-3.8.5.0

Description

Display calibration and characterization powered by Argyll CMS

Added to portage

2019-08-24

eventlet - 0.25.1
Ebuild name:

dev-python/eventlet-0.25.1

Description

Highly concurrent networking library

Added to portage

2019-08-24

geeqie - 1.5.1
Ebuild name:

media-gfx/geeqie-1.5.1

Description

A lightweight GTK image viewer forked from GQview

Added to portage

2019-08-24

gnome-desktop - 3.30.2.3
Ebuild name:

gnome-base/gnome-desktop-3.30.2.3

Description

Library with common API for various GNOME modules

Added to portage

2019-08-24

harfbuzz - 2.6.1
Ebuild name:

media-libs/harfbuzz-2.6.1

Description

An OpenType text shaping engine

Added to portage

2019-08-24

hiawatha-monitor - 1.6
Ebuild name:

www-apps/hiawatha-monitor-1.6

Description

Monitoring application for www-servers/hiawatha

Added to portage

2019-08-24

kismet - 2019.08.2
Ebuild name:

net-wireless/kismet-2019.08.2

Description

IEEE 802.11 wireless LAN sniffer

Added to portage

2019-08-24

ldb - 2.0.5
Ebuild name:

sys-libs/ldb-2.0.5

Description

An LDAP-like embedded database

Added to portage

2019-08-24

libdbi-drivers - 0.9.0-r1
Ebuild name:

dev-db/libdbi-drivers-0.9.0-r1

Description

The libdbi-drivers project maintains drivers for libdbi

Added to portage

2019-08-24

libinsane - 1.0.1
Ebuild name:

media-libs/libinsane-1.0.1

Description

Crossplatform access to image scanners

Added to portage

2019-08-24

libnftnl - 1.1.4
Ebuild name:

net-libs/libnftnl-1.1.4

Description

Netlink API to the in-kernel nf_tables subsystem

Added to portage

2019-08-24

libsoup - 2.66.2
Ebuild name:

net-libs/libsoup-2.66.2

Description

HTTP client/server library for GNOME

Added to portage

2019-08-24

lldpd - 1.0.4
Ebuild name:

net-misc/lldpd-1.0.4

Description

Implementation of IEEE 802.1ab (LLDP)

Added to portage

2019-08-24

mesa - 19.1.5
Ebuild name:

media-libs/mesa-19.1.5

Description

OpenGL-like graphic library for Linux

Added to portage

2019-08-24

mycli - 1.20.1
Ebuild name:

dev-db/mycli-1.20.1

Description

CLI for MySQL Database with auto-completion and syntax highlighting

Added to portage

2019-08-24

nautilus - 3.30.5-r1
Ebuild name:

gnome-base/nautilus-3.30.5-r1

Description

Default file manager for the GNOME desktop

Added to portage

2019-08-24

nextcloud - 14.0.14
Ebuild name:

www-apps/nextcloud-14.0.14

Description

Personal cloud that runs on your own server

Added to portage

2019-08-24

nextcloud - 15.0.11
Ebuild name:

www-apps/nextcloud-15.0.11

Description

Personal cloud that runs on your own server

Added to portage

2019-08-24

nextcloud - 16.0.4
Ebuild name:

www-apps/nextcloud-16.0.4

Description

Personal cloud that runs on your own server

Added to portage

2019-08-24

nftables - 0.9.2
Ebuild name:

net-firewall/nftables-0.9.2

Description

Linux kernel (3.13+) firewall, NAT and packet mangling tools

Added to portage

2019-08-24

ntlm-auth - 1.4.0
Ebuild name:

dev-python/ntlm-auth-1.4.0

Description

Calculates NTLM Authentication codes

Added to portage

2019-08-24

numkit - 1.1.2
Ebuild name:

sci-libs/numkit-1.1.2

Description

Numerical first aid kit (with numpy/scipy)

Added to portage

2019-08-24

openssl - 1.0.2s-r1
Ebuild name:

dev-libs/openssl-1.0.2s-r1

Description

full-strength general purpose cryptography library (including SSL and TL

Added to portage

2019-08-24

openssl - 1.1.0k-r1
Ebuild name:

dev-libs/openssl-1.1.0k-r1

Description

full-strength general purpose cryptography library (including SSL and TL

Added to portage

2019-08-24

openssl - 1.1.1c-r1
Ebuild name:

dev-libs/openssl-1.1.1c-r1

Description

full-strength general purpose cryptography library (including SSL and TL

Added to portage

2019-08-24

openssl-compat - 1.0.2s
Ebuild name:

dev-libs/openssl-compat-1.0.2s

Description

full-strength general purpose cryptography library (including SSL an

Added to portage

2019-08-24

paperwork - 1.3.0
Ebuild name:

app-text/paperwork-1.3.0

Description

a personal document manager for scanned documents (and PDFs)

Added to portage

2019-08-24

paperwork-backend - 1.3.0
Ebuild name:

app-text/paperwork-backend-1.3.0

Description

Backend part of Paperwork (Python API, no UI)

Added to portage

2019-08-24

pecan - 1.3.3-r1
Ebuild name:

dev-python/pecan-1.3.3-r1

Description

A WSGI object-dispatching web framework, lean, fast, with few dependenci

Added to portage

2019-08-24

platformio - 4.0.1
Ebuild name:

dev-embedded/platformio-4.0.1

Description

An open source ecosystem for IoT development

Added to portage

2019-08-24

poppler - 0.80.0
Ebuild name:

app-text/poppler-0.80.0

Description

PDF rendering library based on the xpdf-3.0 code base

Added to portage

2019-08-24

puppet - 6.8.0
Ebuild name:

app-admin/puppet-6.8.0

Description

A system automation and configuration management software.

Added to portage

2019-08-24

puppet-agent - 6.8.0
Ebuild name:

app-admin/puppet-agent-6.8.0

Description

general puppet client utils along with hiera and facter

Added to portage

2019-08-24

puppetdb - 6.5.0
Ebuild name:

app-admin/puppetdb-6.5.0

Description

PuppetDB collects data generated by Puppet.

Added to portage

2019-08-24

puppetdb-termini - 6.5.0
Ebuild name:

dev-ruby/puppetdb-termini-6.5.0

Description

Library needed to connect puppet to puppetdb

Added to portage

2019-08-24

r10k - 3.3.1
Ebuild name:

app-admin/r10k-3.3.1

Description

Puppet environment and module deployment

Added to portage

2019-08-24

samba - 4.10.7
Ebuild name:

net-fs/samba-4.10.7

Description

Samba Suite Version 4

Added to portage

2019-08-24

samba - 4.11.0_rc2
Ebuild name:

net-fs/samba-4.11.0_rc2

Description

Samba Suite Version 4

Added to portage

2019-08-24

scheme-complete - 0.9.8
Ebuild name:

app-emacs/scheme-complete-0.9.8

Description

Scheme tab-completion and word-completion for Emacs

Added to portage

2019-08-24

scss-mode - 0.5.0_p20150107
Ebuild name:

app-emacs/scss-mode-0.5.0_p20150107

Description

Major mode for editing SCSS files in Emacs

Added to portage

2019-08-24

scss-mode - 0.5.0_p20180123
Ebuild name:

app-emacs/scss-mode-0.5.0_p20180123

Description

Major mode for editing SCSS files in Emacs

Added to portage

2019-08-24

sigil - 0.9.17
Ebuild name:

app-text/sigil-0.9.17

Description

Multi-platform WYSIWYG ebook editor for ePub format

Added to portage

2019-08-24

spire - 0
Ebuild name:

acct-group/spire-0

Description

Added to portage

2019-08-24

spire - 0
Ebuild name:

acct-user/spire-0

Description

user for spiffe runtime environment

Added to portage

2019-08-24

squashfs-tools-ng - 0.6
Ebuild name:

sys-fs/squashfs-tools-ng-0.6

Description

A new set of tools for working with SquashFS images

Added to portage

2019-08-24

tdb - 1.4.2
Ebuild name:

sys-libs/tdb-1.4.2

Description

A simple database API

Added to portage

2019-08-24

2019-08-23
autoprefixer-rails - 9.6.1.1
Ebuild name:

dev-ruby/autoprefixer-rails-9.6.1.1

Description

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

Added to portage

2019-08-23

backports-unittest-mock - 1.5
Ebuild name:

dev-python/backports-unittest-mock-1.5

Description

Backport of unittest.mock

Added to portage

2019-08-23

freeipmi - 1.6.4
Ebuild name:

sys-libs/freeipmi-1.6.4

Description

Provides Remote-Console and System Management Software as per IPMI v1.5/2.0

Added to portage

2019-08-23

http-accept - 2.1.0
Ebuild name:

dev-ruby/http-accept-2.1.0

Description

Parse Accept and Accept-Language HTTP headers

Added to portage

2019-08-23

libobjc2 - 2.0
Ebuild name:

gnustep-base/libobjc2-2.0

Description

GNUstep Objective-C runtime

Added to portage

2019-08-23

mew - 6.8
Ebuild name:

app-emacs/mew-6.8

Description

Great MIME mail reader for Emacs/XEmacs

Added to portage

2019-08-23

mysql - 5.6.45-r2
Ebuild name:

dev-db/mysql-5.6.45-r2

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2019-08-23

mysql - 5.7.26-r1
Ebuild name:

dev-db/mysql-5.7.26-r1

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2019-08-23

mysql - 5.7.27-r1
Ebuild name:

dev-db/mysql-5.7.27-r1

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2019-08-23

mysql-connector-c - 8.0.17-r3
Ebuild name:

dev-db/mysql-connector-c-8.0.17-r3

Description

C client library for MariaDB/MySQL

Added to portage

2019-08-23

percona-server - 5.7.26.29-r1
Ebuild name:

dev-db/percona-server-5.7.26.29-r1

Description

A fast, multi-threaded, multi-user SQL database server

Added to portage

2019-08-23

pkgcheck - 0.6.0
Ebuild name:

dev-util/pkgcheck-0.6.0

Description

pkgcore-based QA utility

Added to portage

2019-08-23

pkgcore - 0.10.0
Ebuild name:

sys-apps/pkgcore-0.10.0

Description

a framework for package management

Added to portage

2019-08-23

pov-mode - 3.3-r1
Ebuild name:

app-emacs/pov-mode-3.3-r1

Description

Major mode for Povray scene files

Added to portage

2019-08-23

pychroot - 0.10.0
Ebuild name:

dev-python/pychroot-0.10.0

Description

a python library and cli tool that simplify chroot handling

Added to portage

2019-08-23

s-nail - 14.9.15
Ebuild name:

mail-client/s-nail-14.9.15

Description

Enhanced mailx-compatible mail client based on Hierloom mailx (nail)

Added to portage

2019-08-23

shotwell - 0.30.7
Ebuild name:

media-gfx/shotwell-0.30.7

Description

Open source photo manager for GNOME

Added to portage

2019-08-23

snakeoil - 0.8.1
Ebuild name:

dev-python/snakeoil-0.8.1

Description

misc common functionality and useful optimizations

Added to portage

2019-08-23

systemd - 243_rc2
Ebuild name:

sys-apps/systemd-243_rc2

Description

System and service manager for Linux

Added to portage

2019-08-23

timezone-data - 2019b-r2
Ebuild name:

sys-libs/timezone-data-2019b-r2

Description

Timezone data (/usr/share/zoneinfo) and utilities (tzselect/zic/zdu

Added to portage

2019-08-23

xfsprogs - 5.2.1
Ebuild name:

sys-fs/xfsprogs-5.2.1

Description

xfs filesystem utilities

Added to portage

2019-08-23

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