ZFS compression and Hyperthreading

Status
Not open for further replies.

scrabblecy

Cadet
Joined
Jan 23, 2013
Messages
4
Hi,

I have some questions regarding compression on zfs and freenas.


I have a box with 2xXeon Dual core cpus (with hyperthreading enabled) and 16GB ram

Grepping dmesg reveals the following

cpu0 (BSP): APIC ID: 0
cpu1 (AP/HT): APIC ID: 1
cpu2 (AP): APIC ID: 2
cpu3 (AP/HT): APIC ID: 3
cpu4 (AP): APIC ID: 4
cpu5 (AP/HT): APIC ID: 5
cpu6 (AP): APIC ID: 6
cpu7 (AP/HT): APIC ID: 7

My ZFS dataset is configured with compression on (lzjb)
I realise that nfs is multi-threaded and assume that when copying lzjb will thus run on each nfs thread. Am I correct ?
Will having hyperthreading turned on also overload the HT "cores" and thus impact the performance ?

Kind regards,
Lucas
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I realise that nfs is multi-threaded and assume that when copying lzjb will thus run on each nfs thread. Am I correct ?

Doing a little googling I believe that lzjb is single threaded, so single core performance is what matters the most. From experimenting with compressions it can(and does) significantly impact performance(decreasing performance by 10-90%). Honestly, I'm really not sure why you'd choose compression with how cheap storage space is.

Will having hyperthreading turned on also overload the HT "cores" and thus impact the performance ?

I'm sorry, but what!? You can't "overload" a CPU, a core, or anything. I have no idea what you are talking about but when all of your cores are fully loaded you can expect system performance to drop significantly due to all of the tasks being performed.

Hyperthreading takes your cores and makes it appear to be twice as many cores to increase performance. Some tasks can see a massive improvement, others have had slightly declines. I found that HT works pretty well with FreeNAS, but your mileage may vary.
 

scrabblecy

Cadet
Joined
Jan 23, 2013
Messages
4
Doing a little googling I believe that lzjb is single threaded, so single core performance is what matters the most. From experimenting with compressions it can(and does) significantly impact performance(decreasing performance by 10-90%). Honestly, I'm really not sure why you'd choose compression with how cheap storage space is.

What tests did you do with compression to get those numbers ? In theory, would compression not reduce a small 6KB file into say a 4KB or a 2KB block, reducing the size of the read / write ? Could it also not reduce the number of I/Os needed for larger files, as a 500KB file could be compressed into say 300KB, needing 3 128KB blocks, not the 4 it had before.
Would it then be possible to replace gzip with pigz ? (with an alias maybe, since their syntax seems to be the same). Storage is cheap but since the cpu is quite powerful and sitting idle then why not use it ?

I'm sorry, but what!? You can't "overload" a CPU, a core, or anything. I have no idea what you are talking about but when all of your cores are fully loaded you can expect system performance to drop significantly due to all of the tasks being performed.

Hyperthreading takes your cores and makes it appear to be twice as many cores to increase performance. Some tasks can see a massive improvement, others have had slightly declines. I found that HT works pretty well with FreeNAS, but your mileage may vary.

By overload I meant that if the core is fully utilised by a thread then the HT thread is being stalled ... wont this stalling decrease the performance ? To my understanding HT works when several (non-identical) threads are running, hence different cpu areas are utilised, hence the HT thread might have free resources to run. If all threads need to use the same logic areas (in the case of a multithreaded nfsd) then HT doesnt really provide any benefit.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
What tests did you do with compression to get those numbers ? In theory, would compression not reduce a small 6KB file into say a 4KB or a 2KB block, reducing the size of the read / write ? Could it also not reduce the number of I/Os needed for larger files, as a 500KB file could be compressed into say 300KB, needing 3 128KB blocks, not the 4 it had before.
Would it then be possible to replace gzip with pigz ? (with an alias maybe, since their syntax seems to be the same). Storage is cheap but since the cpu is quite powerful and sitting idle then why not use it ?
I'd be interested in the tests as well. My research indicated that compression was more likely to improve performance, unless you picked gzip9 on an underpowered machine and were storing poorly compressible data. For that reason it's probably good practice to use something towards the gzip9 side of things on datasets containing lots of text and either nothing or lzjb with media. And, as you suggested, I've seen several articles stating that reduced I/O and increased CPU consumption is a benefit to overall performance.
 
Status
Not open for further replies.
Top