|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
|||
ZFS and Database fragmentation
Because of this post I did a little bit of research and found this interesting article discussing fragmentation on ZFS: ZFS and Database fragmentation
I haven't used ZFS for databases yet, but according to that article it seems to be a real problem. Has anyone here run into this problem?
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
@J65nko
Its not a database problem, its ZFS problem for all data. Typical write is: Code:
POOL: WRITE METADATA1 POOL: WRITE DATA1 POOL: ERASE METADATA1 POOL: WRITE METADATA2 POOL: WRITE DATA2 POOL: ERASE METADATA2 Code:
ZIL: WRITE METADATA1 POOL: WRITE DATA1 ZIL: ERASE METADATA1 ZIL: WRITE METADATA2 POOL: WRITE DATA2 ZIL: ERASE METADATA2 You can check current ZFS fragmentation level with this script: zfs-fragmentation.sh Code:
#! /bin/sh if [ ${#} -ne 1 ] then echo "usage: $( basename ${0} ) POOL|DATASET" exit 1 fi zdb -ddddd ${1} | awk --non-decimal-data \ ' /Indirect blocks/ { file_number++; next_block = 0; } /L0/ { split($3, fields, ":"); this_block = ("0x"fields[2])+0; this_block_size = ("0x"fields[3])+0; total_blocks++; if( next_block != 0 ) { if( next_block == this_block ) { not_fragmented++; } else { fragmented++; } } next_block = this_block + this_block_size; } END { total_fragment_blocks = fragmented + not_fragmented; printf("There are %d files.\n", file_number ); printf("There are %d blocks and %d fragment blocks.\n", total_blocks, total_fragment_blocks ); printf("There are %d fragmented blocks (%2.2f%%).\n", fragmented, fragmented*100.0/total_fragment_blocks ); printf("There are %d contiguous blocks (%2.2f%%).\n", not_fragmented, not_fragmented*100.0/total_fragment_blocks ); } ' [1] Rebuild 4-way RAID5 into 5-way RAID5 or remove disks from pool.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
When is a database not so relational? | J65nko | News | 1 | 23rd May 2011 05:38 AM |
Xtracting Data after Fragmentation / Block Count / Partition Problems on Boot | IronForge | OpenBSD Installation and Upgrading | 3 | 16th December 2010 01:09 AM |
Huge FTP transfer file fragmentation problem under Windows | eakinasila | Other OS | 2 | 13th December 2009 02:50 PM |
PHP database interfaces | TerryP | Programming | 6 | 11th September 2008 01:03 PM |
Slocate database coverage | ivanatora | FreeBSD General | 2 | 4th August 2008 08:51 AM |