# Limiting l2arc_write_max  and l2arc_write_boost doesn't work



## belon_cfy (Jul 18, 2012)

Hi
I have the following default values on my FreeBSD storage for limiting the l2arc write to my SSD cache. 

```
vfs.zfs.l2arc_write_boost: 8388608
vfs.zfs.l2arc_write_max: 8388608
```

Although the values are limited to 8MB but I'm still able to get 40MB/s write to the SSD for L2ARC only, even I changed to 100KB also didn't work as expected. How can I throttle the write speed on SSD for caching?


```
vfs.zfs.l2arc_norw: 1
vfs.zfs.l2arc_feed_again: 1
vfs.zfs.l2arc_noprefetch: 0
vfs.zfs.l2arc_feed_min_ms: 200
vfs.zfs.l2arc_feed_secs: 1
vfs.zfs.l2arc_headroom: 2
vfs.zfs.l2arc_write_boost: 8388608
vfs.zfs.l2arc_write_max: 8388608
```


----------



## t1066 (Jul 18, 2012)

Normally, L2ARC is fed once per second. However, when ZFS finds out that this is not fast enough, it may reduce the feeding time down to at most vfs.zfs.l2arc_feed_min_ms. Since 1 s / 200 ms = 5, with vfs.zfs.l2arc_write_max = 8M, you would have maximum L2ARC feeding rate of 40MBps. Hence, setting 

`# sysctl vfs.zfs.l2arc_feed_min_ms = 500`

would reduce the maximum feeding rate to 16MBps. In other words, you should adjust vfs.zfs.l2arc_feed_min_ms to get what you want.


----------



## belon_cfy (Jul 18, 2012)

Ok , thanks for your comment.


----------

