可以使用 ureadahead 来缓存经常使用的程序吗?

可以使用 ureadahead 来缓存经常使用的程序吗?

编辑我在以下帮助下回答了我的问题剩下的唯一问题是如何让更改永久保留在包文件中,而不会在重新配置时丢失。如果有人知道方法,我会留下这个问题(然后我会接受它作为答案)。/编辑

我在启动后以非常相似的方式使用我的 PC:我大部分时间都在使用 evince、chromium-browser、gmpc 和 gpodder。现在我想使用 ureadahead 缓存这些程序(如果需要,会以牺牲启动时间为代价)。

现在我像这样查看了 ureadahead 包的内容sudo ureadahead --dump|grep chromium,发现只有图标、.dekstop 文件和 gconf 键需要缓存*。

所以我想知道是否有办法让 ureadahead 缓存我最常用的程序的二进制文件和库,并让它们在启动后立即打开。

*据我所知,ureadahead 实际上并不缓存,而是保存文件列表并按 inode 对其进行排序,从而优化访问模式,但是……

答案1

或许

嗯 - 也许预加载就是你正在查看的应用程序

:~$ apt-cache show preload

Description: adaptive readahead daemon
 preload monitors applications that users run, and by analyzing this
 data, predicts what applications users might run, and fetches those
 binaries and their dependencies into memory for faster startup times.
 .
 Note that installing preload will not make your system boot faster
 and that preload is a daemon that runs with root priviledges.

Homepage: http://sourceforge.net/projects/preload

一些链接

http://www.cyberciti.biz/tips/speed-up-your-linux-system.html

http://www.howtoforge.com/speed-up-your-system-with-preload-on-ubuntu-9.04

答案2

我让它工作了感谢,但这不是一个完美的解决方案:

  • 根据您的启动时间将(最后一行)pre-stop exec sleep中的超时时间设置为更大的值(我使用了秒)。/etc/init/ureadahead.conf80
  • 将您想要缓存的程序放入自动启动中;对我来说,那是 totem gedit evince 和 gpodder。为了方便起见,我添加了前缀 URA,以便以后更容易找到它们并禁用它们(即 URA totem、URA gedit 等)。
  • 删除旧的包文件sudo rm /var/lib/ureadahead/*.pack并重新启动。

工作正常。这种方法的问题在于,每次 ureadahead 重新配置时,您很可能必须再次执行此操作。

相关内容