Operating System - HP-UX
1819804 Members
3159 Online
109607 Solutions
New Discussion юеВ

vxfs filesystem fragmentation

 
SOLVED
Go to solution
Adam Garsha
Valued Contributor

vxfs filesystem fragmentation

1. It looks like the way to check fragmentation is "fsadm -F vxfs -E /filesystem", correct?

2. Is it ok to check fragementation while filesystem is live in production (is there any noticible performance impact)?

3. What is consider "Bad" fragmentation by your favorite rule of thumb?
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: vxfs filesystem fragmentation

Adam,

I run this once a week via cron:


for i in `bdf -l |grep -v Filesystem |awk '{ print $6 }'`
do
if [ $i != "/stand" ]; then
echo "Re-Org'ing " $i
fsadm -F vxfs -d -D -e -E $i
fi
done


This adds directory reorganization to the extent reorganization you specified. Cron'ing it in the middle of the night avoids any negative impact. Running it once a week ensures that I will not have "Bad" fragmentation.


Pete

Pete
Peter Godron
Honored Contributor
Solution

Re: vxfs filesystem fragmentation

Adam,
1. Correct Syntax

2. Will impact on performance, run out-of-hours if possible

3. See http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=86624

Another way to measure: Just before the user notices it.

Adam Garsha
Valued Contributor

Re: vxfs filesystem fragmentation

I will hold points until I get a few responses.
Geoff Wild
Honored Contributor

Re: vxfs filesystem fragmentation

Here's what I run from cron weekly:

#defrag filesystems
0 22 * * 4 /usr/local/bin/fsadm.defrag >/dev/null 2>&1


# cat /usr/local/bin/fsadm.defrag
#!/bin/sh
# defrag all mounted file systems
LOG=/tmp/fsadm.defrag.log
if [ -f $LOG ]
then
mv $LOG $LOG.old
fi
cat /dev/null > $LOG

for i in `mount -l | grep -v stand |awk '{print $1}'`
do
echo "defraging " $i "at "`date` >> $LOG
fsadm -F vxfs -d -D -e -E $i >> $LOG
done


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
A. Clay Stephenson
Acclaimed Contributor

Re: vxfs filesystem fragmentation

In almost all cases, don't expect very much in the way of performance improvements from this. Vxfs filesystems are already extent-based which means that they try to allocate large chunks of a file. Only in exceptional cases, have I ever seen improvements more than 1-3% even for what appears to be a highly fragmented vxfs filesystem. In real life, running fsadm once every 3 months or so will be almost as good as weekly.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: vxfs filesystem fragmentation

Shalom,

I didn't see it mentioned that Online JFS is a requirement for this.

I found that running this caused my SAN admins headaches with high I/O, so schedule it for a time that load is light.

A. Clay is always right, the performance payback isn't real huge, but every little bit helps.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Adam Garsha
Valued Contributor

Re: vxfs filesystem fragmentation

Is there any performance impact just to look, but not to fix?
A. Clay Stephenson
Acclaimed Contributor

Re: vxfs filesystem fragmentation

There is, of course, some performance impact but it is small --- but if you are looking for significant performance gains then look elsewhere.
If it ain't broke, I can fix that.
Adam Garsha
Valued Contributor

Re: vxfs filesystem fragmentation

Yes, I don't think fragmentation is a problem, but I need to convince some folks.

I haven't seen fragmentation being a problem on any modern unix filesystem. (That's why I know so little about defraging vxfs... because my knee-jerk reaction is always "that ain't the problem")

Bill Hassell
Honored Contributor

Re: vxfs filesystem fragmentation

> Yes, I don't think fragmentation is a problem, but I need to convince some folks.

This *ALWAYS* happens because 'some folks' only know one kind of OS and see everything else with the same viewpoint. Sort of like: If you only have a hammer in your hand then all your problems tend to look like nails.

One of the most common requests for defragmentation comes from authors of lousy SQL code.


Bill Hassell, sysadmin
Adam Garsha
Valued Contributor

Re: vxfs filesystem fragmentation

above.