Re: rrdcached: path sanitizer
Stanislav Sinyagin <[email protected]> Wed, 5 Dec 2012 14:37:04 -0800 (PST)
| Newsgroups | gmane.comp.db.rrdtool.devel |
|---|---|
| Message-ID | <[email protected]> |
Kevin, you would need such lookups only once when the file path is encountered for the first time. Then it can be stored in a hash table inside rrdcached. >________________________________ > From: kevin brintnall <[email protected]> >To: Kiss Gabor (Bitman) <[email protected]> >Cc: "[email protected]" <[email protected]> >Sent: Wednesday, December 5, 2012 11:18 PM >Subject: Re: [rrd-developers] rrdcached: path sanitizer > > >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). > > _______________________________________________ rrd-developers mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers