# low perfomance throuch mdconfig layer



## Ole (Feb 3, 2009)

Hello,

I've see big difference between "native" ufs partition and ufs-image when working with it through mdconfig. In original, i try setup some "image" for jail, which located in 1 file and which
easy for migrate (transfer) to other station. But low I/O level stopping me. 

test on i386 machine (i've used glabel):


> df -h /usr
> Filesystem      Size    Used   Avail Capacity  Mounted on
> /dev/ufs/usr     44G     13G     27G    33%    /usr


Make empty dir for makefs last arguments.


> [root@ ~]# mkdir /tmp/empty


Make 10 gb empty image file


> [root@ ~]# makefs -s10g /usr/test.img /tmp/empty
> Calculated size of `/usr/test.img': 10737418240 bytes, 2 inodes
> 
> 
> ...


attach loop mount with mdconfig


> [root@ ~]# mdconfig -a -t vnode -f /usr/test.img
> md0


Benchmark for native partition


> [root@ ~]# diskinfo -t ufs/usr
> ufs/usr
> 512             # sectorsize
> 48657399808     # mediasize in bytes (45G)
> ...


Bench for image


> [root@ ~]# diskinfo -t md0
> md0
> 512             # sectorsize
> 10737418240     # mediasize in bytes (10G)
> ...




And benchmark of image on amd64:


> diskinfo -t md0
> md0
> 512             # sectorsize
> 10737418240     # mediasize in bytes (10G)
> ...



When "native" result on some machine:


> diskinfo -t aacd0s1f
> aacd0s1f
> 512             # sectorsize
> 136493421568    # mediasize in bytes (127G)
> ...



*++UPDATE*. Low perfomance i see when md0 is mounted. I assume that
difference for 10-20.000 kbytes/sec is the cost in re-presentation mapping mechanism for mdconfig. But when md0 is mounted, I/O is very poor (< 10 Kbytes/sec).


----------

