Re: rrdcached: path sanitizer

kevin brintnall <[email protected]> Wed, 5 Dec 2012 14:18:54 -0800
Newsgroups gmane.comp.db.rrdtool.devel
Message-ID <CALnZTTuBRWE4iC=T8RmVUrfMoajLePn+F+fzwENMXsptuqrtpQ@mail.gmail.com>
On Wed, Dec 5, 2012 at 8:58 AM, Kiss Gabor (Bitman) <[email protected]>wrote:

> DESCRIPTION
>        realpath() expands all symbolic links and resolves references  to
>  /./,
>        /../  and  extra  '/' characters in the null-terminated string
> named by
>        path to produce a canonicalized absolute pathname.  The resulting
> path-
>        name is stored as a null-terminated string, up to a maximum of
> PATH_MAX
>        bytes, in the buffer pointed to by resolved_path.  The  resulting
>  path
>        will have no symbolic link, /./ or /../ components.
>

This is going to cause a LOT of stat() calls: O(commands * average dir
depth)

I see your point, but it's probably better to do trivial string
manipulations that don't hit the filesystem.
The whole point of rrdcached is to defer and collate I/O.

If you feel strongly about it, I encourage you to benchmark it with a
non-trivial number of files (500,000) and command rate (1k/sec).

-- 
 kevin brintnall

_______________________________________________
rrd-developers mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers