安装 Vmtouch
- $ git clone https://github.com/hoytech/vmtouch
- $ cd vmtouch
- $ make
- $ sudo make install
使用 Vmtouch
- vmtouch 命令语法
- $ vmtouch
- vmtouch: no files or directories specified
- vmtouch v1.0.2 - the Virtual Memory Toucher by Doug Hoyte
- Portable file system cache diagnostics and control
- Usage: vmtouch [OPTIONS] ... FILES OR DIRECTORIES ...
- Options:
- -t touch pages into memory
- -e evict pages from memory
- -l lock pages in physical memory with mlock(2)
- -L lock pages in physical memory with mlockall(2)
- -d daemon mode
- -m max file size to touch
- -p use the specified portion instead of the entire file
- -f follow symbolic links
- -h also count hardlinked copies
- -w wait until all pages are locked (only useful together with -d)
- -v verbose
- -q quiet
2. 一些使用的例子
由于 vmtouch 直接支持目录级查询,所以使用起来简单得多了。
- $ vmtouch /tmp/
- vmtouch: WARNING: skipping non-regular file: /tmp/ssh-GgJnCEkWMQC2/agent.1068
- Files: 17
- Directories: 7
- Resident Pages: 4780/4780 18M/18M 100%
- Elapsed: 0.001006 seconds
(编辑:惠州站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|