Re: RRD PostgreSQL extension
Dustin Fisch <[email protected]> Wed, 12 Sep 2012 01:44:21 +0200
| Newsgroups | gmane.comp.db.rrdtool.devel |
|---|---|
| Message-ID | <[email protected]> |
Tobias Oetiker <[email protected]> wrote: > Hi Dustin, > > Yesterday Dustin Fisch wrote: > > > Hi, > > > > I am currently thinking about building an RRD extension for > > PostgreSQL. > > > > The extension will provide a RRD data type which represents a > > complete database and functions for all the existing functions of > > the RRD tool, like create, update, first and graph... > > > > PostgreSQL has a nice API for LOB, which allows to store the whole > > RRD database using the PostgreSQL file management. > > > > I already have taken a look to the RRD code. As far as I can see, > > there are functions like rrd_create_r(...) which provides the > > functionality I need for such an extension. > > > > The PostgreSQL LOB API currently provides a file descriptor for the > > access to the data stored in the LOB. > > > > Unfortunately, it looks like the RRD API only allows the usage of a > > filename. > > > > Is there any way to use a file descriptor instead of the filename? > > Or is there any chance such a patch would be accepted? > > if done nicely, I'll be glad to integrate such a patch ... I guess > you would have to compile without mmap support ... I'm not sure about mmap. I think I have to try it. The plan for the patch is to refactoring the rrd_*_r methods by moving out the real work of the method into something called rrd_*_x. The only thing remaining in the original method are the calls to rrd_open and rrd_close and the call to the new method. The new rrd_*_x methods will mirror the interface of there rrd_*_r counterparts expect the filename parameter, which will be replaced by the already opened rrd_file_t. > > how would this pg integration work, would the rrd data be stored in > a blob ? wouldn't this get read from disk entirely on every update > and make things rather slow ? Right. The idea is to store the RRD data in a BLOB. But I don't see any performance problem with this as a PostgreSQL extension is allowed to work on the file backing the BLOB directly using a file descriptor. This makes no difference to the way RRDtool currently works. Maybe this allows to to use the current mmap code, too. > > cheers > tobi > > cheers fooker -- http://lab.sh _______________________________________________ rrd-developers mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
signature.asc
(application/pgp-signature, 490 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQEcBAEBAgAGBQJQT8zWAAoJELTDvwEtmya+/sQIAMB9Pu0jDEyZCCikM0y9GawO STFKlgsXQbS3jk2rzzqVI6vMW7vGcRRwgNpdD3M5gZVXvCeYgLiHEIi6qI6C0RGm Dcyf4swwswqcvOzFNeWSC4Ghk6R9qxqtaBvXuxgii/XvLELBXrlDFTd80rSSbKdu t7Qlr90anLV+mtrUG9rd6DxNL781qH6S4miikHuL/aBMJKOzYj2micq/v5cOVMBg 4SiPJRvWiioy3QTl6O3cZwsPTKz2HElqNFGkmZECEWUh2UwoQaX5VCojPLdBRos3 +M0BH1N86ZeKDHTeEnV/CTG14CtbFqYLXkjj5bTroy0KG3xyhAJxykTCIsXgv+U= =89Y7 -----END PGP SIGNATURE-----