# ZFS: arc_meta_used exceeds arc_meta_limit?



## idownes (Feb 20, 2012)

Is vfs.zfs.arc_meta_limit supposed to be a (relatively) hard limit on cached metadata?

ZFS is exceeding vfs.zfs.arc_meta_limit on some of my boxes; in one instance consuming all available RAM, paging everything out and bringing the system to its knees.

```
$ uname -a
FreeBSD local 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Jul  8 00:54:56 UTC 2011     root@8.8.8.8:/usr/obj/usr/src/sys/XENHVM  amd64
$ sysctl vfs.zfs | grep arc_meta
vfs.zfs.arc_meta_limit: 1610612736
vfs.zfs.arc_meta_used: 12183379056
```
Note 7-8X over the limit!

I've observed it on 8.2-RELEASE patched to ZFS 5/28 and 9.0-RELEASE, both running on EC2 and locally on 8.2-RELEASE on a bare machine.

I first observed it as a result of periodic/security/100.chksetuid where I'm thinking it's caused by find traversing everything.


----------



## chrcol (Aug 9, 2012)

I have just come across this issue, which is interesting.

Directadmin runs daily scripts which traverse the entire /home path, for things like tallying data usage etc.

It frequently on zfs gets stuck in large maildirs which have many emails in them, on ufs a 'ls' takes 1-2 secs to start.  On zfs it waits what seems indefenitly using 100% disk i/o until I abort.

googling led me to the sysctl you have mentioned and sure enough I have the same issue.


```
vfs.zfs.arc_meta_limit: 805306368
vfs.zfs.arc_meta_used: 1684810480
```

so limit set to approx 800meg and usage double that.


----------



## Savagedlight (Aug 15, 2012)

These numbers are from a 8.1-RELEASE-p6 box (Yes, I am in the process of upgrading this)

```
vfs.zfs.arc_meta_limit: 805306368
vfs.zfs.arc_meta_used:  841018120
```

The interesting part here is the box was recently rebooted (15h uptime), and memory usage is extremely light yet as there haven't been much traffic going to/from the box since the last reboot. It would normally hover around 10GB wired memory, but is currently at slightly less than 3GB. The fact it's already over the limit puzzles me!

I do not know what impact this has, if any, though.


----------



## bthomson (Jan 18, 2015)

I have observed it on 10.0-RELEASE-p7 today:


```
% sysctl -ah | grep vfs.zfs.arc
vfs.zfs.arc_max: 134,217,728
vfs.zfs.arc_min: 517,351,680
vfs.zfs.arc_meta_used: 313,004,120
vfs.zfs.arc_meta_limit: 33,554,432
```

[FONT=Courier New]arc_max[/FONT] is less than [FONT=Courier New]arc_min[/FONT] probably because I have added [FONT=Courier New]vfs.zfs.arc_max="128M"[/FONT] to /boot/loader.conf to help prevent the runaway ARC memory usage which has occasionally brought down my workstation. I am unsure if setting [FONT=Courier New]arc_min[/FONT] as well would help improve the situation.

`top` says my ARC is 387M, so perhaps this means that 313MB of ARC is metadata and 387MB-313MB is file data.


----------

