Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Understanding Defragfs

Status
Not open for further replies.

jpor

Technical User
Nov 29, 2000
212
GB
Hi All,

Currently having performance issues with programs and files. We curently run an Informix SE 7 database and since I have taken over the administration of the H70 RS6000 running AIX 4.3.3 ML9, we had an anormous amount of slow down on the system. We are currently doing maintenance to the database files to decrease data and maximise the read potential of the tables.

The current system is pretty much maxed out in terms of hardware. I.e 4 x 340Mhz CPUs, 4 GB RAM, 128B 12 x 9.1GB SSA, 1 x 18GB SCSI internal drive.

Everything is pretty much load balanced and we average 110 remote users and 250 other connections.

I currently monitor everything using nmon and monitor.

Anyway after that. I am planning on running degragfs on the file systems as this is very rarely executed. I tried the command on the /tmp directory and when it runs it gives back information I don't really understand. At the moment I am using a book called 'The AIX Survival Guide', but this doesn't explain the output given by defragfs. can anyone please explain this to me.

( "To become Wise, first you must ask Questions")
 
The only time I have used defragfs is when it showed up in the errpt saying that a particular filesystem needed to be defragged.

The syntax is `defragfs /your/filesystem` and (without looking at the man page) the '-r' option will show you stats without performing the action.
 
Thanks KHS.

I don't think I made myself clear on my original posting. Basically when you run the defrag command it brings back information like this:

defragfs /tmp
statistics before running defragfs:
number of free fragments 162434
number of allocated fragments 42366
number of free spaces shorter than a block 0
number of free fragments in short free spaces 0

statistics after running defragfs:
number of free spaces shorter than a block 0
number of free fragments in short free spaces 0

other statistics:
number of fragments moved 435
number of logical blocks moved 435
number of allocation attempts 95
number of exact matches 13

How do you know how badly the filesystem was fragmented?
And how much defragging was needed.

Thanks again.

( "To become Wise, first you must ask Questions")
 
From a google search on defragfs. This should answer your question better than I could explain it:

For JFS file systems, using fragments smaller than 4096 bytes can cause greater fragmentation of the free space on the disk. For example, consider an area of the disk that is divided into eight fragments of 512 bytes each. Suppose that different files, requiring 512 bytes each, have written to the first, fourth, fifth, and seventh fragments in this area of the disk, leaving the second, third, sixth, and eighth fragments free. Although four fragments representing 2048 bytes of disk space are free, no partial logical block requiring four fragments (or 2048 bytes)is allocated for these free fragments, since the fragments in a single allocation must be contiguous.

Because the fragments allocated for a file or directory logical blocks must be contiguous, free space fragmentation can cause a file system operation that requests new disk space to fail even though the total amount of available free space is large enough to satisfy the operation. For example, a write operation that extends a zero-length file by one logical block requires 4096 bytes of contiguous disk space to be allocated. If the file system free space is fragmented and consists of 32 noncontiguous 512-byte fragments or a total of 16 KB of free disk space, the write operation will fail because eight contiguous fragments (or 4096 bytes of contiguous disk space) are not available to satisfy the write operation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top