`

使用Preload 给Ubuntu系统加速

阅读更多
本教程旨在说明如何在 Ubuntu 9.04 系统上安装 Preload ,并使用它为系统提速。Preload 是一个自适应预读守护进程。它监控用户运行的应用程序,并且分析这些数据,预测用户可能运行的程序,并读取这些程序的二进制文件及其依赖文件到系统内存,以达到加速启动的时间。

本文当不做任何形式的担保!我不保证它能在你的系统上正常工作!

安装 Preload

要安装 Preload ,首先打开终端 (应用程序/附件/终端),然后输入:

sudo aptitude install preload

来安装 Preload 。

安装完成。Preload 将在后台静静运行。如果你想改变 Preload 的行为,你可以编辑它的配置文件 /etc/preload.conf 。这是它的默认配置:

sudo gedit /etc/preload.conf

[model]

# cycle:
#
# This is the quantum of time for preload. Preload performs
# data gathering and predictions every cycle. Use an even
# number.
#
# Note: Setting this parameter too low will may reduce the
# system performance and stability.
#
# unit: seconds
# default: 20
#
cycle = 20

# usecorrelation:
#
# Whether correlation coefficient should be used in the prediction
# algorithm. There are arguments both for and against using it.
# Currently it’s believed that using it results in more accurate
# prediction. The option may be removed in the future.
#
# default: true
usecorrelation = true

# minsize:
#
# Minimum sum of the length of maps of the process for
# preload to consider tracking the application.
#
# Note: Setting this parameter too high will make preload less
# effective, while setting it too low will make it eat
# quadratically more resources, as it tracks more processes.
#
# unit: bytes
# default: 2000000
#
minsize = 2000000

#
# The following control how much memory preload is allowed to use
# for preloading in each cycle. All values are percentages and are
# clamped to -100 to 100.
#
# The total memory preload uses for prefetching is then computed using
# the following formulae:
#
# max (0, TOTAL * memtotal + FREE * memfree) + CHACED * memcached
# where TOTAL, FREE, and CACHED are the respective values read at
# runtime from /proc/meminfo.
#

# memtotal: precentage of total memory
#
# unit: signed_integer_percent
# default: -10
#
memtotal = -10

# memfree: precentage of free memory
#
# unit: signed_integer_percent
# default: 100
#
memfree = 100

# memcached: precentage of cached memory
#
# unit: signed_integer_percent
# default: 30
#
memcached = 30

###########################################################################

[system]

# doscan:
#
# Whether preload should monitor running processes and update its
# model state. Normally you do want that, that’s all preload is
# about, but you may temporarily want to turn it off for various
# reasons like testing and only make predictions. Note that if
# scanning is off, predictions are made based on whatever processes
# have been running when preload started and the list of running
# processes is not updated at all.
#
# default: true
doscan = true

# dopredict:
#
# Whether preload should make prediction and prefetch anything off
# the disk. Quite like doscan, you normally want that, that’s the
# other half of what preload is about, but you may temporarily want
# to turn it off, to only train the model for example. Note that
# this allows you to turn scan/predict or or off on the fly, by
# modifying the config file and signalling the daemon.
#
# default: true
dopredict = true

# autosave:
#
# Preload will automatically save the state to disk every
# autosave period. This is only relevant if doscan is set to true.
# Note that some janitory work on the model, like removing entries
# for files that no longer exist happen at state save time. So,
# turning off autosave completely is not advised.
#
# unit: seconds
# default: 3600
#
autosave = 3600

# mapprefix:
#
# A list of path prefixes that controll which mapped file are to
# be considered by preload and which not. The list items are
# separated by semicolons. Matching will be stopped as soon as
# the first item is matched. For each item, if item appears at
# the beginning of the path of the file, then a match occurs, and
# the file is accepted. If on the other hand, the item has a
# exclamation mark as its first character, then the rest of the
# item is considered, and if a match happens, the file is rejected.
# For example a value of !/lib/modules;/ means that every file other
# than those in /lib/modules should be accepted. In this case, the
# trailing item can be removed, since if no match occurs, the file is
# accepted. It’s advised to make sure /dev is rejected, since
# preload doesn’t special-handle device files internally.
#
# default: (empty list, accept all)
mapprefix = /usr;/lib;!/

# exeprefix:
#
# The syntax for this is exactly the same as for mapprefix. The only
# difference is that this is used to accept or reject binary exectuable
# files instead of maps.
#
# default: (empty list, accept all)
exeprefix = !/usr/sbin;!/usr/local/sbin;/usr;!/

如果你更改了配置,你需要重启 Preload :

sudo /etc/init.d/preload restart


本文来自:http://huzuofeiwei.com/2009/07/speed-up-your-system-with-preload-on-ubuntu-904.html
分享到:
评论

相关推荐

    Android API Hook之LD_PRELOAD

    Android平台虽然有其特定的开发模式,但因为它底层是Linux,所以也能够使用Linux上的某些Hook技术,比如本文将要探讨的LD_PRELOAD。 LD_PRELOAD是Linux下的一个环境变量,它能够在程序运行时动态地加载指定的动态...

    使用LD_PRELOAD注入程序.pdf

    LD_PRELOAD是Linux系统中用于程序运行时链接的一个环境变量,它可以在程序执行前动态地加载指定的共享库。LD_PRELOAD机制可以覆盖指定的库函数,这在很多情况下可以用于修改程序的行为,比如调试、性能监控、安全...

    Linux操作系统文件监控-PRELOAD

    Linux操作系统文件监控-PRELOAD是一种安全技术和方法,用于在Linux环境下深入洞察应用程序对文件系统的访问行为。通过利用PRELOAD技术,系统管理员可以监控并记录应用层的文件操作,以提高系统的安全性和防护能力。 ...

    Preload基础使用方法详解

    【preload 基础使用方法详解】 preload 是一种优化网页加载性能的技术,它允许开发者提前声明需要加载的资源,使得浏览器在用户实际交互前就开始下载这些资源。这样,当资源实际被使用时,由于已经部分或完全加载,...

    preload 大冒险.7z

    这个7z压缩包文件可能包含了相关的代码示例、教程文档或者演示页面,帮助学习者了解和掌握“preload”的使用技巧。 “preload”关键字通常用在HTML的`<link>`标签中,如: ```html <link rel="preload" href=...

    vue-preload-用于添加的插件Vue-Vue.js开发

    演示使用vue-ssr-boilerplate安装npm install vue-link-preload --save用法import从'vue-link-preload'预加载Vue.use(Preload)//动态添加单个项目//默认情况下为'script'类型被分配了Vue.addPreloadLink('...

    ELS-N04_hw_la_R2-C605_PRELOAD-10.1.0.1_ReleaseNotes

    该版本基于Android 10.x操作系统,EMUI版本为EMUI 10.1.0。 应用版本 该版本中包含了多个应用程序的更新,包括AliExpress 8.4.0、Microsoft Bing 10.8、Microsoft News 19.331.05、Microsoft Office 16.0.12026、...

    libstdc++.so.6.0.26.zip

    - 检查当前系统的`libstdc++.so.6`版本,可以使用命令`ldd --version`或`strings /usr/lib*/libstdc++.so.6 | grep CXXABI`。 - 如果版本低于1.3.8,可以尝试通过包管理器(如`apt-get` for Debian/Ubuntu, `yum` ...

    PreLoad一个图像预加载插件以实现有序加载和无序加载

    在实际使用 preload-master 压缩包时,开发者需要根据项目需求进行以下步骤: 1. **引入 PreLoad 插件**:将预加载插件的 JavaScript 文件引入到 HTML 页面中,通常是通过 `<script>` 标签。 2. **配置和初始化**...

    PRELOAD:LD_PRELOAD rootkit实用程序

    在IT领域,`PRELOAD`技术是一种高级技巧,主要用于改变程序的行为。这里的"PRELOAD:LD_PRELOAD rootkit实用程序"是指利用`LD_PRELOAD`...同时,了解如何安全地使用和防范`LD_PRELOAD` rootkit也是保护系统安全的关键。

    seajs-preload.js

    用于seajs的预加载使用,有需要的小伙伴可以免费下载使用。方便大家多多分享免费的资源,有问题随时给我们留言。希望能帮助大家解决更多的问题

    link rel=preload.zip

    通过合理使用`<link rel="preload">`,开发者可以更精细地控制资源加载的顺序和时机,从而优化整个网站的性能。然而,需要注意的是,预加载并不适用于所有资源,只有当资源对页面的初期渲染至关重要时,才应考虑使用...

    preload.js图片预加载插件

    图片预加载插件。包含有序加载和无序加载两种。具体使用方法,参考https://blog.csdn.net/yang1393214887/article/details/92582715

    网站顶部显示预加载进度条插件preload.js

    为了实现这个进度条,`preload.js`可能通过监听`fetch`事件或者使用`Resource Timing API`来跟踪每个资源的加载状态。然后,基于这些信息,插件更新进度条的显示,确保其准确反映当前的加载进度。 在使用`preload....

    基于LD-PRELOAD的文件系统管理 (2010年)

    针对文件系统日渐显著的复杂性,提出要对复杂文件系统进行管理以优化应用程序对文件系统的访问,改善文件系统的性能,基于LD-PRELOAD技术设计并实现了一种用于文件管理系统的轻量级方法,并阐述和分析了该方法的关键...

    free_checker:使用LD_PRELOAD的简单内存泄漏查找程序(用于C程序)

    - 使用 `LD_PRELOAD` 可能会影响到其他库的正常工作,因此在生产环境中谨慎使用。 通过 `free_checker`,程序员可以快速定位并修复C语言程序中的内存泄漏问题,提升程序的健壮性和效率。同时,理解`LD_PRELOAD`的...

Global site tag (gtag.js) - Google Analytics