I am using RRDTool (http://oss.oetiker.ch/rrdtool/) as a graphing back-end for storing performance metrics. This is done via the RRDTool CLI from a Python script.
My problem is that the script is multithreaded and each thread updates the RRD at a pretty rapid pace. Sometimes an update fails because one thread is accessing the RRD file while another one tries to access it also.
I was under the impression that this is OK to try since RRDTool uses its own locking mechanism, but I guess that isn't true.
Does anyone have a good approach for concurrent access to an RRD?
I can think of a few ways to go:
have 1 thread create a queue and only feed the RRD from a single thread.
create my own locking mechanism inside the Python script. (how would I do this?)
got anything better or have you run into this issue before?