L2ARC setup guide

ECC

Explorer
Joined
Nov 8, 2020
Messages
65
Hello,
I have a server with a 8x 18TB Raidz2 pool and 64gb ram. This is my usecase:
- mainly 1 client access
- server runs only occasionally. Most of the time, the server is offline
- workload is mostly read&write big files. During update writing, there are also a lot of small files, which affect performance.

To improve small file reading performance, i was thinking about adding l2arc. It will also be persitent cache, which is important because the server never runs longer than a few hours.

I have a 2TB enterprise nvme laying around, which could be use for this purpose.

How would you setup this l2arc or what would be your approach to improve the Performance?

Thanks.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Start by looking at arc_sumary to understand if you're going to benefit from L2ARC or not.

If you're getting high enough ARC hits, you may get nothing out of L2ARC and it will eat some of your ARC to store its metadata, so may even make performance worse.

It will also be persitent cache, which is important because the server never runs longer than a few hours.
Warming the persistent cache on boot can take hours if it's large... I don't think your use-case is sounding very sensible.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Setting it up as metadata only may make some sense to help with small file access (metadata heavy activity) and will also help with warming times as not much actual data is cached.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
How would you setup this l2arc
Easy, just add it to the pool as a L2ARC device. Whether it would benefit you is a separate question, and questionable for the reasons already mentioned.
Setting it up as metadata only may make some sense to help with small file access
...but while this may be more beneficial, it's also essential to the pool--if a metadata vdev fails, the whole pool is toast, and I'm not sure it's possible to remove these later.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
...but while this may be more beneficial, it's also essential to the pool--if a metadata vdev fails, the whole pool is toast, and I'm not sure it's possible to remove these later.
Not what I suggested... I was talking about a metadata only L2ARC...

 
  • Like
Reactions: ECC

ECC

Explorer
Joined
Nov 8, 2020
Messages
65
Setting it up as metadata only may make some sense to help with small file access
That makes sense. So if i would do that, how would you set up l2arc (e.g. size) and which parameters for arc & l2arc would you tune, to improve performance? I setup blocksize to 1M, because the pool mainly holds big (media) files
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So if i would do that, how would you set up l2arc (e.g. size) and which parameters for arc & l2arc would you tune, to improve performance?
For each dataset you want it to apply to (and I would advise to do it for all datasets in the pool you add the L2ARC to), you need to zfs set secondarycache=metadata pool/dataset (you can't do that in the GUI)

Then add the L2Arc... you don't need it to be massive... 100GB would already be a lot, but adding something larger won't hurt as the excess capacity just isn't used.

No other tuning is advised (at least initially).

Read this thread if you want some ideas about other things you might do:

I setup blocksize to 1M, because the pool mainly holds big (media) files
Good to know and probably the right thing to do... but you can set it per dataset and for the smaller files you mention, maybe wise to have it smaller.
 
Joined
Oct 22, 2019
Messages
3,641
Read this thread if you want some ideas about other things you might do:

Once ZFS 2.2 lands, things will not only be improved, but also be simplified and streamlined:

:cool:

Really excited for this!
 
Top