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:

45050

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-03-26
PyUtilib - 5.6.5
Ebuild name:

dev-python/PyUtilib-5.6.5

Description

A collection of Python utilities

Added to portage

2019-03-26

activestorage - 5.2.2.1
Ebuild name:

dev-ruby/activestorage-5.2.2.1

Description

Attach cloud and local files in Rails applications

Added to portage

2019-03-26

endlessh - 0.1
Ebuild name:

net-misc/endlessh-0.1

Description

SSH tarpit that slowly sends and endless banner

Added to portage

2019-03-26

endlessh - 9999
Ebuild name:

net-misc/endlessh-9999

Description

SSH tarpit that slowly sends and endless banner

Added to portage

2019-03-26

flexmock - 0.10.4
Ebuild name:

dev-python/flexmock-0.10.4

Description

Testing library to create mocks, stubs and fakes

Added to portage

2019-03-26

gcovr - 4.1
Ebuild name:

dev-util/gcovr-4.1

Description

A Python script for summarizing gcov data

Added to portage

2019-03-26

gvim - 8.1.0648-r1
Ebuild name:

app-editors/gvim-8.1.0648-r1

Description

GUI version of the Vim text editor

Added to portage

2019-03-26

i3 - 4.16.1
Ebuild name:

x11-wm/i3-4.16.1

Description

An improved dynamic tiling window manager

Added to portage

2019-03-26

keyring - 18.0.1
Ebuild name:

dev-python/keyring-18.0.1

Description

Provides access to the system keyring service

Added to portage

2019-03-26

lcov - 1.14
Ebuild name:

dev-util/lcov-1.14

Description

A graphical front-end for GCC's coverage testing tool gcov

Added to portage

2019-03-26

libssh2 - 1.8.2
Ebuild name:

net-libs/libssh2-1.8.2

Description

Library implementing the SSH2 protocol

Added to portage

2019-03-26

lutris - 0.5.1.2
Ebuild name:

games-util/lutris-0.5.1.2

Description

An open source gaming platform for GNU/Linux

Added to portage

2019-03-26

nmon - 16i
Ebuild name:

sys-process/nmon-16i

Description

Nigel's performance MONitor for CPU, memory, network, disks, etc...

Added to portage

2019-03-26

nova - 18.2.0
Ebuild name:

sys-cluster/nova-18.2.0

Description

Cloud computing fabric controller (main part of an IaaS system) in Python

Added to portage

2019-03-26

nsd - 4.1.27
Ebuild name:

net-dns/nsd-4.1.27

Description

An authoritative only, high performance, open source name server

Added to portage

2019-03-26

polkit - 0.115-r4
Ebuild name:

sys-auth/polkit-0.115-r4

Description

Policy framework for controlling privileges for system-wide services

Added to portage

2019-03-26

pure-ftpd - 1.0.48
Ebuild name:

net-ftp/pure-ftpd-1.0.48

Description

Fast, production-quality, standard-conformant FTP server

Added to portage

2019-03-26

pure-ftpd - 9999
Ebuild name:

net-ftp/pure-ftpd-9999

Description

Fast, production-quality, standard-conformant FTP server

Added to portage

2019-03-26

putty - 0.71-r2
Ebuild name:

net-misc/putty-0.71-r2

Description

A Free Telnet/SSH Client

Added to portage

2019-03-26

python-heatclient - 1.16.2
Ebuild name:

dev-python/python-heatclient-1.16.2

Description

OpenStack Orchestration API Client Library

Added to portage

2019-03-26

rail - 1.2_p1-r1
Ebuild name:

dev-tex/rail-1.2_p1-r1

Description

Offers syntax/railroad diagrams

Added to portage

2019-03-26

ruby_parser - 3.13.1
Ebuild name:

dev-ruby/ruby_parser-3.13.1

Description

A ruby parser written in pure ruby

Added to portage

2019-03-26

selinux-abrt - 2.20190201-r1
Ebuild name:

sec-policy/selinux-abrt-2.20190201-r1

Description

SELinux policy for abrt

Added to portage

2019-03-26

selinux-accountsd - 2.20190201-r1
Ebuild name:

sec-policy/selinux-accountsd-2.20190201-r1

Description

SELinux policy for accountsd

Added to portage

2019-03-26

selinux-acct - 2.20190201-r1
Ebuild name:

sec-policy/selinux-acct-2.20190201-r1

Description

SELinux policy for acct

Added to portage

2019-03-26

selinux-ada - 2.20190201-r1
Ebuild name:

sec-policy/selinux-ada-2.20190201-r1

Description

SELinux policy for ada

Added to portage

2019-03-26

selinux-afs - 2.20190201-r1
Ebuild name:

sec-policy/selinux-afs-2.20190201-r1

Description

SELinux policy for afs

Added to portage

2019-03-26

selinux-aide - 2.20190201-r1
Ebuild name:

sec-policy/selinux-aide-2.20190201-r1

Description

SELinux policy for aide

Added to portage

2019-03-26

selinux-alsa - 2.20190201-r1
Ebuild name:

sec-policy/selinux-alsa-2.20190201-r1

Description

SELinux policy for alsa

Added to portage

2019-03-26

selinux-amanda - 2.20190201-r1
Ebuild name:

sec-policy/selinux-amanda-2.20190201-r1

Description

SELinux policy for amanda

Added to portage

2019-03-26

selinux-amavis - 2.20190201-r1
Ebuild name:

sec-policy/selinux-amavis-2.20190201-r1

Description

SELinux policy for amavis

Added to portage

2019-03-26

selinux-android - 2.20190201-r1
Ebuild name:

sec-policy/selinux-android-2.20190201-r1

Description

SELinux policy for android

Added to portage

2019-03-26

selinux-apache - 2.20190201-r1
Ebuild name:

sec-policy/selinux-apache-2.20190201-r1

Description

SELinux policy for apache

Added to portage

2019-03-26

selinux-apcupsd - 2.20190201-r1
Ebuild name:

sec-policy/selinux-apcupsd-2.20190201-r1

Description

SELinux policy for apcupsd

Added to portage

2019-03-26

selinux-apm - 2.20190201-r1
Ebuild name:

sec-policy/selinux-apm-2.20190201-r1

Description

SELinux policy for acpi

Added to portage

2019-03-26

selinux-arpwatch - 2.20190201-r1
Ebuild name:

sec-policy/selinux-arpwatch-2.20190201-r1

Description

SELinux policy for arpwatch

Added to portage

2019-03-26

selinux-asterisk - 2.20190201-r1
Ebuild name:

sec-policy/selinux-asterisk-2.20190201-r1

Description

SELinux policy for asterisk

Added to portage

2019-03-26

selinux-at - 2.20190201-r1
Ebuild name:

sec-policy/selinux-at-2.20190201-r1

Description

SELinux policy for at

Added to portage

2019-03-26

selinux-automount - 2.20190201-r1
Ebuild name:

sec-policy/selinux-automount-2.20190201-r1

Description

SELinux policy for automount

Added to portage

2019-03-26

selinux-avahi - 2.20190201-r1
Ebuild name:

sec-policy/selinux-avahi-2.20190201-r1

Description

SELinux policy for avahi

Added to portage

2019-03-26

selinux-awstats - 2.20190201-r1
Ebuild name:

sec-policy/selinux-awstats-2.20190201-r1

Description

SELinux policy for awstats

Added to portage

2019-03-26

selinux-backup - 2.20190201-r1
Ebuild name:

sec-policy/selinux-backup-2.20190201-r1

Description

SELinux policy for generic backup apps

Added to portage

2019-03-26

selinux-bacula - 2.20190201-r1
Ebuild name:

sec-policy/selinux-bacula-2.20190201-r1

Description

SELinux policy for bacula

Added to portage

2019-03-26

selinux-base - 2.20190201-r1
Ebuild name:

sec-policy/selinux-base-2.20190201-r1

Description

Gentoo base policy for SELinux

Added to portage

2019-03-26

skim - 0.6.4
Ebuild name:

app-misc/skim-0.6.4

Description

a command-line fuzzy finder

Added to portage

2019-03-26

thunderbird - 60.6.1
Ebuild name:

mail-client/thunderbird-60.6.1

Description

Thunderbird Mail Client

Added to portage

2019-03-26

thunderbird-bin - 60.6.1
Ebuild name:

mail-client/thunderbird-bin-60.6.1

Description

Thunderbird Mail Client

Added to portage

2019-03-26

vivaldi-snapshot - 2.4.1488.33_p1
Ebuild name:

www-client/vivaldi-snapshot-2.4.1488.33_p1

Description

A browser for our friends

Added to portage

2019-03-26

wayland - 1.17.0
Ebuild name:

dev-libs/wayland-1.17.0

Description

Wayland protocol libraries

Added to portage

2019-03-26

wpa_supplicant - 2.7-r3
Ebuild name:

net-wireless/wpa_supplicant-2.7-r3

Description

IEEE 802.1X/WPA supplicant for secure wireless transfers

Added to portage

2019-03-26

2019-03-25
baselayout-prefix - 2.6-r1
Ebuild name:

sys-apps/baselayout-prefix-2.6-r1

Description

Filesystem baselayout and init scripts

Added to portage

2019-03-25

btrbk - 0.27.1-r1
Ebuild name:

app-backup/btrbk-0.27.1-r1

Description

Tool for creating snapshots and remote backups of btrfs subvolumes

Added to portage

2019-03-25

burp - 2.1.32-r1
Ebuild name:

app-backup/burp-2.1.32-r1

Description

Network backup and restore client and server for Unix and Windows

Added to portage

2019-03-25

burp - 2.2.18
Ebuild name:

app-backup/burp-2.2.18

Description

Network backup and restore client and server for Unix and Windows

Added to portage

2019-03-25

ffmpeg - 4.1.2
Ebuild name:

media-video/ffmpeg-4.1.2

Description

Complete solution to record, convert and stream audio and video. Includes

Added to portage

2019-03-25

fontforge - 20190317-r2
Ebuild name:

media-gfx/fontforge-20190317-r2

Description

postscript font editor and converter

Added to portage

2019-03-25

gajim - 1.0.3
Ebuild name:

net-im/gajim-1.0.3

Description

Jabber client written in PyGTK

Added to portage

2019-03-25

gist - 5.0.0
Ebuild name:

dev-ruby/gist-5.0.0

Description

Potentially the best command line gister.

Added to portage

2019-03-25

git-sources - 5.1_rc2
Ebuild name:

sys-kernel/git-sources-5.1_rc2

Description

The very latest -git version of the Linux kernel

Added to portage

2019-03-25

glibc - 2.29-r1
Ebuild name:

sys-libs/glibc-2.29-r1

Description

GNU libc C library

Added to portage

2019-03-25

hugin - 2019.0.0_rc1
Ebuild name:

media-gfx/hugin-2019.0.0_rc1

Description

GUI for the creation & processing of panoramic images

Added to portage

2019-03-25

icingaweb2-module-director - 1.6.2
Ebuild name:

www-apps/icingaweb2-module-director-1.6.2

Description

Icinga Web 2 plugin for configuration

Added to portage

2019-03-25

jasper - 2.0.15-r1
Ebuild name:

media-libs/jasper-2.0.15-r1

Description

Implementation of the codec specified in the JPEG-2000 Part-1 standard

Added to portage

2019-03-25

jenkins-bin - 2.164.1
Ebuild name:

dev-util/jenkins-bin-2.164.1

Description

Extensible continuous integration server

Added to portage

2019-03-25

kdeconnect - 1.3.4
Ebuild name:

kde-misc/kdeconnect-1.3.4

Description

Adds communication between KDE Plasma and your smartphone

Added to portage

2019-03-25

kdesvn - 2.0.0-r1
Ebuild name:

dev-vcs/kdesvn-2.0.0-r1

Description

A frontend to the subversion vcs

Added to portage

2019-03-25

keepalived - 2.0.13-r1
Ebuild name:

sys-cluster/keepalived-2.0.13-r1

Description

A strong & robust keepalive facility to the Linux Virtual Server p

Added to portage

2019-03-25

kodi-inputstream-adaptive - 2.3.16
Ebuild name:

media-plugins/kodi-inputstream-adaptive-2.3.16

Description

Kodi's Adaptive inputstream addon

Added to portage

2019-03-25

ldb - 1.6.3
Ebuild name:

sys-libs/ldb-1.6.3

Description

An LDAP-like embedded database

Added to portage

2019-03-25

likwid - 4.3.3
Ebuild name:

sys-apps/likwid-4.3.3

Description

A performance-oriented tool suite for x86 multicore environments

Added to portage

2019-03-25

lsp-plugins - 1.1.7-r1
Ebuild name:

media-libs/lsp-plugins-1.1.7-r1

Description

Linux Studio Plugins

Added to portage

2019-03-25

lua - 5.2.4-r1
Ebuild name:

dev-lang/lua-5.2.4-r1

Description

A powerful light-weight programming language designed for extending applicati

Added to portage

2019-03-25

lua - 5.3.5-r1
Ebuild name:

dev-lang/lua-5.3.5-r1

Description

A powerful light-weight programming language designed for extending applicati

Added to portage

2019-03-25

moneta - 1.1.0
Ebuild name:

dev-ruby/moneta-1.1.0

Description

A unified interface to key/value stores

Added to portage

2019-03-25

nano - 4.0
Ebuild name:

app-editors/nano-4.0

Description

GNU GPL'd Pico clone with more functionality

Added to portage

2019-03-25

nzbget - 21.0_pre2302
Ebuild name:

net-nntp/nzbget-21.0_pre2302

Description

A command-line based binary newsgrabber supporting .nzb files

Added to portage

2019-03-25

parallel - 1.15.0
Ebuild name:

dev-ruby/parallel-1.15.0

Description

Run any code in parallel Processes or Threads

Added to portage

2019-03-25

plasma-applet-network-monitor - 1.7.3-r1
Ebuild name:

kde-misc/plasma-applet-network-monitor-1.7.3-r1

Description

Plasma 5 applet for monitoring active network conne

Added to portage

2019-03-25

plasma-redshift-control - 1.0.18-r1
Ebuild name:

kde-misc/plasma-redshift-control-1.0.18-r1

Description

Plasma 5 applet for controlling redshift

Added to portage

2019-03-25

prefix-toolkit - 0
Ebuild name:

app-portage/prefix-toolkit-0

Description

Utilities for users of Gentoo Prefix

Added to portage

2019-03-25

raspberrypi-firmware - 1.20190215
Ebuild name:

sys-boot/raspberrypi-firmware-1.20190215

Description

Raspberry Pi (all versions) bootloader and GPU firmware

Added to portage

2019-03-25

raspberrypi-image - 4.14.98_p20190215
Ebuild name:

sys-kernel/raspberrypi-image-4.14.98_p20190215

Description

Raspberry Pi (all versions) kernel and modules

Added to portage

2019-03-25

sqlitebrowser - 3.11.1-r1
Ebuild name:

dev-db/sqlitebrowser-3.11.1-r1

Description

SQLite Database Browser

Added to portage

2019-03-25

talloc - 2.2.0
Ebuild name:

sys-libs/talloc-2.2.0

Description

Samba talloc library

Added to portage

2019-03-25

tdb - 1.4.0
Ebuild name:

sys-libs/tdb-1.4.0

Description

A simple database API

Added to portage

2019-03-25

telegram-desktop-bin - 1.6.2
Ebuild name:

net-im/telegram-desktop-bin-1.6.2

Description

Official desktop client for Telegram (binary package)

Added to portage

2019-03-25

tevent - 0.10.0
Ebuild name:

sys-libs/tevent-0.10.0

Description

Samba tevent library

Added to portage

2019-03-25

tmux - 2.8-r2
Ebuild name:

app-misc/tmux-2.8-r2

Description

Terminal multiplexer

Added to portage

2019-03-25

vivaldi-snapshot - 2.4.1488.29_p1
Ebuild name:

www-client/vivaldi-snapshot-2.4.1488.29_p1

Description

A browser for our friends

Added to portage

2019-03-25

xcompmgr - 1.1.8
Ebuild name:

x11-misc/xcompmgr-1.1.8

Description

X Compositing manager

Added to portage

2019-03-25

xen - 4.10.3-r1
Ebuild name:

app-emulation/xen-4.10.3-r1

Description

The Xen virtual machine monitor

Added to portage

2019-03-25

xfce4-weather-plugin - 0.8.11
Ebuild name:

xfce-extra/xfce4-weather-plugin-0.8.11

Description

A weather plug-in for the Xfce desktop environment

Added to portage

2019-03-25

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