10
22
2014
13

获取日志区访问所占总访问量的百分比

获取文件系统负载工具如postmark,filebench等对文件系统日志区的访问所占访问的百分比。
 
准备工作:格式化测试盘,并将格式化的盘挂载
mkfs -t ext4 /dev/sdd1
mount /dev/sdd1 /home/tss/test-disk
 
 
step1:查看要测试磁盘中日志区的范围
查看/dev/sdd1磁盘中日志区的范围
在ext4中日志区由inode号8来指示,通过debugfs查看inode 8 所向的对应区域
 
debugfs /dev/sdd1
stat <8>
Inode: 8   Type: regular    Mode:  0600   Flags: 0x80000
Generation: 0    Version: 0x00000000:00000000
User:     0   Group:     0   Size: 134217728
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 262144
Fragment:  Address: 0    Number: 0    Size: 0
ctime: 0x54477848:00000000 -- Wed Oct 22 17:26:32 2014
atime: 0x54477848:00000000 -- Wed Oct 22 17:26:32 2014
mtime: 0x54477848:00000000 -- Wed Oct 22 17:26:32 2014
crtime: 0x54477848:00000000 -- Wed Oct 22 17:26:32 2014
Size of extra inode fields: 28
EXTENTS:
(0-32766):15761408-15794174, (32767):15794175
 
上述红色部分表示的是日志结点所对应的磁盘块号。
 
 
step2:运行postmark脚本并用blktrace检测结果
2.1在/home/tss/test-disk中运行如下postmark的脚本
root@f304-PowerEdge-R710:/home/tss/test-disk# postmark postmark.cfg
其中postmark.cfg的脚本内容如下 
set size 1000 5000
set transactions 500
set number 500
run
quit
 
2.2通过blktrace来捕捉postmark的动作
root@f304-PowerEdge-R710:/home/tss/script# ./blktrace.sh postmark
其中blktrace.sh脚本如下
#!/bin/sh
blktrace -d /dev/sdd1 -o -| blkparse -i - -o $1
 
step3:分析blktrace检测结果,得到访问日志区所占访问总量的百分比
blktrace的内容通过脚本分析,提取动作为A的项,并在动作为A的项中统计访问日志区的次数
脚本如下:
#!/bin/sh
awk '{if($6=="A")print ($8-2048)/8;i++}END {print "i="i}' $1>$2
awk '{if(($1>=15761408)&&($1<=15794175)){j++;}}END {print "j="j}' $2
 
其中第一个awk语句把A行所表示的扇区号转化为对应的块号。
其中第二个awk语句根据上述debugfs检查得到的日志区范围进行统计。
 
其中输入文件$1为上述红色标记blktrace捕捉输出文件的名字。
输出文件$2统计动作为A的行,最后一行awk语句记录访问日志区的数目。(通过j= ** 来指示)
由此可以计算出访问日志区占所有访问的比例。(j/i)

 

Category: 文件系统 | Tags: | Read Count: 2360
Avatar_small
전설 서구 说:
2021年3月02日 20:02

Thanks so much for sharing this awesome info! I am looking forward to see more postsby you! 123movies

Avatar_small
CGBSE Model Paper Cl 说:
2022年9月05日 20:06

CG Board Model Paper 2023 Class 12 Pdf Download with Answers for English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams at official website. CGBSE Model Paper Class 12 New Exam Scheme or Question Pattern for Sammittive Assignment Exams (SA1 & SA2): Very Long Answer (VLA), Long Answer (LA), Small Answer (SA), Very Small Answer (VSA), Single Answer, Multiple Choice and etc.

Avatar_small
Creative Agency 说:
2022年11月26日 19:31

Human-centered Design
Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! Keep rocking.

Avatar_small
Creative Agency 说:
2022年11月26日 22:56

The information you have posted is very useful. The sites you referred were good. Thanks for sharing this.

Avatar_small
rhoer jackets 说:
2022年12月17日 18:19

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post.

Avatar_small
Alyssa 说:
2023年1月04日 22:00

A log area is defined as an area of a website where users are required to log in. In order to calculate the percentage of log area visits leading specialist in digital marketing to the total visits, we would need to track the number of visitors to both the log area and the total visits of the website. This information can be found through web analytics. Once we have these numbers, we can simply divide the number of log area visits by the total visits to get the desired percentage.

Avatar_small
Website 说:
2023年1月28日 00:47

Buy Instagram pva accounts
Thanks for a wonderful share. Your article has proved the hard work and the experience you have got in this field. Brilliant. I love it reading.

Avatar_small
Website 说:
2023年1月28日 02:43

Gmail PVA accounts
Wow, I can say that this is another great article as expected of this blog. Bookmarked this site.

Avatar_small
Bharat Sanchar Nigam 说:
2023年1月31日 14:56

Fourth Generation BSNL 4G SIM upgradation is now live with simple SMS codes, Find the new technology updates readily available for you to get enhance your technical knowledge with evergreen how-to guides along with new latest updates of Bharat Sanchar Nigam Limited. Bharat Sanchar Nigam Limited BSNL SIM card in this new season along with the existing offers of Bharat Sanchar Nigam Limited, where the operator introduces, free upgradation offer to customers with 4G replacement SIM those who are using 2G or 3G SIMS.

Avatar_small
Website 说:
2023年2月02日 00:54

Buy Instagram PVA Accounts
I am definitely enjoying your website. You definitely have some great insight and great stories.

Avatar_small
Website 说:
2023年2月02日 02:51

Kitchen Remodeling Contractor Saratoga
This is the first time I am visiting here. I found so much interesting stuff in your blog, especially its discussion. From the tons of comments on your articles. I guess I am not the only one having all the enjoyment here! Keep up the good work.

Avatar_small
192.168.1.1 说:
2023年2月02日 21:57

Do you own a router or modem, then you might have heard about the term Internal configuration and router configuration which are very important to do when you first buy a new router or when you have just reset a router. 192.168.1.1 Frankly speaking, there are hundreds of router brands across the world and every one of them has high end router models that have a different configuration process.

Avatar_small
Website 说:
2023年2月06日 01:07

Instagram pva accounts
This is the first time I am visiting here. I found so much interesting stuff in your blog, especially its discussion. From the tons of comments on your articles. I guess I am not the only one having all the enjoyment here! Keep up the good work.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter

Host by is-Programmer.com | Power by Chito 1.3.3 beta | Theme: Aeros 2.0 by TheBuckmaker.com