楼主可能把这个方法 apply 到他的个人数据所在目录了
 
--
Justin Wong
 
 
 
On Fri, May 6, 2016, at 18:01, Wang Shanker wrote:
> 这个博客只是删掉了 /usr/src 啊,似乎没啥问题
>
> 本邮件具有数字签名,敬请核对。
> 王邈 清华大学计算机科学与技术系 电话:+86 130-5186-7712
> 通信地址:北京市海淀区清华大学紫荆公寓2号楼307A 100084
>
> Please verify the digital signature attached with the e-mail. Miao
> Wang Department of Computer Science and Technology, Tsinghua
> University Tel.: +86 130-5186-7712 Add.: Room 307A, No.2 Zijing
> Building, Tsinghua University, Peking. P.R.C. 100084
>
>> 在 2016年5月6日,16:41,1391509153 <[email protected]> 写道:
>>
>> tuna各位技术大牛们,我是自动化一名小硕,平时较少用linux。今天在组里服务器跑程序时inodes满了,于是Google了一下,按照-
>> 这个博客的操作
>> http://blog.gdsyzx.edu.cn/sense/?p=2329,现在服务器上好像什么都没有了,求问这种情况我的数据还有救吗?具体怎么恢复你?
>>
>>
>>
>> Best Regards,
>> Chen
>>
>>
>>
>>> *发件人:*Justin Wong <[email protected]>
>>> *发送时间:*2016-05-04 10:10
>>> *主题:*[tuna-general] Re: [USTC-LUG] 一种减轻 mirrors rsync 副作用的思路
>>> *收件人:*"Ray Song"<[email protected]>
>>> *抄送:*"tuna-general"<tuna-
>>> [email protected]>,"ustc_lug"<[email protected]>
>>>
>>> 应该是这个逻辑,其实可以把limit_in_bytes放宽松一些,rsync 本身占不了多少内存,但是对cache的消耗非常大。
>>>
>>> --
>>> Justin Wong
>>>
>>> On Wed, May 4, 2016, at 00:58, Ray Song wrote:
>>> >似乎是因为 memory.limit_in_bytes 限制物理内存
>>> >在应用程序申请的内存和 buffer cache 总和超过限制的情况下,会把超出的弄到 swap
>>> >buffer cache就直接丢弃了?
>>> >
>>> >
>>> >
>>> >On 2016-05-04, Justin Wong wrote:
>>> >>以前在 ustc 邮件列表看到过 mirrors 磁盘缓存几乎无效的问题,其中一个主要原因是 rsync
>>> >一遍就扫一遍磁盘,cache 全废了。
>>> >>
>>> >>今天看到一个叫 nocache 的工具 https://github.com/Feh/nocache 可以禁止某个进程使用
>>> >>cache,进而发现除了 nocache 还有一些方案可以考虑。
>>> >>
>>> >>一个是最暴力的方式是直接使用 cgroup 限制 rsync 的内存。我测了一下,效果拔群
>>> >>
>>> >>```
>>> >>cgcreate -g memory:cptest
>>> >>cgset -r memory.limit_in_bytes=20M cptest  # 创建个 cgroup
>>> >并限制内存使用为 20MB
>>> >>dd if=/dev/zero of=test bs=1M count=2048   # 创建个2G的文件
>>> >>echo 3 > /proc/sys/vm/drop_caches              # 把已有的 cache
>>> >drop 掉,这时
>>> >>free -m 应该看见 cache 的量很小了
>>> >>
>>> >>cgexec -g memory:cptest cp test test 1         # 在 cgroup
>>> >中复制一遍 test
>>> >>/nocache/cachestats ./test1                            # 用 nocache
>>> >>提供的工具看一下 cache 情况,几乎没有被任何 cache
>>> >>> pages in cache: 1175/524288 (0.2%)  [filesize=2097152.0K,
>>> >pagesize=4K]
>>> >>
>>> >># 然后直接跑 cp,再用 cachestats 看一下
>>> >>cp test test1
>>> >>nocache/cachestats ./test1
>>> >>> pages in cache: 524288/524288 (100.0%)  [filesize=2097152.0K,
>>> >pagesize=4K]
>>> >># 全被 cache 住了
>>> >>```
>>> >>
>>> >>还有就是 http://insights.oetiker.ch/linux/fadvise.html 这个地方提供了一个
>>> >rsync 的
>>> >>patch,使用 fadvice 让 rsync 尽量不使用 cache。
>>> >>
>>> >>感觉解决了一个老大难问题啊。
>>> >>
>>> >>--
>>> >>Justin Wong
>>> >>
>>> >>--
>>> >>来自USTC LUG
>>> >>请使用gmail订阅,不要灌水。
>>> >>更多信息more info:http://groups.google.com/group/ustc_lug?hl=en?hl=en
>>> >>---
>>> >>You received this message because you are subscribed to the Google
>>> >Groups "USTC_LUG" group.
>>> >>To unsubscribe from this group and stop receiving emails from it,
>>> >send an email to [email protected].
>>> >>For more options, visit https://groups.google.com/d/optout.
>>> >
>>> >--
>>> >Ray
>>> >http://maskray.me[1]
>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "TUNA 主邮件列表" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "TUNA 主邮件列表" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to [email protected].
>> To post to this group, send email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
>  ---
>  You received this message because you are subscribed to the Google
>  Groups "TUNA 主邮件列表" group.
>  To unsubscribe from this group and stop receiving emails from it,
>  send an email to [email protected].
>  To post to this group, send email to [email protected].
>  For more options, visit https://groups.google.com/d/optout.
>
> Email had 1 attachment:


>  * smime.p7s  6k (application/pkcs7-signature)
 

Links:

  1. http://maskray.me/

-- 

--- 
You received this message because you are subscribed to the Google Groups "TUNA 
主邮件列表" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

回复