[rrd-developers] rrdcached: path sanitizer

kevin brintnall kbrint at rufus.net
Wed Dec 5 23:18:54 CET 2012


On Wed, Dec 5, 2012 at 8:58 AM, Kiss Gabor (Bitman) <kissg at ssg.ki.iif.hu>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20121205/c50ba52a/attachment.htm 


More information about the rrd-developers mailing list