Date: Sun, 13 Aug 2017 23:25:36 +0500 From: "Eugene M. Zheganin" <emz@norma.perm.ru> To: "freebsd-fs@FreeBSD.org" <freebsd-fs@freebsd.org> Cc: freebsd-stable <freebsd-stable@freebsd.org> Subject: Re: zfs listing and CPU Message-ID: <c07474d7-b47d-2795-405c-fe8d275e6145@norma.perm.ru> In-Reply-To: <CALcn87zig7b37Q_JByVMrWyPPF=qr%2BWO%2BcB4aP4-wFp-_B4FOw@mail.gmail.com> References: <aa26e888-05ef-c876-abf3-778ff08f4857@norma.perm.ru> <E3238E24-3AFA-4F2C-A299-D52E4D152097@kraus-haus.org> <399c4309-c7a6-a7e9-299f-9675224c090d@norma.perm.ru> <CALcn87zig7b37Q_JByVMrWyPPF=qr%2BWO%2BcB4aP4-wFp-_B4FOw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c07474d7-b47d-2795-405c-fe8d275e6145>