--
You received this message because you are subscribed to the Google Groups "rrd4j-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rrd4j-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Le 31 mars 2015 à 22:36, AdityaVaja <wolver...@gmail.com> a écrit :Hi Fabrice,Thanks for the quick response. I found an easier way - include the files directly from https://github.com/fbacchella/jrds/tree/HeavyCaching/src/jrds/caching and remove the dependencies on jrds (minor) and compile the directfd.c and include it.Only to realize that caching backend is caching pages per file and its actually better performance wise in my case if I keep it to the default memory mapped file which is using NIO :)
For reference, if anyone wants to use just the caching backend without importing the jar and its dependency on jrds:
- copy the java files at that above link to your project at some package (ideally create a new one in the hierarchy called caching or jrds)
- comment the calls to jrds library methods from the java file manually
- update the method names in directfd.c based on package hierarchy in your code where you place the java files
- compile the c file using the following command
- gcc -shared -fPIC -I/usr/lib/jvm/java-7-openjdk-amd64/include/ -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux/ directfd.c -o libdirect.so
- if direct.h import in C file causes error, import jni.h instead and fix errors if any
Just for comparison I also tried to use MemoryBackend, but the method to access the files has to be changed I guess. Could not find an example of how to use MemoryBackend. Would you have an idea about that?
Le 31 mars 2015 à 22:36, AdityaVaja <wolver...@gmail.com> a écrit :Hi Fabrice,Thanks for the quick response. I found an easier way - include the files directly from https://github.com/fbacchella/jrds/tree/HeavyCaching/src/jrds/caching and remove the dependencies on jrds (minor) and compile the directfd.c and include it.Only to realize that caching backend is caching pages per file and its actually better performance wise in my case if I keep it to the default memory mapped file which is using NIO :)Not sure. I found that NIO can issue big read, that are too big for rrd4j usage where small IO are much better. It leads to a lot of useless data in cache. The caching backend is interesting if you set flush cache to a bigger interval that collect step, so it can merge many writes.
Why all this work ? ant failed for you ?For reference, if anyone wants to use just the caching backend without importing the jar and its dependency on jrds:
- copy the java files at that above link to your project at some package (ideally create a new one in the hierarchy called caching or jrds)
- comment the calls to jrds library methods from the java file manually
- update the method names in directfd.c based on package hierarchy in your code where you place the java files
- compile the c file using the following command
- gcc -shared -fPIC -I/usr/lib/jvm/java-7-openjdk-amd64/include/ -I/usr/lib/jvm/java-7-openjdk-amd64/include/linux/ directfd.c -o libdirect.so
- if direct.h import in C file causes error, import jni.h instead and fix errors if any
Just for comparison I also tried to use MemoryBackend, but the method to access the files has to be changed I guess. Could not find an example of how to use MemoryBackend. Would you have an idea about that?What change are needed ? Except for file path, there should be none.
--
You received this message because you are subscribed to the Google Groups "rrd4j-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rrd4j-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I tried with pageCache(2) and syncInterval(300) - every 5 intervals. Since the data is only 64 * 12 = 768 bytes, two pages = 8kB should be enough for 8 intervals. However there are 4K files updated every minute, so that may be the reason. It was 3~4 times slower than NIO. Since memory is not an issue, I thought its a better fit.