Viktor Turskyi
2007-Mar-20 10:19 UTC
[zfs-discuss] Is there any performance problem with hard links in ZFS?
Is there any performance problem with hard links in ZFS? I have a large storage. There will be near 50000 hard links for every file. Is it ok for ZFS? May be some problems with snapshots(every 30 minutes there will be a snapshot creating)? What about difference in speed while working with 50000 hardlinks or 50000 different files? ps: It would be very useful if you give me some links about hardlinks low-level processing. This message posted from opensolaris.org
Darren J Moffat
2007-Mar-20 11:34 UTC
[zfs-discuss] Is there any performance problem with hard links in ZFS?
Viktor Turskyi wrote:> Is there any performance problem with hard links in ZFS? > I have a large storage. There will be near 50000 hard links for every file. Is it ok for ZFS? May be some problems with snapshots(every 30 minutes there will be a snapshot creating)? What about difference in speed while working with 50000 hardlinks or 50000 different files?Why do you think there would be a problem ? Are you actually having a problem or trying to guess at things you might have ? To my knowledge there are no problems with hard or softlinks in ZFS. 50000 hard links for a file seems very strange and it really sounds like what you might want is to use ZFS clones. What problem are you solving by using such a huge number of hardlinks ?> ps: It would be very useful if you give me some links about hardlinks low-level processing.Look in the zfs community page on opensolaris.org -- Darren J Moffat
Bart Smaalders
2007-Mar-20 17:16 UTC
[zfs-discuss] Is there any performance problem with hard links in ZFS?
Viktor Turskyi wrote:> Is there any performance problem with hard links in ZFS? > I have a large storage. There will be near 50000 hard links for every file. Is it ok for ZFS? May be some problems with snapshots(every 30 minutes there will be a snapshot creating)? What about difference in speed while working with 50000 hardlinks or 50000 different files? > > ps: It would be very useful if you give me some links about hardlinks low-level processing. > > > This message posted from opensolaris.orgOn my 2 Ghz opteron w/ 2 mirrored zfs disks: cyber% cat test.c #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <strings.h> int main(int argc, char *argv[]) { int i; char *filename; char buffer[1024]; if (argc != 2) { fprintf(stderr, "usage: %s filename\n", argv[0]); exit(1); } strcpy(buffer, argv[1]); filename = buffer + strlen(filename); for (i = 0; i < 50000; i++) { sprintf(filename, "_%d\n", i); if(link("foo", buffer) < 0) { perror("link:"); exit(1); } } } cyber% ls test test.c cyber% cc -o test test.c cyber% mkfile 10k foo cyber% /bin/ptime ./test foo real 0.976 user 0.039 sys 0.936 cyber% ls | wc 100003 50003 538906 cyber% /bin/ptime rm foo_* real 1.869 user 0.110 sys 1.757 cyber% So it takes just under 1 second to create 50,000 hardlinks to a file; it takes just under 2 seconds to delete ''em w/ rm. It would prob. be faster to use a program to delete them. - Bart -- Bart Smaalders Solaris Kernel Performance barts at cyber.eng.sun.com http://blogs.sun.com/barts
Matthew Ahrens
2007-Mar-20 20:14 UTC
[zfs-discuss] Is there any performance problem with hard links in ZFS?
Viktor Turskyi wrote:> Is there any performance problem with hard links in ZFS? I have a > large storage. There will be near 50000 hard links for every file. > Is it ok for ZFS? May be some problems with snapshots(every 30 > minutes there will be a snapshot creating)? What about difference in > speed while working with 50000 hardlinks or 50000 different files? > > ps: It would be very useful if you give me some links about hardlinks > low-level processing.Hard links in ZFS work pretty much the same as in any other UNIX filesystem -- which is to say, they are very fast. Should be much much faster than the same number of different files. --matt
Viktor Turskyi
2007-Mar-22 10:37 UTC
[zfs-discuss] Re: Is there any performance problem with hard links in ZFS?
Thank you very much for the consultation. The information was very useful. And I have one more questions about ZFS file attributes. I have found such information "2^56 ? Number of attributes of a file in ZFS" but i cant found any information mechanism of creating such attributes. The situation is next: I want to save a lot of file information not in database but in file attributes. File attributes setting will be processing by a Perl or C program. Is there any way to do this? This message posted from opensolaris.org
Matthew Ahrens
2007-Mar-23 03:58 UTC
[zfs-discuss] Re: Is there any performance problem with hard links in ZFS?
Viktor Turskyi wrote:> Thank you very much for the consultation. The information was very > useful.You''re welcome!> And I have one more questions about ZFS file attributes. I have found > such information "2^56 ? Number of attributes of a file in ZFS" but i > cant found any information mechanism of creating such attributes. > The situation is next: I want to save a lot of file information not > in database but in file attributes. File attributes setting will be > processing by a Perl or C program. Is there any way to do this?See fsattr(5) --matt
Viktor Turskyi
2007-Mar-23 13:42 UTC
[zfs-discuss] Re: Re: Is there any performance problem with hard
>See fsattr(5)It was helpful :). Thanks! This message posted from opensolaris.org
Viktor Turskyi
2007-Mar-26 15:58 UTC
[zfs-discuss] Re: Is there any performance problem with hard links in ZFS?
i have tested links performance. and i have got such results: with hardlinks - no problems, reading of 50000 files one million times takes 38 seconds in case with symlinks is another situation - reading of 50000 files(through symlinks) one million times takes 3,5 minutes. Is this OK? Is it normal that symlinks in so many times slower than hardlinks? This message posted from opensolaris.org
Frank Hofmann
2007-Mar-26 17:08 UTC
[zfs-discuss] Re: Is there any performance problem with hard links in ZFS?
On Mon, 26 Mar 2007, Viktor Turskyi wrote:> i have tested links performance. and i have got such results: > with hardlinks - no problems, reading of 50000 files one million times takes 38 seconds > in case with symlinks is another situation - reading of 50000 files(through symlinks) one million times takes 3,5 minutes. > Is this OK? Is it normal that symlinks in so many times slower than hardlinks?Tested this on UFS or on ZFS ? How long were the filenames of the links ? FrankH.