On 13.08.2017 16:13, Tenzin Lhakhang wrote:
You may want to have an async zfs-get program/script that regularly does a zfs get -Ho and stores then in a local cache (redis or your own program) at a set interval and then the api can hit the cache instead of directly running get or list.
I cannot because the cache will become stale on first new entity creation, which happens all the time.

- Some silly person will try to benchmark your zfs web-API and overload your server with zfs processes.
- Example: let me run [ ab -c 10 -n 10000 http://yourserver/zfs-api/list ]
-- Let me run 10 concurrent connection with a total of 10k requests to your api (it's a simple one liner -- people will be tempted to benchmark like this).

Example:
https://github.com/tlhakhan/ideal-potato/blob/master/zdux/routers/zfs/service.js#L9
- This is a JS example, but you can easily script it or another language (golang) for cache separation and another program for the API.

Also, zfs does have a -c property to get cached values -- these values are stored in an internal zfs process cache. The -c doesn't help if you have 1000(0)s of filesystems, a single list can still take minutes. Sending the list is also several megabytes.
Doesn't have on FreeBSD.


Thanks.
Eugene.
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to