mksnap_ffs time

Daan Vreeken [PA4DAN] Danovitsch at vitsch.net
Thu Jan 3 15:21:27 PST 2008


Hi Hackers,

I'm running a 6.2-RELEASE server with a /home partition that's used to backup 
a customer's data. The backups are being made during the night. Since a 
couple of weeks I'm running mksnap_ffs daily to create filesystem snapshots 
of the data. I've been logging the time it takes mksnap_ffs to create it's 
snapshot. Here are the 'time' numbers for the last 11 days :
1696.25 real         0.00 user        16.55 sys
1884.09 real         0.00 user        18.63 sys
2038.50 real         0.00 user        20.72 sys
2354.69 real         0.00 user        25.07 sys
2202.43 real         0.00 user        23.08 sys
2621.88 real         0.00 user        27.46 sys
2791.46 real         0.00 user        29.57 sys
2845.48 real         0.00 user        31.69 sys
2894.24 real         0.00 user        32.60 sys
3085.37 real         0.00 user        35.62 sys
3253.11 real         0.00 user        37.25 sys

Right now the filesystem contains 'just' 16 snapshots. The filesystem itself 
is a 700GB partition :
# df
Filesystem    1K-blocks      Used     Avail Capacity  Mounted on
...
/dev/twed0s3d 700905640 271350848 373482342    42%    /home

The filesystem has been created with default newfs flags. Today the filesystem 
contains 186615 files. Average file size is about 140 to 150KB. The data 
consists of lots of very small files, lots of middle-sized files, and a bunch 
of huge files, so 'average' file size might not be a very good measure.
Every day between 300 to 400MB of data is changed/added. The time it takes to 
take another snapshot seems to increase with about 140 seconds a day. If the 
snapshot time keeps increasing in this fashion, the server will spend half of 
it's time in a day creating snapshots by the end of the year ;-)

1) Is anyone else seeing this?
2) Is there anything that can be done to improve snapshot creation time?
3) Is this something that has already been improved in version X of FreeBSD?

And just for my own curiosity:
Where does mksnap_ffs spend most of it's time? Is this something that simply 
can't be changed by the nature of UFS, or is it a known deficiency in the 
code that could by improved somehow?

(btw: I can provide more information on the hardware or the filesystem (file 
size histograms anyone?) if anyone is interested.)


Thanks for any insights,
-- 
Daan


More information about the freebsd-hackers mailing list