被浏览器wwW38vz否定怎么处理,还是当初的38vzcom那网占嘛

衣柜如何收纳,能更简洁而且不容易乱?衣柜如何收纳,能更简洁而且不容易乱?小派爱家居百家号答|百度派 @残雪月白是否分类归纳?答案是肯定的。我必须对它进行分类以得到它的排序。同一类衣服的衣服先分类,后整理后,再分开来进行收纳,地方会比较清楚,也很容易找。有少的壁橱,它可以用来收集盒子,包括但不限于销售盒子或普通硬纸箱或DIY盒,做物理分区。例如,衣柜最底层的一个盒子(不需要买到盒子,这个盒子一般大小合适的压纸盒)放上当季的衣服,堆放在一个收到季节的衣服盒上。例如,衣柜的顶层,就像一本书一样,直立着,处于一种视觉状态。将材料、大小和袋子与一个相似的频率组合在一起。基本上,一个袋子装满了两个袋子。把你的手从袋子里拿出来,把它们装进垃圾袋,或者袋子。例如,在壁橱或壁橱门的中间放一个挂盒/袋/盒子。挂,拿衣服悬挂-接收小物件例如,壁橱空间很大,没有其他的层,简单而容易地把方舟直接放进衣橱里,或者你可以把它移到底部当然,你也可以用纸箱做DIY。如何解决问题的问题是找一件衣服找不到痛苦?首先,应该划分为季节,衣服在季节不被收集,衣服被放置在不容易接近的位置,比如衣柜的顶部和底部,衣服放在一个方便的位置。按类别分类,每个类别最多有3个类。比如:所有的袜子类(长袜、短袜的左边),所有的裙子类型(裙子,裙子,女衫,实际上可以挂起来),所有的裤子都有广泛的种类(裤子,短裤)等等。展示:服装在季节的选择被放在展示。按顺序排好。一定要叠好衣服,要有一个图式,当折叠时要把一些衣服的特征,典型的折叠到外面的顶部,比如某个图案的衣服,标志性的纽扣等等。在盒子外面做一个基本记号。最好的办法是制作一个表格并给它贴上标签。在确定衣服的位置之后,用它来形成把它放回原位的习惯。就像机器需要维护一样,良好的个人卫生习惯每天都要洗刷牙齿和刷牙,并且需要定期整理衣柜。扔掉没用过的东西,留下使用。整洁有规划,学会适时的丢弃。以上内容由百度派作者提供本文由百家号作者上传并发布,百家号仅提供信息发布平台。文章仅代表作者个人观点,不代表百度立场。未经作者许可,不得转载。小派爱家居百家号最近更新:简介:百度旗下高质量问答讨论社区作者最新文章相关文章1.5K35 条评论分享收藏感谢收起appledaily.com.tw/realtimenews/article/new/791/)听说最近这个抄袭设计师的母校的学们给他设置了灵位游街示众来表达对他带坏母校设计系口碑的不满。对此我只能说,犯错就要认,挨打要站好,早知今日,何必当初呢?别人的插画、照片放网上不是给你拿来抠个图加两行字就用的好吗???????
你以为拍摄、画图不需要大量的构思和时间吗??
你看完了别人的作品,照着做了一张80%都一样的,就别说是原创好吗???
你的海报里除了排版是自己做的,其他的东西都是别人的就别拿来赚钱好吗?自己把自己当美工,真怪不了别人。我以前也犯过这样的错误,不过现在已经有了这个警惕性。设计师应该要有这个敏感度好吗。那么初学者该怎么做呢?我分享下我的想法吧你可以模仿,比如你觉得这个字型很好看,你也可以按照这个风格,自己做个有点类似的别的字。
或者你觉得这个海报颜色好看,那你可以颜色用类似的。借鉴别人的东西可以,但是最好别借鉴太多,最好要有自己的东西。如果字、颜色、排版等等全部都模仿另外一张海报,那离抄袭就不远了。而且你也要知道,模仿的东西终究是别人的,你如果对一张海报该怎么开始做没有自己的想法,不明白为什么被模仿的人要这么做,下一次做你还是没想法,又要去模仿别人的。(以下引用的图片有的作者我记不得了,侵删侵删)1。文字造型
做平面设计基础中的基础了,無論是做CI 海報 包裝 都要用到。字体设计是大学问,中英文都要学好才能应对各种情况。中文文字造型做的海報。作者:曾國展(我的小男神)文字造型在海报中的运用。注意「菱镜色散」这几个字的表现文字造型在海报中的运用2。將標準字做成了立體的,恰當呈現了「實境秀」的感覺。文字造型在海报中的运用2。那個「處」字這麼可愛也太犯規了&&文字造型与影像的结合。作者曾国展文字造型在包装中的应用。文字造型在书籍设计上的应用。作者王志宏文字造型在书籍设计中的运用。作者何庭安52届金马奖海报。好喜欢这次的设计,干净庄重典雅大气。下面这个我也特别喜欢,用很多老字体剪贴组成的新设计。来自:广煜来张英文文字造型吧。大都会博物馆的新logo。再来张英文的吧,唱片包装。作者把籃球比賽的元素與標準字結合。不多也不少,用的剛剛好。作者补充张有历史的吧,陈之佛设计的「小說月報」,1927年。90年前人家就已经设计得这么出色了,是不是觉得21世纪的自己太naive哈哈。2。排版阅读的动线什么样,第一眼、第二眼分别是看到什么?内容有几个层级?中英文各选什么字型?什么字型和什么字型搭配?字号选多大?版面是否均衡?王志宏海報一張。對我來說,這張海報第一眼我看的「ARAKI」幾個字母,然後是低頭女子照片與「荒木經惟寫真……」并列为第二层级,然后是「self life death」。最不重要的信息他用很小号的字放在了最下面。英文「ARAKI」字體是比較现代、锐利且干净的DIDOT,中文「荒木經惟寫真」字體是有日本味道的小冢明朝Kozuka Mincho Pro B,英文「self life death」和「3.29 sun」的字體是比较柔和、优雅、有复古诗意的Garamond。如果把这些字体都换成其他字体,绝不会又这种感觉。3。色彩計劃4。質感/效果(待填)「插画」的運用萌又親切又腦洞大的插畫,跟療愈太搭了。作者Houth插画的运用之二。作者Houth插画运用之三。大师Seymour Chwast设计的弗洛伊德“”海报。熟悉精神分析的应该都知道花、蛇都是弗洛伊德理论里面常出现的元素。我个人十分十分喜欢这幅插画海报。marian nowinsk 反对智利出版审查的海报「影像」的運用影像總是能夠比較容易地達到插畫無法達到的衝擊力。運用一些方式讓本應真實的影像帶點超現實感,衝擊力又更大了。一樣是超現實style的影像合成。岡特蘭堡給fischer出版社設計的海報。「特殊技法」的運用下面的這張海報主視覺的這個「球」,首先是用相機拍攝了數次真實肥皂泡的樣子再進行的PS,背景應該是三維建模。下面這張海報的主視覺是實際模擬土耳其浮水染技法先進行繪畫,再進行拍攝,再進行影像處理。這張,主視覺一樣是用的三維建模。標準字也同樣非常出色(星星眼)。这张海报另外值得注意的是它的长条形状和比例,显而易见这张如果放在一堆A1的海报中会多么的特立独行而显眼。没人规定海报非得按1:1.414的黄金比例来吧?再黄金的东西用多了也会变成庸俗乏味的cliche,没办法人就是这样喜欢新鲜的东西啊(攤手)。直接在人臉上作畫,衝擊力比電腦ps出來的大多了。海報其實可以做的腦洞很大,不是只有電腦一種工具。作者李根在最近又看到一组特别喜欢的设计,来自partee design还有这组用橡皮泥纹理做的,简直喜欢死了,一看到这个简直童心泛滥,想起了小时候揉幾塊錢一盒的橡皮泥的感觉。特别喜欢这种能够将乐趣融入里面的设计。也是来自partee design又看到了特别特别喜欢的作品,应该是数码印刷到布料上再拍摄再后期的。来自:薄荷设计( 剩下的之後有灵感不定期更新,只收藏不赞的请看着我的眼睛!!!π_π)赞同 1.1K41 条评论分享收藏感谢收起404 Not Found
404 Not Found
The requested URL was not found on this server.
您要找的内容已被删除24K1,165 条评论分享收藏感谢收起赞同 3K55 条评论分享收藏感谢收起Table of Contents
1.1 proc filesystem
1.1.1 /proc
1.1.1.1 /proc/meminfo
系统中关于当前内存的利用状况等的信息,常由free命令使用;可以使用文件查看命令直接读取此文件,其内容显示为两列,前者为统计属性,后者为对应的值;
[dirlt@umeng-ubuntu-pc] & cat /proc/meminfo
3960316 kB
SwapCached:
2484752 kB
1016724 kB
Active(anon):
2280636 kB
Inactive(anon):
Active(file):
Inactive(file):
Unevictable:
SwapTotal:
4103164 kB
2678984 kB
Writeback:
AnonPages:
2629544 kB
SReclaimable:
SUnreclaim:
KernelStack:
PageTables:
NFS_Unstable:
WritebackTmp:
CommitLimit:
6083320 kB
Committed_AS:
7203968 kB
VmallocTotal:
VmallocUsed:
VmallocChunk:
HardwareCorrupted:
AnonHugePages:
HugePages_Total:
HugePages_Free:
HugePages_Rsvd:
HugePages_Surp:
Hugepagesize:
DirectMap4k:
DirectMap2M:
4052992 kB
1.1.1.2 /proc/stat
实时追踪自系统上次启动以来的多种统计信息;如下所示,其中,
“cpu”行后的八个值分别表示以1/100(jiffies)秒为单位的统计值(包括系统运行于用户模式、低优先级用户模式,运系统模式、空闲模式、I/O等待模式的时间等);“intr”行给出中断的信息,第一个为自系统启动以来,发生的所有的中断的次数;然后每个数对应一个特定的中断自系统启动以来所发生的次数;“ctxt”给出了自系统启动以来CPU发生的上下文交换的次数。“btime”给出了从系统启动到现在为止的时间,单位为秒;“processes (total_forks) 自系统启动以来所创建的任务的个数目;“procs_running”:当前运行队列的任务的数目;“procs_blocked”:当前被阻塞的任务的数目;
[dirlt@umeng-ubuntu-pc] & cat /proc/stat
84 76 0 0 0
0 0 0 0 0 1 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
01 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
processes 234445
procs_running 3
procs_blocked 0
1.1.1.3 /proc/swaps
当前系统上的交换分区及其空间利用信息,如果有多个交换分区的话,则会每个交换分区的信息分别存储于/proc/swap目录中的单独文件中,而其优先级数字越低,被使用到的可能性越大;
[dirlt@umeng-ubuntu-pc] & cat /proc/swaps
1.1.1.4 /proc/cmdline
在启动时传递至内核的相关参数信息,这些信息通常由lilo或grub等启动管理工具进行传递;
[dirlt@umeng-ubuntu-pc] & cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.2.0-27-generic root=UUID=b25db1c7-e694-4eed-8d11-eacb ro quiet splash vt.handoff=7
1.1.1.5 /proc/uptime
系统上次启动以来的运行时间,如下所示,其第一个数字表示系统运行时间,第二个数字表示系统空闲时间,单位是秒;系统上次启动以来的运行时间,如下所示,其第一个数字表示系统运行时间,第二个数字表示系统空闲时间,单位是秒;
[dirlt@umeng-ubuntu-pc] & cat /proc/uptime
1.1.1.6 /proc/version
当前系统运行的内核版本号
[dirlt@umeng-ubuntu-pc] & cat /proc/version
Linux version 3.2.0-27-generic (buildd@allspice) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #43-Ubuntu SMP Fri Jul 6 14:25:57 UTC 2012
1.1.1.7 /proc/mounts
系统当前挂载的所有文件系统.第一列表示挂载的设备,第二列表示在当前目录树中的挂载点,第三点表示当前文件系统的类型,第四列表示挂载属性(ro或者rw),第五列和第六列用来匹配/etc/mtab文件中的转储(dump)属性;
[dirlt@umeng-ubuntu-pc] & cat /proc/mounts
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=1971356k,nr_inodes=492839,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,relatime,size=792064k,mode=755 0 0
/dev/disk/by-uuid/b25db1c7-e694-4eed-8d11-eacb / ext4 rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
/dev/sda3 /home ext4 rw,relatime,user_xattr,barrier=1,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
gvfs-fuse-daemon /home/dirlt/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=1000,group_id=
1.1.1.8 /proc/modules
当前装入内核的所有模块名称列表,可以由lsmod命令使用,也可以直接查看;如下所示,其中第一列表示模块名,第二列表示此模块占用内存空间大小,第三列表示此模块有多少实例被装入,第四列表示此模块依赖于其它哪些模块,第五列表示此模块的装载状态(Live:已经装入;Loading:正在装入;Unloading:正在卸载),第六列表示此模块在内核内存(kernel memory)中的偏移量;
[dirlt@umeng-ubuntu-pc] & cat /proc/modules
pci_stub 12622 1 - Live 0x0000
vboxpci 23200 0 - Live 0x0000 (O)
vboxnetadp 13382 0 - Live 0x0000 (O)
vboxnetflt 23441 0 - Live 0x0000 (O)
vboxpci,vboxnetadp,vboxnetflt, Live 0x0000 (O)
bnep 18281 2 - Live 0x0000
rfcomm 47604 0 - Live 0x0000
bnep,rfcomm, Live 0x0000
binfmt_misc 17540 1 - Live 0x0000
snd_hda_codec_realtek
- Live 0x0000
ppdev 17113 0 - Live 0x0000
eeepc_wmi 13109 0 - Live 0x0000
asus_wmi 24456 1 eeepc_wmi, Live 0x0000
sparse_keymap 13890 1 asus_wmi, Live 0x0000
snd_hda_intel 33773 5 - Live 0x0000
snd_hda_codec
snd_hda_codec_realtek,snd_hda_intel, Live 0x0000
snd_hwdep 13668 1 snd_hda_codec, Live 0x0000
snd_pcm 97188 3 snd_hda_intel,snd_hda_codec, Live 0x0000
snd_seq_midi 13324 0 - Live 0x0000
snd_rawmidi 30748 1 snd_seq_midi, Live 0x0000
snd_seq_midi_event 14899 1 snd_seq_midi, Live 0x0000
snd_seq 61896 2 snd_seq_midi,snd_seq_midi_event, Live 0x0000
snd_timer 29990 2 snd_pcm,snd_seq, Live 0x0000
snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0x0000
parport_pc 32866 1 - Live 0x0000
snd 78855 18 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device, Live 0
psmouse 87692 0 - Live 0x0000
serio_raw 13211 0 - Live 0x0000
soundcore 15091 1 snd, Live 0x0000
snd_page_alloc 18529 2 snd_hda_intel,snd_pcm, Live 0x0000
mac_hid 13253 0 - Live 0x0000
- Live 0x0000
wmi 19256 1 asus_wmi, Live 0x0000
drm_kms_helper 5, Live 0x0000
i915,drm_kms_helper, Live 0x0000
i2c_algo_bit 5, Live 0x0000
mei 41616 0 - Live 0x0000 (C)
video 5, Live 0x0000
lp 17799 0 - Live 0x0000
parport 46562 3 ppdev,parport_pc,lp, Live 0x0000
usbhid 47199 0 - Live 0x0000
hid 99559 1 usbhid, Live 0x0000
r 0 - Live 0x0000
1.1.1.9 /proc/diskstats
每块磁盘设备的磁盘I/O统计信息列表
1.1.1.10 /proc/cpuinfo
1.1.1.11 /proc/crypto
系统上已安装的内核使用的密码算法及每个算法的详细信息列表
[dirlt@umeng-ubuntu-pc] & cat /proc/crypto
: cbc(aes)
: cbc(aes-generic)
: blkcipher
min keysize
max keysize
: &default&
: hmac(sha256)
: hmac(sha256-generic)
digestsize
: hmac(sha1)
: hmac(sha1-generic)
digestsize
: crc32c-generic
digestsize
: aes-generic
min keysize
max keysize
: sha256-generic
digestsize
: sha224-generic
digestsize
: sha1-generic
digestsize
: md5-generic
digestsize
: crc32c-intel
digestsize
1.1.1.12 /proc/loadavg
Linux系统中Load Average含义 – Linux Kernel Exploration
保存关于CPU和磁盘I/O的负载平均值,其前三列分别表示每1秒钟、每5秒钟及每15秒的负载平均值,类似于uptime命令输出的相关信息;第四列是由斜线隔开的两个数值,前者表示当前正由内核调度的实体(进程和线程)的数目,后者表示系统当前存活的内核调度实体的数目;第五列表示此文件被查看前最近一个由内核创建的进程的PID.
[dirlt@umeng-ubuntu-pc] & cat /proc/loadavg
2.46 2.14 2.16 15/736 11012
1.1.1.13 /proc/locks
保存当前由内核锁定的文件的相关信息,包含内核内部的调试数据;每个锁定占据一行,且具有一个惟一的编号;如下输出信息中每行的第二列表示当前锁定使用的锁定类别,POSIX表示目前较新类型的文件锁,由lockf系统调用产生,FLOCK是传统的UNIX文件锁,由flock系统调用产生;第三列也通常由两种类型,ADVISORY表示不允许其他用户锁定此文件,但允许读取,MANDATORY表示此文件锁定期间不允许其他用户任何形式的访问;
[dirlt@umeng-ubuntu-pc] & cat /proc/locks
WRITE : 4775806
647 08:01:3742335
WRITE : EOF
WRITE :3742335
WRITE : EOF
WRITE : 4775806
WRITE : 4775806
WRITE :3742335
WRITE : EOF
WRITE 997 00:0f:1714 0 EOF
WRITE 958 00:0f:8496 0 EOF
1.1.1.14 /proc/slabinfo
在内核中频繁使用的对象(如inode、dentry等)都有自己的cache,即slab pool,而/proc/slabinfo文件列出了这些对象相关slap的信息;详情可以参见内核文档中slapinfo的手册页;
[dirlt@umeng-ubuntu-pc] & sudo cat /proc/slabinfo
[sudo] password for dirlt:
slabinfo - version: 2.1
&active_objs& &num_objs& &objsize& &objperslab& &pagesperslab& : tunables &limit& &batchcount& &sharedfactor& : sla
bdata &active_slabs& &num_slabs& &sharedavail&
ip6_dst_cache
2 : tunables
0 : slabdata
4 : tunables
0 : slabdata
4 : tunables
0 : slabdata
tw_sock_TCPv6
2 : tunables
0 : slabdata
8 : tunables
0 : slabdata
flow_cache
1 : tunables
0 : slabdata
kcopyd_job
8 : tunables
0 : slabdata
8 : tunables
0 : slabdata
dm_rq_target_io
2 : tunables
0 : slabdata
1 : tunables
0 : slabdata
2 : tunables
0 : slabdata
mqueue_inode_cache
4 : tunables
0 : slabdata
fuse_request
4 : tunables
0 : slabdata
fuse_inode
4 : tunables
0 : slabdata
ecryptfs_key_record_cache
4 : tunables
0 : slabdata
ecryptfs_inode_cache
4 : tunables
0 : slabdata
hugetlbfs_inode_cache
4 : tunables
0 : slabdata
journal_handle
1 : tunables
0 : slabdata
journal_head
1 : tunables
0 : slabdata
revoke_record
1 : tunables
0 : slabdata
ext4_inode_cache
4 : tunables
0 : slabdata
ext4_free_data
1 : tunables
0 : slabdata
ext4_allocation_context
1 : tunables
0 : slabdata
ext4_io_end
8 : tunables
0 : slabdata
ext4_io_page
1 : tunables
0 : slabdata
ext3_inode_cache
4 : tunables
0 : slabdata
ext3_xattr
1 : tunables
0 : slabdata
1 : tunables
0 : slabdata
dnotify_mark
1 : tunables
0 : slabdata
4 : tunables
0 : slabdata
pid_namespace
8 : tunables
0 : slabdata
user_namespace
8 : tunables
0 : slabdata
4 : tunables
0 : slabdata
ip_fib_trie
1 : tunables
0 : slabdata
2 : tunables
0 : slabdata
4 : tunables
0 : slabdata
tw_sock_TCP
1 : tunables
0 : slabdata
8 : tunables
0 : slabdata
blkdev_queue
8 : tunables
0 : slabdata
blkdev_requests
2 : tunables
0 : slabdata
fsnotify_event
1 : tunables
0 : slabdata
8 : tunables
0 : slabdata
8 : tunables
0 : slabdata
8 : tunables
0 : slabdata
2 : tunables
0 : slabdata
sock_inode_cache
4 : tunables
0 : slabdata
net_namespace
8 : tunables
0 : slabdata
shmem_inode_cache
4 : tunables
0 : slabdata
Acpi-ParseExt
1 : tunables
0 : slabdata
Acpi-State
1 : tunables
0 : slabdata
Acpi-Namespace
1 : tunables
0 : slabdata
task_delay_info
1 : tunables
0 : slabdata
2 : tunables
0 : slabdata
proc_inode_cache
4 : tunables
0 : slabdata
1 : tunables
0 : slabdata
bdev_cache
4 : tunables
0 : slabdata
sysfs_dir_cache
1 : tunables
0 : slabdata
inode_cache
4 : tunables
0 : slabdata
1 : tunables
0 : slabdata
iint_cache
1 : tunables
0 : slabdata
buffer_head
1 : tunables
0 : slabdata
vm_area_struct
1 : tunables
0 : slabdata
4 : tunables
0 : slabdata
files_cache
4 : tunables
0 : slabdata
signal_cache
8 : tunables
0 : slabdata
sighand_cache
8 : tunables
0 : slabdata
task_xstate
4 : tunables
0 : slabdata
task_struct
8 : tunables
0 : slabdata
1 : tunables
0 : slabdata
shared_policy_node
1 : tunables
0 : slabdata
numa_policy
1 : tunables
0 : slabdata
radix_tree_node
4 : tunables
0 : slabdata
idr_layer_cache
4 : tunables
0 : slabdata
dma-kmalloc-8192
8 : tunables
0 : slabdata
dma-kmalloc-4096
8 : tunables
0 : slabdata
dma-kmalloc-2048
8 : tunables
0 : slabdata
dma-kmalloc-1024
4 : tunables
0 : slabdata
dma-kmalloc-512
2 : tunables
0 : slabdata
dma-kmalloc-256
1 : tunables
0 : slabdata
dma-kmalloc-128
1 : tunables
0 : slabdata
dma-kmalloc-64
1 : tunables
0 : slabdata
dma-kmalloc-32
1 : tunables
0 : slabdata
dma-kmalloc-16
1 : tunables
0 : slabdata
dma-kmalloc-8
1 : tunables
0 : slabdata
dma-kmalloc-192
1 : tunables
0 : slabdata
dma-kmalloc-96
1 : tunables
0 : slabdata
kmalloc-8192
8 : tunables
0 : slabdata
kmalloc-4096
8 : tunables
0 : slabdata
kmalloc-2048
8 : tunables
0 : slabdata
kmalloc-1024
4 : tunables
0 : slabdata
kmalloc-512
2 : tunables
0 : slabdata
kmalloc-256
1 : tunables
0 : slabdata
kmalloc-128
1 : tunables
0 : slabdata
kmalloc-64
1 : tunables
0 : slabdata
kmalloc-32
1 : tunables
0 : slabdata
kmalloc-16
1 : tunables
0 : slabdata
1 : tunables
0 : slabdata
kmalloc-192
1 : tunables
0 : slabdata
kmalloc-96
1 : tunables
0 : slabdata
kmem_cache
1 : tunables
0 : slabdata
kmem_cache_node
1 : tunables
0 : slabdata
1.1.1.15 /proc/vmstat
当前系统虚拟内存的多种统计数据,信息量可能会比较大,这因系统而有所不同,可读性较好;
[dirlt@umeng-ubuntu-pc] & cat /proc/vmstat
nr_free_pages 39606
nr_inactive_anon 207905
nr_active_anon 575539
nr_inactive_file 51308
nr_active_file 51193
nr_unevictable 8
nr_mlock 8
nr_anon_pages 662833
nr_mapped 30562
nr_file_pages 242500
nr_dirty 288
nr_writeback 0
nr_slab_reclaimable 20951
nr_slab_unreclaimable 10401
nr_page_table_pages 12576
nr_kernel_stack 739
nr_unstable 0
nr_bounce 0
nr_vmscan_write 1043356
nr_vmscan_immediate_reclaim 310904
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 106998
nr_dirtied
nr_written
numa_miss 0
numa_foreign 0
numa_interleave 5518
numa_local
numa_other 0
nr_anon_transparent_hugepages 0
nr_dirty_threshold 92555
nr_dirty_background_threshold 46277
pswpin 491621
pswpout 789986
pgalloc_dma 0
pgalloc_dma32
pgalloc_normal
pgalloc_movable 0
pgactivate 4825471
pgdeactivate 4561700
pgmajfault 159176
pgrefill_dma 0
pgrefill_dma32 2727143
pgrefill_normal 3119709
pgrefill_movable 0
pgsteal_dma 0
pgsteal_dma32 4612169
pgsteal_normal 2661815
pgsteal_movable 0
pgscan_kswapd_dma 0
pgscan_kswapd_dma32 6468262
pgscan_kswapd_normal 4573712
pgscan_kswapd_movable 0
pgscan_direct_dma 0
pgscan_direct_dma32 275766
pgscan_direct_normal 246885
pgscan_direct_movable 0
zone_reclaim_failed 0
pginodesteal 0
slabs_scanned 1904768
kswapd_steal 7105516
kswapd_inodesteal 41781
kswapd_low_wmark_hit_quickly 10
kswapd_high_wmark_hit_quickly 980
kswapd_skip_congestion_wait 4130
pageoutrun 147240
allocstall 3159
pgrotated 884823
compact_blocks_moved 0
compact_pages_moved 0
compact_pagemigrate_failed 0
compact_stall 5
compact_fail 3
compact_success 2
htlb_buddy_alloc_success 0
htlb_buddy_alloc_fail 0
unevictable_pgs_culled 0
unevictable_pgs_scanned 0
unevictable_pgs_rescued 74
unevictable_pgs_mlocked 82
unevictable_pgs_munlocked 74
unevictable_pgs_cleared 0
unevictable_pgs_stranded 0
unevictable_pgs_mlockfreed 0
thp_fault_alloc 0
thp_fault_fallback 0
thp_collapse_alloc 0
thp_collapse_alloc_failed 0
thp_split 0
1.1.1.16 /proc/zoneinfo
内存区域(zone)的详细信息列表
[dirlt@umeng-ubuntu-pc] & cat /proc/zoneinfo
Node 0, zone
pages free
nr_free_pages 3977
nr_inactive_anon 0
nr_active_anon 0
nr_inactive_file 0
nr_active_file 0
nr_unevictable 0
nr_anon_pages 0
nr_file_pages 0
nr_writeback 0
nr_slab_reclaimable 0
nr_slab_unreclaimable 0
nr_page_table_pages 0
nr_kernel_stack 0
nr_unstable
nr_vmscan_write 0
nr_vmscan_immediate_reclaim 0
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_dirtied
nr_written
numa_foreign 0
numa_interleave 0
numa_local
numa_other
nr_anon_transparent_hugepages 0
protection: (0, , 3912)
vm stats threshold: 6
vm stats threshold: 6
vm stats threshold: 6
vm stats threshold: 6
all_unreclaimable: 1
start_pfn:
inactive_ratio:
Node 0, zone
pages free
nr_free_pages 36397
nr_inactive_anon 122972
nr_active_anon 492944
nr_inactive_file 32614
nr_active_file 31141
nr_unevictable 0
nr_anon_pages 528611
nr_file_pages 167055
nr_writeback 0
nr_slab_reclaimable 14391
nr_slab_unreclaimable 3764
nr_page_table_pages 5393
nr_kernel_stack 217
nr_unstable
nr_vmscan_write 573794
nr_vmscan_immediate_reclaim 248788
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_dirtied
nr_written
numa_foreign 0
numa_interleave 0
numa_local
numa_other
nr_anon_transparent_hugepages 0
protection: (0, 0, )
vm stats threshold: 36
count: 171
vm stats threshold: 36
vm stats threshold: 36
count: 125
vm stats threshold: 36
all_unreclaimable: 0
start_pfn:
inactive_ratio:
Node 0, zone
pages free
nr_free_pages 5426
nr_inactive_anon 81011
nr_active_anon 80301
nr_inactive_file 18852
nr_active_file 20072
nr_unevictable 8
nr_anon_pages 131848
nr_file_pages 71702
nr_writeback 0
nr_slab_reclaimable 6568
nr_slab_unreclaimable 6641
nr_page_table_pages 7176
nr_kernel_stack 523
nr_unstable
nr_vmscan_write 469562
nr_vmscan_immediate_reclaim 62116
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_dirtied
nr_written
numa_foreign 0
numa_interleave 5518
numa_local
numa_other
nr_anon_transparent_hugepages 0
protection: (0, 0, 0, 0)
vm stats threshold: 24
count: 170
vm stats threshold: 24
count: 132
vm stats threshold: 24
count: 185
vm stats threshold: 24
all_unreclaimable: 0
start_pfn:
inactive_ratio:
1.1.2 proc/&pid&
其中pid为对应的进程号,目录下面就是这个进程对应的信息。
attr ???auxv ???cgroup ???clear_refs ???cmdline 进程启动运行参数coredump_filter ???cpuset ???cwd 当前目录environ 环境变量exe 映像文件fd 打开fdfdinfo 打开fd对应信息(非常少).io 读写字节数目以及读写系统调用次数。limits 运行环境limitsloginuid 运行程序用户登录的uid(不是euid).maps 进程运行内存镜像图示(文本)mountinfo 文件系统挂载信息mounts 文件系统挂载信息mountstatus 文件系统挂载信息net 网络信息numa_maps NUMA的内存映射 ???oom_adj 出现OOM时进程被kill的权值。范围从[-17,15],越小意味着越不容易被kill。oom_score 出现OOM时进程被kill的分值,就是每个进程计算出来的badness。badness越高越容易被kill。pagemap 内存映像(二进制),类似于corepersonality ??root 根文件系统路径sched 进程调度信息sessionid ???smaps 进程运行内存镜像图示(文本)各个段大小stat 当前进程的状态信息statm 当前进程占用内存的状态信息status 进程运行系统状态syscall ???task 如果是多线程的话每个线程对应信息wchan ???
1.1.2.1 fd
todo(zhangyan04):
1.1.2.2 io
1.1.2.3 limits
1.1.2.4 maps
当前进程关联到的每个可执行文件和库文件在内存中的映射区域及其访问权限所组成的列表
e0000 r-xp :01 4456452
006df000-006e0000 r--p 000df000 08:01 4456452
006e0 rw-p 000e 4456452
006e0 rw-p :00 0
ac000 rw-p :00 0
7f81aaf81aa611000 r-xp :01 5770912
/lib/x86_64-linux-gnu/libnss_files-2.15.so
7f81aaf81aa810000 ---p :01 5770912
/lib/x86_64-linux-gnu/libnss_files-2.15.so
7f81aaf81aa811000 r--p :01 5770912
/lib/x86_64-linux-gnu/libnss_files-2.15.so
7f81aaf81aa812000 rw-p :01 5770912
/lib/x86_64-linux-gnu/libnss_files-2.15.so
7f81aaf81aa81c000 r-xp :01 5770916
/lib/x86_64-linux-gnu/libnss_nis-2.15.so
7f81aa81c000-7f81aaa1c000 ---p :01 5770916
/lib/x86_64-linux-gnu/libnss_nis-2.15.so
7f81aaa1c000-7f81aaa1d000 r--p :01 5770916
/lib/x86_64-linux-gnu/libnss_nis-2.15.so
7f81aaa1d000-7f81aaa1e000 rw-p :01 5770916
/lib/x86_64-linux-gnu/libnss_nis-2.15.so
7f81aaa1e000-7f81aaa35000 r-xp :01 5770906
/lib/x86_64-linux-gnu/libnsl-2.15.so
7f81aaaaac34000 ---p :01 5770906
/lib/x86_64-linux-gnu/libnsl-2.15.so
7f81aacaac35000 r--p :01 5770906
/lib/x86_64-linux-gnu/libnsl-2.15.so
7f81aacaac36000 rw-p :01 5770906
/lib/x86_64-linux-gnu/libnsl-2.15.so
7f81aacaac38000 rw-p :00 0
7f81aacaac40000 r-xp :01 5770908
/lib/x86_64-linux-gnu/libnss_compat-2.15.so
7f81aacaae3f000 ---p :01 5770908
/lib/x86_64-linux-gnu/libnss_compat-2.15.so
7f81aae3f000-7f81aae40000 r--p :01 5770908
/lib/x86_64-linux-gnu/libnss_compat-2.15.so
7f81aaeaae41000 rw-p :01 5770908
/lib/x86_64-linux-gnu/libnss_compat-2.15.so
7f81aaeab524000 r--p :01 2628153
/usr/lib/locale/locale-archive
7f81abf81ab6d7000 r-xp :01 5770861
/lib/x86_64-linux-gnu/libc-2.15.so
7f81ab6dab8d6000 ---p 001b 5770861
/lib/x86_64-linux-gnu/libc-2.15.so
7f81ab8dab8da000 r--p 001b 5770861
/lib/x86_64-linux-gnu/libc-2.15.so
7f81ab8da000-7f81ab8dc000 rw-p 001b 5770861
/lib/x86_64-linux-gnu/libc-2.15.so
7f81ab8dc000-7f81ab8e1000 rw-p :00 0
7f81ab8eab8e3000 r-xp :01 5770874
/lib/x86_64-linux-gnu/libdl-2.15.so
7f81ab8eabae3000 ---p :01 5770874
/lib/x86_64-linux-gnu/libdl-2.15.so
7f81abaeabae4000 r--p :01 5770874
/lib/x86_64-linux-gnu/libdl-2.15.so
7f81abaeabae5000 rw-p :01 5770874
/lib/x86_64-linux-gnu/libdl-2.15.so
7f81abaeabb07000 r-xp :01 5770958
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f81abbabd07000 ---p :01 5770958
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f81abdabd0b000 r--p :01 5770958
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f81abd0b000-7f81abd0c000 rw-p :01 5770958
/lib/x86_64-linux-gnu/libtinfo.so.5.9
7f81abd0c000-7f81abd2e000 r-xp :01 5770841
/lib/x86_64-linux-gnu/ld-2.15.so
7f81abfabf15000 rw-p :00 0
7f81abfabf2c000 r--s :01 2884820
/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache
7f81abf2c000-7f81abf2e000 rw-p :00 0
7f81abf2e000-7f81abf2f000 r--p :01 5770841
/lib/x86_64-linux-gnu/ld-2.15.so
7f81abf2f000-7f81abf31000 rw-p :01 5770841
/lib/x86_64-linux-gnu/ld-2.15.so
7fffccd69000-7fffccd8a000 rw-p :00 0
7fffccdff000-7fffcce00000 r-xp :00 0
ffffffffff600000-ffffffffff601000 r-xp :00 0
[vsyscall]
1.1.2.5 mount
1.1.2.6 net
todo(zhangyan04):
1.1.2.7 sched
todo(zhangyan04):
1.1.2.8 status
1.1.2.9 statm
Provides information about memory usage, measured in pages. The columns are:
size total program size (same as VmSize in /proc/[pid]/status)resident resident set size (same as VmRSS in /proc/[pid]/status)share shared pages (from shared mappings)text text (code)lib library (unused in Linux 2.6)data data + stackdt dirty pages (unused in Linux 2.6)
1.1.3 /proc/sys
在/proc/sys下面有一些可以动态修改的内核参数,有两种方式可以修改这些参数。
首先可以使用sysctl工具来进行修改。比如如果想修改sys/vm/swappiness==0的话,那么可以
dirlt@dirlt-virtual-machine:~/github/sperm/essay$ sudo sysctl vm.swappiness=0
[sudo] password for dirlt:
vm.swappiness = 0
上面修改方式是临时的,如果想进行永久修改的话可以修改/etc/sysctl.conf文件
vm.swappiness = 0
然后重启那么这个设置就会永久生效。
1.1.4 /proc/sys/vm
1.1.4.1 /proc/sys/vm/overcommit_memory
所谓的overcommit是过量使用的意思。
OVERCOMMIT_GUESS=0 用户申请内存的时候,系统会判断剩余的内存有多少。如果不够的话那么就会失败。这种方式是比较保守的,因为有时候比如用户申请1G内存但是可能只是会使用其中1K.
Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It ensures a seriously wild allocation fails while allowing overcommit to reduce swap usage. root is allowed to allocate slighly more memory in this
mode. This is the default.
OVERCOMMIT_ALWAYS=1 用户申请内存的时候,系统不进行任何检查认为内存足够使用,直到使用内存超过可用内存。
Always overcommit. Appropriate for some scientific applications.
OVERCOMMIT_NEVER=2 用户一次申请内存的大小不允许超过&可用内存&的大小。关于这个&可用内存&的大小计算可以看下面overcommit_ration这个参数,可以上面两种所说的可用内存不太一样。
Don't overcommit. The total address space commit for the system is not permitted to exceed swap + a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations this means a process will not be killed
while accessing pages but will receive errors on memory allocation as appropriate.
下午将dp3的overcommit_memory参数修改成为2之后,首先出现的问题就是不能够再执行任何shell命令了,错误是fork can't allocate enough memory,就是fork没有那么多的内存可用。然后推出会话之后没有办法再登陆dp3了。这个主要是因为jvm应该基本上占用满了物理内存,而overcommit_ration=0.5,并且没有swap空间,所以没有办法allocate更多的memory了。
从/var/log/syslog里面可以看到,修改了这个参数之后,很多程序受到影响(ganglia挂掉了,cron不能够fork出进程了,init也不能够分配出更多的tty,导致我们没有办法登陆上去)在ganglia里面看到内存以及CPU使用都是一条直线,不是因为系统稳定而是因为gmond挂掉了。
8 18:07:04 dp3 /usr/sbin/gmond[1664]: [PYTHON] Can't call the metric handler function for [diskstat_sdd_reads] in the python module [diskstat].#012
8 18:07:04 dp3 /usr/sbin/gmond[1664]: [PYTHON] Can't call the metric handler function for [diskstat_sdd_writes] in the python module [diskstat].#012
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Error writing state file: No space left on device
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Cannot write to file /var/run/ConsoleKit/database~
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Unable to spawn /usr/lib/ConsoleKit/run-session.d/pam-foreground-compat.ck: Failed to fork (Cannot allocate memory)
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Error writing state file: No space left on device
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Cannot write to file /var/run/ConsoleKit/database~
8 18:07:28 dp3 console-kit-daemon[1760]: WARNING: Cannot unlink /var/run/ConsoleKit/database: No such file or directory
8 18:08:12 dp3 /usr/sbin/gmond[1664]: slurpfile() open() error on file /proc/stat: Too many open files
8 18:08:12 dp3 /usr/sbin/gmond[1664]: update_file() got an error from slurpfile() reading /proc/stat
8 18:08:12 dp3 /usr/sbin/gmond[1664]: slurpfile() open() error on file /proc/stat: Too many open files
8 18:08:12 dp3 /usr/sbin/gmond[1664]: update_file() got an error from slurpfile() reading /proc/stat
8 18:08:12 dp3 /usr/sbin/gmond[1664]: slurpfile() open() error on file /proc/stat: Too many open files
8 18:08:12 dp3 /usr/sbin/gmond[1664]: update_file() got an error from slurpfile() reading /proc/stat
8 18:08:12 dp3 /usr/sbin/gmond[1664]: slurpfile() open() error on file /proc/stat: Too many open files
8 18:08:12 dp3 /usr/sbin/gmond[1664]: update_file() got an error from slurpfile() reading /proc/stat
8 18:08:12 dp3 /usr/sbin/gmond[1664]: slurpfile() open() error on file /proc/stat: Too many open files
8 18:08:12 dp3 /usr/sbin/gmond[1664]: update_file() got an error from slurpfile() reading /proc/stat
8 18:08:12 dp3 kernel: [327] gmond[1664]: segfault at ffffffffffffffff ip 6f34 sp 00007fff4e428620 error 4 in libganglia-3.1.2.so.0.0.0[7f52e;13000]
8 18:10:01 dp3 cron[1637]: (CRON) error (can't fork)
8 18:13:53 dp3 init: tty1 main process (2341) terminated with status 1
8 18:13:53 dp3 init: tty1 main process ended, respawning
8 18:13:53 dp3 init: Temporary process spawn error: Cannot allocate memory
而在hadoop的datanode日志里面,有下面这些错误(只是给出部分exception):
18:07:01,283 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(10.18.10.56:50010, storageID=DS--10.18.10.47-2718923, infoPort=50075, ipcPort=50020):DataXceiver
java.io.EOFException: while trying to read 65557 bytes
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.readToBuf(BlockReceiver.java:290)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.readNextPacket(BlockReceiver.java:334)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receivePacket(BlockReceiver.java:398)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receiveBlock(BlockReceiver.java:577)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.writeBlock(DataXceiver.java:480)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:171)
18:07:02,163 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(10.18.10.56:50010, storageID=DS--10.18.10.47-2718923, infoPort=50075, ipcPort=50020):DataXceiverServer: Exiting due to:java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:640)
at org.apache.hadoop.hdfs.server.datanode.DataXceiverServer.run(DataXceiverServer.java:131)
at java.lang.Thread.run(Thread.java:662)
18:07:04,964 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(10.18.10.56:50010, storageID=DS--10.18.10.47-2718923, infoPort=50075, ipcPort=50020):DataXceiver
java.io.InterruptedIOException: Interruped while waiting for IO on channel java.nio.channels.SocketChannel[closed]. 0 millis timeout left.
at org.apache.hadoop.net.SocketIOWithTimeout$SelectorPool.select(SocketIOWithTimeout.java:349)
at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:157)
at org.apache.hadoop.net.SocketInputStream.read(SocketInputStream.java:155)
at org.apache.hadoop.net.SocketInputStream.read(SocketInputStream.java:128)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at java.io.DataInputStream.read(DataInputStream.java:132)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.readToBuf(BlockReceiver.java:287)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.readNextPacket(BlockReceiver.java:334)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receivePacket(BlockReceiver.java:398)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receiveBlock(BlockReceiver.java:577)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.writeBlock(DataXceiver.java:480)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:171)
18:07:04,965 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: PacketResponder blk_-90729 1 Exception java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readLong(DataInputStream.java:399)
at org.apache.hadoop.hdfs.protocol.DataTransferProtocol$PipelineAck.readFields(DataTransferProtocol.java:120)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver$PacketResponder.run(BlockReceiver.java:937)
at java.lang.Thread.run(Thread.java:662)
18:07:05,057 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: PacketResponder blk_72264 1 Exception java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:133)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
at org.apache.hadoop.net.SocketOutputStream$Writer.performIO(SocketOutputStream.java:55)
at org.apache.hadoop.net.SocketIOWithTimeout.doIO(SocketIOWithTimeout.java:142)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:146)
at org.apache.hadoop.net.SocketOutputStream.write(SocketOutputStream.java:107)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at java.io.DataOutputStream.flush(DataOutputStream.java:106)
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver$PacketResponder.run(BlockReceiver.java:1047)
at java.lang.Thread.run(Thread.java:662)
18:07:04,972 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: DatanodeRegistration(10.18.10.56:50010, storageID=DS--10.18.10.47-2718923, infoPort=5
0075, ipcPort=50020):DataXceiver
java.io.IOException: Interrupted receiveBlock
at org.apache.hadoop.hdfs.server.datanode.BlockReceiver.receiveBlock(BlockReceiver.java:622)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.writeBlock(DataXceiver.java:480)
at org.apache.hadoop.hdfs.server.datanode.DataXceiver.run(DataXceiver.java:171)
18:08:02,003 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Waiting for threadgroup to exit, active threads is 1
18:08:02,025 WARN org.apache.hadoop.util.Shell: Could not get disk usage information
java.io.IOException: Cannot run program &du&: java.io.IOException: error=12, Cannot allocate memory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
at org.apache.hadoop.util.Shell.runCommand(Shell.java:200)
at org.apache.hadoop.util.Shell.run(Shell.java:182)
at org.apache.hadoop.fs.DU.access$200(DU.java:29)
at org.apache.hadoop.fs.DU$DURefreshThread.run(DU.java:84)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: java.io.IOException: error=12, Cannot allocate memory
at java.lang.UNIXProcess.&init&(UNIXProcess.java:148)
at java.lang.ProcessImpl.start(ProcessImpl.java:65)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
接着之后就一直打印下面日志hang住了
18:08:52,015 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Waiting for threadgroup to exit, active threads is 1
hdfs web页面上面显示dead node,但是实际上这个datanode进程还存活。原因估计也是因为不能够分配足够的内存出现这些问题的吧。
最后可以登陆上去的原因,我猜想应该是datanode挂掉了,上面的regionserver暂时没有分配内存所以有足够的内存空间,init可以开辟tty。
现在已经将这个值调整成为原来的值,也就是0。索性的是,在这个期间,这个修改对于线上的任务执行没有什么影响。
1.1.4.2 /proc/sys/vm/overcommit_ratio
如果overcommit_memory值为2的话,那么这个参数决定了系统的&可用内存&的大小。计算方式是 (Physical-RAM-Size) * ratio / 100 + (Swap-Size).
dirlt@dirlt-virtual-machine:~/github/sperm/essay$ free -m
-/+ buffers/cache:
dirlt@dirlt-virtual-machine:~/github/sperm/essay$ cat /proc/sys/vm/overcommit_ratio
所以对于我这个系统来说,可用的虚拟内存在(491*50/100)+509=754M. note(dirlt):这个仅仅是在overcommit_memory=2的时候估算的&可用内存&大小, 实际上对于其他情况来说可用内存大小还是(Physical-RAM-Size) + (Swap-Size).
1.1.4.3 /proc/sys/vm/swappiness
这个参数决定系统使用swap的程度。但是这个参数并没有禁止使用swap分区,而只是一个依赖于swap分区的程度。 如果这个值设置成为0的话那么,那么系统会尽可能地将减少page swap in/out操作,将更多的内存操作于物理内存上面。
1.1.4.4 /proc/sys/vm/dirty_*
这几个参数主要是用来控制脏页刷回磁盘策略。关于脏页刷回磁盘的过程可以参看&文件IO/write&一节。
note(dirlt)@: 我copy了一份内容过来
对于这些脏页的写回策略是:
首先判断脏页比例是否超过dirty_ratio.如果没有的话那么直接退出然后开始将脏页刷到磁盘直到比率小于dirty_ratio.(此时write会阻塞)判断脏页比例是否超过dirty_background_ratio或者是超过dirty_background_bytes.如果没有那么退出。如果超过的话那么就会启动pdflush daemon后台进程刷新脏页。(此时write不会阻塞)
注意到这里可能启动pdflush daemon在后台刷新脏页。另外系统每隔dirty_writeback_centisecs时间会启动pdflush daemon将脏页刷到磁盘上面。而pdflush daemon工作方式是这样的,检查脏页是否存在超过dirty_expire_centisecs时间的,如果超过的话那么就会在后台刷新这些脏页。
1.1.4.5 /proc/sys/vm/drop_caches
可以用来释放kernel保存的buffers和cached memory,buffers保存的是目录以及文件的inode,cached memory保存的是操作文件时候使用的pagecache
0 // 释放cached memory1 // 释放buffers2 // 释放两者
为了防止数据丢失,可以在修改这个文件之前先调用sync强制写盘
1.1.4.6 /proc/sys/vm/panic_on_oom
OOM Killer - linux-mm.org Wiki Taming the OOM killer [LWN.net]
/proc/sys/vm/oom_victim 通过在这个地方指定名字来优先killOOM control group (cgroup) 通过将process划分到某个group为这个group制定权值mem_notify 如果出现OOM情况的话可以通知到userspacecgroup OOM notifier 允许某个task来监控一群tasks,如果出现OOM的话会通知这个task/dev/mem_notify 这个设备文件上面包含内存事件,task可以poll这个文件来获取通知
Linux 的 Out-of-Memory (OOM) Killer - DBA Notes OOM killer &Out of Memory: Killed process& SOLUTIONS / SUMMARY
情况主要是在32位机器下面LowMem不够使用出现OOM的情况。 todo(dirlt):不太清楚这个LowMem是物理还是虚拟内存
LinuxDevCenter.com: When Linux Runs Out of Memory Respite from the OOM killer [LWN.net] note(dirlt):似乎overcommit_memory设置成为2也不能够完全避免OOM
This enables or disables panic on out-of-memory feature.
If this is set to 0, the kernel will kill some rogue process, called oom_killer.& Usually, oom_killer can kill rogue processes and system will survive.
If this is set to 1, the kernel panics when out-of-memory happens. However, if a process limits using nodes by mempolicy/cpusets, and those nodes become memory exhaustion status, one process may be killed by oom-killer. No panic occurs in this case. Because
other nodes' memory may be free. This means system total status may be not fatal yet.
If this is set to 2, the kernel panics compulsorily even on the above-mentioned.
The default value is 0. 1 and 2 are for failover of clustering. Please select either according to your policy of failover.
note(dirlt):对于1,2不是很理解,可能是用于分布式集群Linux系统上面的策略
1.1.5 /proc/sys/net
1.1.5.1 /proc/sys/net/ipv4/ip_local_port_range
本地port分配范围.
1.1.5.2 /proc/sys/net/ipv4/tcp_tw_reuse
重复使用处于TIME_WAIT的socket.
Allow& to& reuse& TIME_WAIT sockets for new connections when it is safe from protocol viewpoint.
1.1.5.3 /proc/sys/net/ipv4/tcp_tw_recycle
快速回收处理TIME_WAIT的socket.
Enable fast recycling of TIME_WAIT sockets.
1.1.5.4 /proc/sys/net/ipv4/tcp_max_syn_backlog
等待client做ack的连接数目上限
1.1.5.5 /proc/sys/net/core/somaxconn
每个端口监听队列的最大长度。
1.1.5.6 /proc/sys/net/core/netdev_max_backlog
网络设备接收数据包的速率比内核处理这些包的速率快时,允许送到队列的数据包的最大数目。
1.1.6 /proc/sys/fs
1.1.6.1 /proc/sys/fs/file-max
所有进程允许打开文件的最大数量 note(dirlt):这个应该是和文件描述符有区别的
1.1.6.2 /proc/sys/fs/epoll/max_user_instances
单个用户使用epoll的文件描述符上限。如果超过上限会返回EMFILE错误。 note(dirlt):不过在我的文件系统下面似乎没有这个选项
1.1.6.3 /proc/sys/fs/epoll/max_user_watches
单个用户使用epoll进行watch的文件描述符上限。 note(dirlt):对于服务器应该特别有用,可以限制内存使用量
This specifies a limit on the total number of file descriptors that a user can register across all epoll& instances
on& the system.& The limit is per real user ID.& Each registered file descriptor costs roughly 90 bytes on a 32-bit
kernel, and roughly 160 bytes on a 64-bit kernel.& Currently, the default value for max_user_watches is& 1/25& (4%)
of the available low memory, divided by the registration cost in bytes.
1.1.7 /proc/sys/kernel
1.1.7.1 /proc/sys/kernel/hung_task_timeout_secs
Detecting hung tasks in Linux
Sometimes tasks under Linux are blocked forever (essentially hung). Recent Linux kernels have an infrastructure to detect hung tasks. When this infrastructure is active it will periodically get activated to find out hung tasks and present a stack dump of
those hung tasks (and maybe locks held). Additionally we can choose to panic the system when we detect atleast one hung task in the system. I will try to explain how khungtaskd works.
The infrastructure is based on a single kernel thread named as “khungtaskd”. So if you do a ps in your system and see that there is entry like [khungtaskd] you know it is there. I have one in my system: &136 root SW [khungtaskd]&
The loop of the khungtaskd daemon is a call to the scheduler for waking it up after ever 120 seconds (default value). The core algorithm is like this:
Iterate over all the tasks in the system which are marked as TASK_UNINTERRUPTIBLE (additionally it does not consider UNINTERRUPTIBLE frozen tasks & UNINTERRUPTIBLE tasks that are newly created and never been scheduled out).If a task has not been switched out by the scheduler atleast once in the last 120 seconds it is considered as a hung task and its stack dump is displayed. If CONFIG_LOCKDEP is defined then it will also show all the locks the hung task is holding.
One can change the sampling interval of khungtaskd through the sysctl interface /proc/sys/kernel/hung_task_timeout_secs.
之前在hdfs一个datanode上面出现了磁盘损坏问题,然后在syslog里面发现了下面日志
May 14 00:02:50 dp46 kernel: INFO: task jbd2/sde1-8:3411 blocked for more than 120 seconds.
May 14 00:02:50 dp46 kernel: &echo 0 & /proc/sys/kernel/hung_task_timeout_secsmahung_task_timeout_secs& disables this message.
May 14 00:02:50 dp46 kernel: jbd2/sde1-8
May 14 00:02:50 dp46 kernel: ffffa80 0046 fffff00 0441
May 14 00:02:50 dp46 kernel: ffff ffff ffffb8 ffffb8
May 14 00:02:50 dp46 kernel: ffffb8 fffffd8 f4e8 ffffb8
May 14 00:02:50 dp46 kernel: Call Trace:
May 14 00:02:50 dp46 kernel: [&ffffffff&] ? ktime_get_ts+0xa9/0xe0
May 14 00:02:50 dp46 kernel: [&ffffffff81110b10&] ? sync_page+0x0/0x50
May 14 00:02:50 dp46 kernel: [&ffffffff814ed1e3&] io_schedule+0x73/0xc0
May 14 00:02:50 dp46 kernel: [&ffffffff81110b4d&] sync_page+0x3d/0x50
May 14 00:02:50 dp46 kernel: [&ffffffff814eda4a&] __wait_on_bit_lock+0x5a/0xc0
May 14 00:02:50 dp46 kernel: [&ffffffff81110ae7&] __lock_page+0x67/0x70
May 14 00:02:50 dp46 kernel: [&ffffffff81090c30&] ? wake_bit_function+0x0/0x50
May 14 00:02:50 dp46 kernel: [&ffffffff&] ? pagevec_lookup_tag+0x25/0x40
May 14 00:02:50 dp46 kernel: [&ffffffff&] write_cache_pages+0x392/0x4a0
May 14 00:02:50 dp46 kernel: [&ffffffff81124c80&] ? __writepage+0x0/0x40
May 14 00:02:50 dp46 kernel: [&ffffffff&] generic_writepages+0x24/0x30
May 14 00:02:50 dp46 kernel: [&ffffffffa00774d7&] journal_submit_inode_data_buffers+0x47/0x50 [jbd2]
May 14 00:02:50 dp46 kernel: [&ffffffffa00779e5&] jbd2_journal_commit_transaction+0x375/0x14b0 [jbd2]
May 14 00:02:50 dp46 kernel: [&ffffffff8100975d&] ? __switch_to+0x13d/0x320
May 14 00:02:50 dp46 kernel: [&ffffffff8107c0ec&] ? lock_timer_base+0x3c/0x70
May 14 00:02:50 dp46 kernel: [&ffffffff81090bf0&] ? autoremove_wake_function+0x0/0x40
May 14 00:02:50 dp46 kernel: [&ffffffffa007d928&] kjournald2+0xb8/0x220 [jbd2]
May 14 00:02:50 dp46 kernel: [&ffffffff81090bf0&] ? autoremove_wake_function+0x0/0x40
May 14 00:02:50 dp46 kernel: [&ffffffffa007d870&] ? kjournald2+0x0/0x220 [jbd2]
May 14 00:02:50 dp46 kernel: [&ffffffff&] kthread+0x96/0xa0
May 14 00:02:50 dp46 kernel: [&ffffffff8100c14a&] child_rip+0xa/0x20
May 14 00:02:50 dp46 kernel: [&ffffffff&] ? kthread+0x0/0xa0
May 14 00:02:50 dp46 kernel: [&ffffffff&] ? child_rip+0x0/0x20
The JBD is the
that sits between the file system and the block device driver. The jbd2 version is for ext4.
1.1.8 /proc/net
1.1.8.1 /proc/net/tcp
记录所有tcp连接,netstat以及lsof都会读取这个文件. 我们遇到过一个问题就是netstat/lsof速度非常慢,通过strace发现是在读取这个文件时候非常耗时,下面两个链接给出了一些相关信息
[PATCH] tcp: Fix slowness in read /proc/net/tcp — Linux Network Development :
Linux-Kernel Archive: Awfully slow /proc/net/tcp, netstat, in.i :
todo(dirlt):
1.2 system utility
1.2.1 SYS DEV
1.2.2 mpstat
mpstat - Report processors related statistics.
mpstat -P [cpu|ALL] -V internal count
-P 能够选择特定的CPU来察看,或者是察看所有的CPUinternal 表示多少秒显示一次count 表示显示多少次
通常使用就是&mpstat -P ALL 1&
[zhangyan@tc-cm-et18.tc.baidu.com]$ mpstat -P ALL 1
Linux 2.6.9_5-10-0-1 (tc-cm-et18.tc.baidu.com)
08时39分58秒
%nice %system %iowait
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
08时39分59秒
其中每个字段的意思分别是:
CPU 处理器编号%user 处理user状态占用率%nice 处理user状态并且是nice priority占用率%system 处理system状态占用率(不包括硬中断和软中断)%iowait 在进行io操作时候有cpu idle时间比率%irq CPU耗费在硬中断上时间比率%soft CPU耗费在软中断上时间比率(软中断可以被任何一个CPU处理)%idle 在没有io操作时候的cpu idle时间比率intr/s 每秒CPU中断次数(包括硬中断和软终端)
1.2.3 vmstat
vmstat [-a] [-n] [-S unit] [delay [ count]] // 查看全局内存开销
vmstat [-f] // 查看自从boot依赖forks的次数(fork,vfork,clone),可以认为就是创建的task数目(包括线程)
vmstat [-s] // 系统事件统计次数以及内存统计
vmstat [-d] // 磁盘使用统计数据
vmstat [-m] // 内核开辟对象slabinfo
[dirlt@localhost.localdomain]$ vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
cs us sy id wa st
r 多少个进程正在等待运行b 多少个进程block住了swpd 虚拟内存(swap)free 空闲内存buff 缓冲内存(buffers,用户缓存文件inode)cache 缓冲内存(cache,用户作为文件系统page-cache)前面三个参数相加才是可用内存大小si 读取disk使用的虚拟内存so 写disk使用的虚拟内存bi[block in] 块设备读取速率,blocks/sbo[block out] 块设备写速度,blocks/sin[interrupt] 每秒中断个数cs[context switch] 每秒上下文切换次数us 用户态时间[user]sy 系统时间[system]id 空闲时间[idle]wa 等待io时间[wait IO]st 虚拟机使用时间[stolen from VM]
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ vmstat -d
disk- ------------reads------------ ------------writes----------- -----IO------
total merged sectors
total merged sectors
total 总共发起读写次数merged 聚合读写次数sectors 读写多少扇区ms 耗时毫秒cur 当前是否存在IO操作sec 耗费在IO的时间(秒)
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ vmstat -m
nfs_direct_cache
nfs_write_data
Num 当前多少个对象正在被使用Total 总共有多少个对象可以被使用Size 每个对象大小Pages 占用了多少个Page(这个Page上面至少包含一个正在被使用的对象)
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ vmstat -s
total memory
used memory
active memory
inactive memory
free memory
buffer memory
swap cache
total swap
423476 non-nice user cpu ticks
91 nice user cpu ticks
295803 system cpu ticks
idle cpu ticks
39354 IO-wait cpu ticks
800 IRQ cpu ticks
52009 softirq cpu ticks
317179 pages paged in
pages paged out
0 pages swapped in
0 pages swapped out
interrupts
CPU context switches
418742 forks
1.2.4 free
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ free -t
-/+ buffers/cache:
total 总内存大小[实际内存大小]used 已经使用大小[buffers+shared+cached+应用程序使用]free 未使用大小shared 共享内存大小buffers 缓存大小包括目录inodecached 用于操作文件使用缓冲[所谓cached的内容还是可以被使用的]- buffers/cache 表示used-buffers/cached的大小,就是应用程序已经使用内存大小+ buffers/cache 表示free+buffers/cached的大小,就是所有可供应用程序使用的大小Swap:total 交换分区大小Swap:used 交换分区使用大小Swap:free 可以使用的分区大小
1.2.5 taskset
可以用来获取和修改进程的CPU亲和性。
taskset -c 1,2,3 cmd (指定在CPU #1,#2,#3上运行cmd)taskset -cp 1,2,3 pid (指定在CPU #1,#2,#3上运行进程pid)taskset -c mask cmd|pid 通过mask格式进行设置,比如0x3就是#0和#1亲和性
如果不指定-c的话那么就是获取亲和性。程序上的话可以使用sched_setaffinity/sched_getaffinity调用来修改和获取某个进程和CPU的亲和性。
is used to set or retrieve the CPU affinity of a running pro-
cess given its PID or to launch a new COMMAND with a given CPU
CPU affinity is a scheduler property that &bonds& a process to a
given set of CPUs on the system.
The Linux scheduler will
the process will not run on any other CPUs.
Note that the Linux scheduler also supports natural CPU affinity:
attempts to keep processes on the same CPU as long as prac-
tical for performance reasons.
Therefore,
affinity is useful only in certain applications.
1.2.6 lsof
todo(dirlt):
1.2.7 hdparm
hdparm - get/set hard disk parameters
下面是使用的用法
/sbin/hdparm [ flags ] [device] ..
对于device的话可以通过mount来查看
[dirlt@localhost.localdomain]$ mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
我们关注自己读写目录,比如通常在/home下面,这里就是使用的device就是/dev/mapper/VolGroup00-LogVol00
todo(dirlt):好多选项都不太清楚是什么意思.
1.2.8 pmap
todo(dirlt):
1.2.9 strace
todo(dirlt):
1.2.10 iostat
iostat主要用来观察io设备的负载情况的。首先我们看看iostat的样例输出
dirlt@dirlt-virtual-machine:~$ iostat
Linux 3.2.0-23-generic (dirlt-virtual-machine)
%nice %system %iowait
第一行显示了CPU平均负载情况,然后给出的信息是自从上一次reboot起来今的iostat平均信息。如果我们使用iostat采用interval输出的话,那么下一次的数值是相对于上一次的数值而言的。这里解释一下CPU的各个状态:
%user 用户态比率%nice 用户态使用nice priority比率%system 系统态比率%iowait CPU在等待IO操作时候idle比率%steal todo(dirlt)%idle idle比率但是不包括在等待IO操作idle比率
然后在来看看iostat的命令行参数
iostat [ -c ] [ -d ] [ -h ] [ -N ] [ -k | -m ] [ -t ] [ -V ] [ -x ] [ -z ] [ device [...] | ALL
device [,...] | ALL ] ] [ interval [ count ] ]
其中interval表示每隔x时间刷新一次输出,而count表示希望输出多少次.下面解释一下每隔参数的含义:
-c 产生CPU输出(只是生成CPU输出)-d 生成device使用情况输出-h 和-d一样只不过human readable一些(不过其实差不多)-k 统计数据按照kilobytes为单位-m 统计数据按照megabytes为单位-N todo(dirlt)-p 选择block device以及其partitions.如果使用ALL的话那么选择所有block devices.-t 每次输出都是打印当前时间-V version-x 显示扩展数据(extended)-z 忽略输出那些在period期间没有任何活动的device.
iostat也可以指定选择输出哪些block device.
通常命令也就是iostat -d -k -x 1.我们来看看样例输出
dirlt@dirlt-virtual-machine:~$ iostat -d -x -k 1
Linux 3.2.0-23-generic (dirlt-virtual-machine)
wkB/s avgrq-sz avgqu-sz
await r_await w_await
wkB/s avgrq-sz avgqu-sz
await r_await w_await
wkB/s avgrq-sz avgqu-sz
await r_await w_await
然后分析其中字段:
Device 设备名tps number of transfers per second.对于IO device多个请求可能会合并成为一个transfer.不过似乎没有太大意义。Blk_read/s(kB_read/s, MB_read/s). 读速度,这里Block相当于一个扇区占据512bytes.Blk_wrtn/s(kB_wrtn/s, MB_wrtn/s). 写速度。Blk_read(kb_read, MB_read). 读总量Blk_wrtn(kB_wrtn, MB_wrtn). 写总量rrqm/s 每秒多少个读请求被merge.当系统调用需要读取数据的时候,VFS将请求发到各个FS,如果FS发现不同的读取请求读取的是相同Block的数据,FS会将这个请求合并Mergewrqm/s 每秒多少个些请求被merger/s 每秒多少个读请求(after merged)w/s 每秒多少个写请求(after merged)rsec/s(rkB/s, rMB/s) 读速度。sec表示sector.wsec/s(wkB/s, wMB/s) 写速度avgrq-sz 提交到这个device queue上面请求的平均大小(in sectors)avgqu-sz 提交到这个device queue上面请求的平均长度await 提交到这个device上面请求处理的平均时间(ms)r_await 提交到这个device上面读请求处理的平均时间w_await 提交到这个device上面写请求处理的平均时间svctm todo(dirlt):don't use it.%util CPU在处理IO请求时的百分比.可以认为是IO设备使用率.
1.2.11 vmtouch
note(dirlt):可以用来warmup数据,使用参数似乎也比较简单
里面有一些系统调用比较值得注意和学习:
mlock/munlock 能够将一部分的内存lock住而不会切换到swap分区上面。mlockall/munlockall 将进程所有的内存都lock住而不会切换到swap分区上面。posix_fadvise 针对fd做一些访问模式的预测
1.2.12 latencytop
todo(dirlt):
1.2.13 iotop
可以用来观察单独进程的IO使用状况
todo(dirlt):
1.2.14 dstat
todo(dirlt):
dstat -lamps
1.2.15 slurm
Simple Linux Utility for Resource Management todo(dirlt):
1.2.16 sar
sar - Collect, report, or save system activity information.
下面是所有的选项
-A 相当于指定 -bBcdqrRuvwWy -I SUM& -n FULL -P ALL.-b 这个选项只是针对2.5以下的内核.统计磁盘的IO运行情况
tps // 对磁盘总共有多少个请求.rtps // 对磁盘总共有多少个读请求.wtps // 对磁盘总共有多少个写请求.bread/s // 磁盘每秒多少个read block.(512bytes/block)bwrtn/s // 磁盘每秒多少个write block.(512bytes/block)
-B 内存页面情况
pgpgin/s // page in from diskpgpgout/s // page out to disk.fault/s // (major+mintor) page faultmajflt/s // major page fault
-c 进程创建情况
proc/s 每秒创建进程个数
-d 块设备运行情况.打印出的dev m-n(major-mior device number)
tps 对这个设备总共有多少个请求.如果多个逻辑请求的话可能会结合成为一个请求.rd_sec/s 每秒读取多少个sector.一个sector 512bytes.wr_sec/s 每秒写入多少个sector.一个sector 512bytes.
-e hh:mm:ss 设置汇报的终止时间-f filename 从文件中读入-h -H 从文件读入时转换称为分析方便的格式-i interval 从文件中读入的话选取interval seconds的间隔的记录-I &irq& | SUM | ALL | XALL 中断统计
&irq& interrupt numberSUM 所有中断次数之和/sALL 前16个中断次数/sXALL 所有中断次数/s.包括APIC
-n DEV | EDEV | SOCK | FULL 网络统计数据
DEV 所有网络接口正常数据EDEV 所有网络接口异常数据SOCK socket数据统计FULL DEV + EDEV + SOCK关于网络接口显示数据在后面会仔细讨论
-o filename 可以将sar输出重定位-P &cpu& | ALL 处理器统计数据-q 处理器请求队列长度以及平均负载
runq-sz 处理器上有多少个进程在等待执行plist-sz 当前有多少个进程运行ldavg-1 过去1分钟系统负载ldavg-5 过去5分钟系统负载ldavg-15 过去15分钟系统负载
-r 内存和swap空间利用率数据
kbmemfree 多少free内存(KB)kbmemused 多少使用内存(KB)(不包括kernel使用)%memused 使用内存率kbbuffers kenel内部使用buffer(KB)kbcached kernel内部使用cache data(KB)kbswpfree swap可用大小(KB)kbswpused swap使用大小(KB)%swpused swap使用比率kbswpcad cached swap内存大小(KB)(曾经被换出现在换入,但是依然占用swap分区)
-R 内存使用数据
frmpg/s free出来的page数目/sbufpg/s 当做buffer使用的page数目/scampg/s 当做cache使用的page数目/s
-s hh:mm:ss 设置汇报起始时间-t 从文件载入时候使用使用原有locale time表示而不是当前locale-u CPU使用情况
%user 用户态CPU占用率%nice 用户态使用nice的CPU占用率%system 内核态CPU占用率%iowait CPU因为等待io的idle比率%idle CPU idle比率
-v inode,file以及kernel tables情况
dentunusd 在directory cache里面没有使用的cache entries个数file-sz 使用文件句柄数inode-sz 使用inode句柄数super-sz 内存使用的超级块句柄数%super-sz 当前超级块句柄数使用比率dquot-sz 磁盘配额分配的entries个数%dquot-sz 磁盘配额分配的entries比率rtsig-sz 排队的RT signals数量%rtsig-sz 排队的RT signals比率
-V 版本号-w 系统切换情况
cswch/s 上下文切换次数/s
-W swap统计数据
pswpin/s 每秒换入swap pagespswpout/s 每秒换出swap pages
-x pid | SELF | ALL& 进程统计数据
minflt/s minor faults/smajflt/s major faults/s%user 用户态CPU利用率%system 内核态CPU利用率nswap/s 每秒换出pagesCPU 处理器编号
-X pid | SELF | ALL 统计子进程数据
cminflt/scmajflt/s%cuser%csystemcnswaps/s
-y TTY设备情况
rcvin/s 每个serial line接收中断数目/sxmtin/s 每个serial line发出中断数目/s
关于网络接口数据显示的话,下面是使用DEV可以查看的字段
IFACE network interfacerxpck/s rcv packets/stxpck/s snd packets/srxbyt/s rcv bytes/stxbyt/s snd bytes/srxcmp/s rcv compressed packets/stxcmp/s snd compressed packets/srxmcst/s 接收多播packets/s
下面是使用EDEV可以查看的字段
rxerr/s 接收bad packets/stxerr/s 发送bad packets/scoll/s 每秒发送packets出现collisions数目rxdrop/s 每秒因为linux缺少buffer而丢弃packetstxcarr/s 每秒发送packets出现carrier-errors数目rxfram/s 每秒接收packets出现frame alignment error数目rxfifo/s 每秒接收packets出现FIFO overrun error数目txfifo/s 每秒发送packets出现FIFO overrun error数目
下面是使用SOCK可以查看的字段
totsock 总共使用socket数目tcpsck 正在使用tcp socket数目udpsck 正在使用udp socket数目rawsck 正在使用RAW socket数目ip-frag 当前使用IP fragments数目
选项非常多,但是很多选项没有必要打开。对于网络程序来说的话,通常我们使用到的选项会包括
-n DEV 网卡流量-n EDEV 网卡丢包以及kerner buffer问题-n SOCK 多少连接-r 内存使用。不常用。很多时候只关心大概使用多少内存,是否持续增长)-u CPU使用 -P ALL查看所有CPU-w 上下文切换。相对来说也不常用。
通常我们使用的命令就应该是sar -n DEV -P ALL -u 1 0(1表示1秒刷新,0表示持续显示)
01时56分18秒
01时56分19秒
01时56分19秒
01时56分19秒
01时56分19秒
01时56分19秒
01时56分18秒
01时56分19秒
01时56分19秒
01时56分19秒
1.2.17 netstat
netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
netstat可以查看很多信息,包括网络链接,路由表,网卡信息,伪装链接以及多播成员关系。但是从文档上看,一部分工作可以在/sbin/ip里面完成
This program is obsolete.
Replacement for netstat is ss.
Replacement
for netstat -r is ip route.
Replacement for netstat -i is ip -s link.
Replacement for netstat -g is ip maddr.
我们这里打算对netstat使用限制在查看网络连接,以及各种协议的统计数据上.
首先我们看看如何查看各种协议的统计数据.
netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] [delay]
我们可以查看和tcp,udp以及raw socket相关的数据,delay表示刷新时间。
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ netstat -s
total packets received
0 forwarded
0 incoming packets discarded
incoming packets delivered
requests sent out
33 dropped because of missing route
30255 ICMP messages received
0 input ICMP message failed.
ICMP input histogram:
echo requests: 30170
echo replies: 83
timestamp request: 2
30265 ICMP messages sent
0 ICMP messages failed
ICMP output histogram:
destination unreachable: 10
echo request: 83
echo replies: 30170
timestamp replies: 2
InType0: 83
InType8: 30170
InType13: 2
OutType0: 30170
OutType3: 10
OutType8: 83
OutType14: 2
860322 active connections openings
199165 passive connection openings
824990 failed connection attempts
43268 connection resets received
17 connections established
segments received
segments send out
56075 segments retransmited
0 bad segments received.
423873 resets sent
68643 packets received
10 packets to unknown port received.
0 packet receive errors
110838 packets sent
1999 invalid SYN cookies received
5143 resets received for embryonic SYN_RECV sockets
2925 packets pruned from receive queue because of socket buffer overrun
73337 TCP sockets finished time wait in fast timer
85 time wait sockets recycled by time stamp
4 delayed acks further delayed because of locked socket
Quick ack mode was activated 7106 times
5141 times the listen queue of a socket overflowed
5141 SYNs to LISTEN sockets ignored
81288 packets directly queued to recvmsg prequeue.
packets directly received from backlog
packets directly received from prequeue
packets header predicted
257396 packets header predicted and directly queued to user
5983677 acknowledgments not containing data received
predicted acknowledgments
2988 times recovered from packet loss due to SACK data
Detected reordering 9 times using FACK
Detected reordering 15 times using SACK
Detected reordering 179 times using time stamp
835 congestion windows fully recovered
1883 congestion windows partially recovered using Hoe heuristic
TCPDSACKUndo: 1806
1093 congestion windows recovered after partial ack
655 TCP data loss events
TCPLostRetransmit: 6
458 timeouts after SACK recovery
7 timeouts in loss state
3586 fast retransmits
178 forward retransmits
425 retransmits in slow start
51048 other TCP timeouts
37 sack retransmits failed
1610293 packets collapsed in receive queue due to low socket buffer
7094 DSACKs sent for old packets
14430 DSACKs received
4358 connections reset due to unexpected data
12564 connections reset due to early user close
29 connections aborted due to timeout
TCPDSACKIgnoredOld: 12177
TCPDSACKIgnoredNoUndo: 347
TCPSackShifted: 6421
TCPSackMerged: 5600
TCPSackShiftFallback: 119131
InBcastPkts: 22
OutOctets:
InBcastOctets: 8810
内容非常多这里也不详细分析了。
然后看看连接这个部分的功能
[address_family_options]
[--tcp|-t]
[--udp|-u]
[--raw|-w]
[--listening|-l]
[--all|-a]
[--numeric|-n]
[--numeric-
hosts][--numeric-ports][--numeric-ports]
[--symbolic|-N]
[--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v]
[--continuous|-c] [delay]
对于address_family允许指定协议族,通常来说我们可能会使用
–unix -x unix域协议族–inet –ip ip协议族
然后剩下的选项
–tcp -t tcp socket–udp -u udp socket–raw -w raw socket–listening -l listen socket–all -a listen socket和connected socket.–numeric -n–numeric-hosts–numeric-ports–numeric-users–symbolic -N ???–extend -e 扩展信息–timers -o 网络计时器信息(???)–program -p socket所属program–verbose -v–continuous -c 1s刷新delay 刷新时间(sec)
我们看看一个使用的例子
[zhangyan04@tc-hpc-dev.tc.baidu.com]$ netstat --ip --tcp -a -e -p
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address
Foreign Address
PID/Program name
0 tc-hpc-dev.tc.baidu.c:19870 *:*
zhangyan04
28965/echo_server
0 tc-hpc-dev.tc.baidu.c:19870 tc-com-test00.tc.baid:60746 ESTABLISHED zhangyan04
28965/echo_server
1024 tc-hpc-dev.tc.baidu.c:19870 tc-com-test00.tc.baid:60745 ESTABLISHED zhangyan04
28965/echo_server
下面是对于tcp socket的字段解释.对于unix domain socket字段不同但是这里不写出来了.
Proto socket类型Recv-Q 在这个socket上还有多少bytes没有copy到用户态Send-Q 在这个socket还有多少bytes没有ackLocal Address 本地地址Foreign Address 远程地址State 连接状态
ESTABLISHEDSYN_SENTSYN_RECVFIN_WAIT1FIN_WAIT2TIME_WAITCLOSEDCLOSE_WAIT 大量状态表示服务器句柄泄露LAST_ACKLISTENCLOSINGUNKNOWN
UserPID/Program name
1.2.18 tcpdump
todo(zhangyan04):
1.2.19 iftop
todo(dirlt):
1.2.20 iftraf
todo(dirlt):
1.2.21 rsync
常用选项:
-a –archive-r –recursive-v –verbose-z –compress
常用命令:
同步目录 rsync -avrz dir user@host:/dir/ note(dirlt):注意目录后面需要加上/同步文件 rysnc -vz /dir/file1 user@host:/dir/file
1.2.22 iodump
1.2.23 iopp
1.2.24 nethogs
todo(d

我要回帖

更多关于 英国vz特调 的文章

 

随机推荐