当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 5 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 请问大家有谁用过preload??该如何使用??召唤大神~!!!
帖子发表于 : 2013-04-10 23:48 

注册: 2013-04-04 9:50
帖子: 8
系统: Ubuntu12.10
送出感谢: 0 次
接收感谢: 0 次
我十分喜欢eclipse,但是eclipse打开太慢了,所以我想如果再开机时就把eclipse加载到内存里,牺牲一点开机时间来换取eclipse的打开速度。 :em20
最后我搜到了一个名叫“preload”的软件,它能够实现将常用的系统库和程序“预载”到内存中从而实现加速启动程序的功能。 :em03
可是琢磨了好久也不知到怎么用preload把eclipse预载到内存中。 :em06
希望能够有大神多多指教~!!! :em11

下面是关于proload的一些资料供大家参考~!!
=============================
Preload 是一个自适应预读守护进程。它监控用户运行的应用程序,并且分析这些数据,预测用户可能运行的程序,并读取这些程序的二进制文件及其依赖文件到系统内存,以达到加速启动的时间。
Drastically Speed up your Linux System with Preload:
http://techthrob.com/2009/03/02/drastically-speed-up-your-linux-system-with-preload/
---------------------------------------------------------
preload的配置文件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 may reduce 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) + CACHED * 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: 50
#
memfree = 50

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


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

[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 want to temporarily 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 want to temporarily
# 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.
#
# Note that /lib matches all of /lib, /lib64, and even /libexec if
# there was one. If one really meant /lib only, they should use
# /lib/ instead.
#
# default: (empty list, accept all)
mapprefix = /usr/;/lib;/var/cache/;!/

# 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/;!/

# maxprocs
#
# Maximum number of processes to use to do parallel readahead. If
# equal to 0, no parallel processing is done and all readahead is
# done in-process. Parallel readahead supposedly gives a better I/O
# performance as it allows the kernel to batch several I/O requests
# of nearby blocks.
#
# default: 30
processes = 30

# sortstrategy
#
# The I/O sorting strategy. Ideally this should be automatically
# decided, but it's not currently. One of:
#
# 0 -- SORT_NONE: No I/O sorting.
# Useful on Flash memory for example.
# 1 -- SORT_PATH: Sort based on file path only.
# Useful for network filesystems.
# 2 -- SORT_INODE: Sort based on inode number.
# Does less house-keeping I/O than the next option.
# 3 -- SORT_BLOCK: Sort I/O based on disk block. Most sophisticated.
# And useful for most Linux filesystems.
#
# default: 3
sortstrategy = 3
--------------------------------------------------------------------------


页首
 用户资料  
 
2 楼 
 文章标题 : Re: 请问大家有谁用过preload??该如何使用??召唤大神~!!!
帖子发表于 : 2013-04-10 23:51 

注册: 2013-04-04 9:50
帖子: 8
系统: Ubuntu12.10
送出感谢: 0 次
接收感谢: 0 次
preload的man文档
###############################################
PRELOAD(8) System Administration Utilities PRELOAD(8)



NAME
preload - Adaptive readahead daemon

SYNOPSIS
preload [OPTION]...

DESCRIPTION
preload is an adaptive readahead daemon that prefetches files mapped by
applications from the disk to reduce application startup time.

-h, --help
Display command line parameters and their default values, and
exit.

-v, --version
Display version information and exit.

-c, --conffile
Set configuration file. Empty string means no conf file.
(default is /etc/preload.conf)

-s, --statefile
Set state file to load/save. Empty string means no state.
(default is /var/lib/preload/preload.state)

-l, --logfile
Set log file. Empty string means to log to stderr. (default is
/var/log/preload.log)

-f, --foreground
Run in foreground, do not daemonize.

-n, --nice
Nice level. (default is 15)

-V, --verbose
Set the verbosity level. Levels 0 to 10 are recognized.
(default is 4)

-d, --debug
Debug mode: --logfile '' --foreground --verbose 9

SIGNALS
On receipt of a SIGHUP, the daemon will close and reopen its log file,
and reread the configuratoin file.

On receipt of a SIGUSR1, the daemon dumps the currently loaded configu‐
ration into the log file.

On receipt of a SIGUSR2, the daemon saves its state into the state
file.

AUTHOR
Written by Behdad Esfahbod <behdad@gnu.org>

REPORTING BUGS
Report bugs to <http://preload.sf.net/bug>

COPYRIGHT
Copyright © 2005,2006,2007,2008 Behdad Esfahbod.
This is free software; see the source for copying conditions. There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.



preload 0.6.4 May 2012 PRELOAD(8)


页首
 用户资料  
 
3 楼 
 文章标题 : Re: 请问大家有谁用过preload??该如何使用??召唤大神~!!!
帖子发表于 : 2013-04-10 23:55 
头像

注册: 2005-08-14 21:55
帖子: 58428
地址: 长沙
送出感谢: 4
接收感谢: 274
支持折腾。很早前试过,没出效果。现在,说不定这机制过时了哦。


_________________
● 鸣学


页首
 用户资料  
 
4 楼 
 文章标题 : Re: 请问大家有谁用过preload??该如何使用??召唤大神~!!!
帖子发表于 : 2013-04-11 0:06 

注册: 2013-04-04 9:50
帖子: 8
系统: Ubuntu12.10
送出感谢: 0 次
接收感谢: 0 次
eexpress 写道:
支持折腾。很早前试过,没出效果。现在,说不定这机制过时了哦。

不会吧?那现在是通过什么那加速程序启动呢??能否给俺推荐一个方案??


页首
 用户资料  
 
5 楼 
 文章标题 : Re: 请问大家有谁用过preload??该如何使用??召唤大神~!!!
帖子发表于 : 2013-10-07 6:56 

注册: 2013-10-07 5:23
帖子: 2
系统: debian testing
送出感谢: 0 次
接收感谢: 0 次
閣下可能要換個方式了,像是把eclipse移到SSD硬碟,或者改用oracle閉源的JVM試試
使用preload不須刻意做載入動作,它的原理是在背景紀錄,系統平時有在運作的程式,當開機時preload服務啟動後會預先將他們載入記憶體,但是這其中只包括可執行檔和動態函式庫(*.so),eclipse標準版有著滿滿一堆bytecode,preload頂多只能幫你預載jvm,效果微不足道...

cycle=20 #每20秒紀錄一次,紀錄資料會儲存在/var/lib/preload/preload.state,現在就可以看看eclipse或java相關檔案有沒有在裡面

註:preload預設值非常保守,若你平時用的程式種類多,可能連java都不會預載...


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 5 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 1 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译