Skip to content

Commit 916539c

Browse files
author
fred
committed
OSS/OST documentation
1 parent 153846c commit 916539c

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

Diff for: README.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ those devices.
99

1010
##Example usages
1111

12-
### MDS
12+
### MDS/MDT
1313

1414
On a MDS, initialize a lustre_mds object and use it to get a
1515
lustre_mds_stats object at regular interval. Compare 2 lustre_mds_stats
@@ -68,3 +68,62 @@ nb_setattr=37349033
6868
nb_link=358
6969
nb_statfs=875795
7070
```
71+
72+
### OSS/OST
73+
On an OSSS, initialize a lustre_oss object and use it to get a
74+
lustre_oss_stats object at regular interval. Compare 2 lustre_oss_stats
75+
to calculate the activity between the 2 timestamps.
76+
77+
Average request waittime would be:
78+
(oss_stats2.req_waittime - oss_stats1.req_waittime) / (oss_stats2.req - oss_stats1.req)
79+
80+
```
81+
>>> from lustre_util import *
82+
>>> oss_stats = lustre_oss.get_OSS_stats()
83+
>>> print "OSS nb threads={0}".format(oss_stats.nb_threads)
84+
OSS nb threads=192
85+
>>> print "OSS nb requests={0}".format(oss_stats.req)
86+
OSS nb requests=86688783
87+
>>> print "OSS request wait time={0}".format(oss_stats.req_waittime)
88+
OSS request wait time=148960010965
89+
>>> print oss_stats.timestamp
90+
1429026158.35
91+
>>>
92+
```
93+
Iterate over OSTs (lustre_ost) on that oss to get their state and IO
94+
counters through lustre_ost_stats. Compare 2 lustre_ost_stats object
95+
to calculate average IOPS over the delta of their respective timestamp.
96+
97+
With little changes, this could also be run on the MDS to have an easier
98+
aggregate of disk usage. For now, disk usage for the FS is the sum of
99+
KB_total on all OSTs.
100+
101+
```
102+
>>> for ost in lustre_ost.get_OSTs():
103+
... print "OST={0}".format(ost.name)
104+
... (total, count) = ost.get_disk_usage()
105+
... print "KB_total={0}".format(total)
106+
... print "KB_used={0}".format(count)
107+
... (total, count) = ost.get_inode_usage()
108+
... print "inodes_total={0}".format(total)
109+
... print "inodes_used={0}".format(count)
110+
... stats = ost.get_stats()
111+
... print "read_bytes={0}".format(stats.read_bytes)
112+
... print "write_bytes={0}".format(stats.write_bytes)
113+
... print "read_count={0}".format(stats.read_count)
114+
... print "write_count={0}".format(stats.write_count)
115+
...
116+
OST=lustre1-OST0002
117+
KB_total=30476265216
118+
KB_used=24698989696
119+
inodes_total=54089535
120+
inodes_used=8954570
121+
read_bytes=24153136496640
122+
write_bytes=20812013882221
123+
read_count=60069567
124+
write_count=25409128
125+
```
126+
Additionnally, if running on ldiskfs, some brw_stats are available from
127+
lustre_ost_stats.IO_size_KB
128+
129+

0 commit comments

Comments
 (0)