Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Benchmarking is a testing technique that enables you to measure performance based

on a set of standards, or benchmarks.

Set clear objectives for the benchmark tests.


Define environmental factors.
o What applications do you plan to run over the file system

If the environment is complex and has too many variables, then you are not able to
perform effective benchmarks.
Using the vxbench program, you can test environments that incorporate the
following features:

All VxFS and UFS file system options


Raw I/O, UFS, or VxFS partitions
Different I/O sizes
Random and sequential I/O
Multiple I/O streams

vxbench -w workload [ options ] filenam e . . .


In the syntax, you specify the command followed by a type of workload. Valid
workloads are:
read

Performs a sequential read of the test files

write

Performs a sequential write of the test files

rand_read

Performs a random read of the test files

rand_write

Performs a random write of the test files

rand_mixed

Performs a mix of random reads and writes

mmap_read

Uses mmap to read the test files

mmap_write

Uses mmap to overwrite the test files

Option
-h

Use

-P

Uses processes for users and uses threads for


multithreaded I/O (This is the default option.)

-p

Uses processes for users and for multithreaded


I/O

-t

Uses threads for users and for multithreaded


I/O

-m

Locks I/O buffers in memory

-s

For multiuser tests, only prints summary


results

-v

For multithreaded tests, prints per-thread


results

-k

Prints throughput in kbytes/sec

Prints a detailed help message

(This is the default option.)


-M

Prints throughput in mbytes/sec

-i [suboptions] Specifies suboptions describing the test you


want to perform

To measure the I/O throughput of sequentially writing a 1024-MB file in 8K blocks,


using the file testfile01 at the mount point /mnt:
# vxbench -w write -i iosize=8,iocount=131072 /m nt/testfile01
To measure a random workload for writes in 8K blocks for a maximum file size of
1024 MB:
# vxbench -w rand_write -i iosize=8,iocount=131072,
m axfilesize=1048576 /m nt/testfile01
Tasks a file system supports include:

Creating a directory structure to manage files


Creating and deleting files
Reading and writing file data
Controlling file access and authentication

Metadata comprises the structural information of the file system.


1. An application makes an I/O request by issuing a system call to read or write
data to a file. The format of this call is:
read(fd, buffer, count)
o
o
o

fd is the file descriptor that identifies the file to read from.


buffer is the address of the memory location within the application
into which the data is to be copied by the read.
count is the number of bytes to be read by the read I/O request.

2. From this, the file system identifies the sequence of file system blocks that
contain the relevant portion of the file.
3. The file system checks the buffer cache to verify whether or not the required
blocks are already in memory.
o If the blocks are in memory, the requested data is copied from those
blocks into the defined buffer.
o If the blocks are not in memory, the blocks must first be retrieved
from the underlying storage device.
4. Using a mapping function (index tables), the file system converts the logical
block address to the corresponding physical disk block address of the data.
Metadata must be processed before any data is retrieved.

5. After the physical block address is determined, the request is sent to the
underlying storage hardware device driver.
6. The file system request passes from the device driver to the storage device
where all data is physically stored. The data then passes back up through the
file system layers and returns to the calling application.
Common disk allocation methods are:

Contiguous IBM VX
Linked MS DOS
Indexed VxFS UFS

Contiguous allocation is a method of storing a file in adjacent disk blocks.


Linked allocation is a method that involves the use of pointers to link disk blocks
together by reference.
In an indexed allocation system, every file is associated with an index block.
However, VxFS allocation is extent-based, while UFS allocation is block-based.

Block-based allocation: File systems that use block-based allocation assign


disk space to a file one block at a time.

Extent-based allocation: File systems that use extent-based allocation


assign disk space in groups of contiguous blocks, called extents.

UFS allocates space for files one block at a time. When allocating space to a file.
Block-based allocation requires extra disk I/O to write file system block structure
information, or metadata. Over time, block-based allocation produces a fragmented
file system with random file access.
VERITAS File System selects a contiguous range of file system blocks, called an
extent, for inclusion in a file. The number of blocks in an extent varies and is based
on either the I/O pattern of the application, or explicit requests by the user or
programmer. Extent-based allocation enables larger I/O operations to be passed to
the underlying drivers.
Each file is associated with an index block, called an inode. In an inode, an extent is
represented as an address-length pair, which identifies the starting block address
and the length of the extent in logical blocks.
VxFS automatically selects an extent size that is based on the size of I/O write
requests.
A VxFS inode contains:

Information about a file, such as access times, file type, size, and permissions
Address blocks that identify the location of each extent allocated to the file

There are two types of address blocks within an inode:

Direct address blocks contain addresses to the extents allocated to a file.


Indirect address blocks contain pointers to associated address blocks that
contain addresses to the extents allocated to a file.

To display information about inodes and file system structure, you can use the ff
and ncheck commands. The ff command provides a quick view of files in a file
system, and the ncheck command provides a more detailed, structural view of the
file system.
VxFS selects a logical block size of 1K, 2K, 4K, or 8K, depending on the file system
size:
File System Size

VxFS Logical Block Size

x < 8 GB

1024 bytes (1K)

8 GB < x < 16 GB

2048 bytes (2K)

16 GB < x < 32 GB

4096 bytes (4K)

x > 32 GB

8192 bytes (8K)

The extent attributes of a file define the extent allocation policy for the file. Without
extent attributes, space is allocated to a file on the basis of extents of increasing
size.
setext [-e extent_size ] [-f flags ] [-r reservation ] file
Use the -e option to specify a fixed extent size.
Use the -r option to preallocate, or reserve, space for a file.
Use the -f option to set allocation flags. You specify multiple flags by entering
multiple instances of -f on the command line. Available allocation flags are:
Flag
align

Description

chgsize

Immediately incorporates the reservation into the file


and updates the inode with size and block count
information

contig

Specifies that the reservation be allocated contiguously

noextend

Specifies that the file may not be extended after the


preallocated space is used

noreserve

Specifies that the reservation is not a persistent


attribute of the file. The space reserved is allocated only
until the final close of the file, and then is freed. The
temporary reservation is not visible to the user.

Specifies that all extents must be aligned on


extent_size boundaries relative to the start of
allocation units

trim

Specifies that the reservation is reduced to the current


file size after the last close by all processes that have
the file open

Using the setext command, reserve 36 file system blocks for the file file1, specify
a fixed extent size of 3 blocks, and align extents to 3-block boundaries. The file may
not be extended after the preallocated space is used.
# setext -r 36 -e 3 -f align -f noextend file1
You can view the extent attribute information associated with a file or set of files by
using the getext command:
getext [-f] [-s] file . . .
In the syntax, you specify the command, options, and the name of the file or files for
which you want to display information.

You add the -f option if you do not want to print the file name.
You add the -s option if you do not want to print output for files without fixed
extent sizes or reservations.

The getext command is located in /opt/VRTSvxfs/sbin.


To specify extent-aware versions of standard commands, you use the -e option. The
-e option specifies extent preservation behavior and can be used with one of three
values:
Option
-e warn

Description

-e force

Causes a copy to fail if extent information cannot be


preserved

-e ignore

Does not try to preserve extent information

Prints a warning if extent information cannot be preserved


(This is the default option.)

The four versions of the VERITAS file system layout are:


Version 1

The Version 1 layout was the original layout for VxFS


release 1.x. This version introduced intent logging, extent
allocation, and unlimited inodes.

Version 2

The Version 2 layout was introduced with VxFS release


2.x. This version added dynamic inode allocation and
support for access control lists and quotas to the Version 1
layout.

Version 3

The Version 3 layout is specific to the HP-UX operating


system.

Version 4

The Version 4 layout is the latest file system layout and

was introduced with VxFS release 3.2.x. The Version 4


layout added large file support and the ability for extents
to span allocation units.
To upgrade the VxFS file system layout, you use the vxpgrade command. The
vxupgrade command only operates on file systems mounted for read/write access.
The syntax for the command is:
vxupgrade [-n new_version ] [-o noquota] [-r rawdev ] m ount_point
A VxFS with Version 2 file system layout is mounted at /mnt. To upgrade this file
system to Version 4 layout, you type:
# vxupgrade -n 4 /m nt
To display the file system layout version number of a VERITAS file system mounted
at /mnt, you type:
# vxupgrade /m nt
VxFS layout Version 4 includes the following structural components:

Allocation units
Structural files

With VxFS layout Version 4, the entire file system space is divided into fixed-size
allocation units. The first allocation unit starts at block zero, and all allocation units
are a fixed length of 32K blocks.
All structural information about the file system is contained in files within a structural
fileset. With the exception of the superblock, which has a known location, structural
files are not stored in a fixed location.
To take advantage of VxFS structural components that are designed to help minimize
fragmentation, you can convert existing UFS file systems to VERITAS file systems by
using the vxfsconvert utility.
Free space required by vxfsconvert is approximately 12 to 15 percent of the total
file system
Running vxfsconvert takes approximately two to three times longer than running
file system-specific fsck on UFS.
Conversion options include:
Option
-e

Description
This option estimates the amount of space required to

complete the conversion.


-f

This option displays the list of supported file system types

-n|N|y|Y

Use these options to assume a Yes ( y|Y) or No ( n|N)

-s size

This option specifies the amount of available disk space at


the end of the file system. size is in kilobytes. Disk space
required for the conversion process is taken from the end of
the file system.

-v

This option specifies verbose mode, which shows the


progress of the conversion process for every inode
converted.

VxFS addresses two types of fragmentation:

Directory fragmentation
As files are created and removed, gaps are left in directory inodes. This is
known as directory fragmentation. Directory fragmentation causes directory
lookups to become slower.

Extent fragmentation
As files are created and removed, the free extent map for an allocation unit
changes from having one large free area to having many smaller free areas.
Extent fragmentation occurs when files cannot be allocated in contiguous
chunks and more extents must be referenced to access a file.

You use the fsadm command to run reports on both directory and extent
fragmentation.

The fsadm -D command reports on directory fragmentation.


The fsadm -E command reports on extent fragmentation.

Unfragmented

Badly
Fragmented

Percentage of free space in


extents of less than 64 blocks
in length

< 5%

> 50%

Percentage of free space in


extents of less than 8 blocks
in length

< 1%

> 5%

Percentage of total file system


size in extents of length 64
blocks or greater

> 5%

< 5%

Percentage

Option Description
-d
The -d option reorganizes directories. Directory entries
are reordered to place subdirectory entries first, then all
other entries in decreasing order of time of last access.

The directory is also compacted to remove free space.


-a

You can use the -a option in conjunction with the -d


option to consider files not accessed within the specified
number of days as "aged" files. Aged files are moved to
the end of the directory. The default is 14 days.

-e

The -e option reorganizes extents. Files are reorganized


to have the minimum number of extents.

-D, -E

The -D and -E options produce reports on directory and


extent fragmentation, respectively.

-v

The -v option specifies verbose mode and reports


reorganization activity. You can use the -v option to
examine the amount of work performed by fsadm. You
can adjust the frequency of reorganization based on the
rate of file system fragmentation.

-l

The -l option specifies the size of a file that is considered


large. The default is 64 blocks. Extent reorganization tries
to group large files into large extents of at least 64 blocks.

-t

The -t option specifies a maximum length of time to run


in seconds.

-p

The -p option specifies a maximum number of passes to


run. By default, fsadm runs five passes.

-s

The -s option prints a summary of activity at the end of


each pass.

-r

The -r option specifies the pathname of the raw device to


read to determine file layout and fragmentation. This
option is used when fsadm cannot determine the raw
device.

If you use the -D and -E with the -d and -e options, the fragmentation reports are
produced both before and after the reorganization.
Defragmenting extents, called extent reorganization, can improve performance.
During extent reorganization:

Small files (less than 64K) are made into one contiguous extent.
Large files are built from large extents.
Small and recently used (less than 14 days) files are moved near the inode
area.
Large or old files (more than 14 days since last access) are moved to the end
of the allocation unit.
Free space is clustered in the center of the data area.

VERITAS File System provides fast file system recovery after a system failure by
using a tracking feature called intent logging, or journaling.

The intent log records pending changes to the file system structure and writes the
log records to disk in advance of the changes to the file system.
The VxFS version of the fsck utility performs an intent log replay to recover a file
system without completing a full structural check of the entire file system. The time
required for log replay is proportional to the log size, not the file system size.
The intent log is a circular activity log with a default size of 1024 blocks.
The syntax for the fsck command is:
fsck [-F vxfs] [ generic_options ] [-y|Y] [-n|N]
[-o full,nolog] [-o p] special
To check file system consistency by using the intent log for the VERITAS file system
on the volume datavol, you type:
# fsck -F vxfs /dev/vx/rdsk/datadg/datavol
To perform a full file system check without using the intent log for the VERITAS file
system on the volume datavol, you type:
# fsck -F vxfs -o full,nolog /dev/vx/rdsk/datadg/datavol
To check two file systems in parallel using the intent log:
# fsck -F vxfs -o p /dev/rdsk/c1t2d0s4 /dev/rdsk/c1t0d0s5
Applications invoke I/O operations in two general ways:

Synchronously
Asynchronously

You might also like