Low latency distributed cache for Java & C++ Object
[Background]
I am working on a java server side process which for the signal analysis / image processing. The main server process will accept requests / input parameters (XML / Image) from users. It will then distribute request / input to multiple processing engines. The processing engines are written in Java. They will perform the JNI call for image / signal processing. They will be communicated via RMI.
The same request will be processed again with different input parameters and the input parameters are very large (image size : 1-2MB). We don't want to sent the request to processing engines every time. We cache the requests / inputs in the processing engine. The JNI object is stateful and is kept in the processing engine as well. The same calculation will always be calculated by the same processing engine.
[Problem]
We cannot predict the real time usage accurately and the workload distribution is not even. Since the same request always go the same processing engine, some processing engines may get overloaded while some are idle.
[Requirement]
Here is the things I want to achieve: - Dynamic workload distribution: The requests could be handle by different engine. - Low latency caching for data (large XML / Imagine): Instead of sending the input / data to the engine via RMI, we want to use a distributed cache. - The JNI object will be stored in the distributed cache a开发者_开发知识库s well and will keep its state
[Question]
- Is there any Low latency distributed cache for Java that suitable for my requirement (especially caching of JNI object)?
- I didn't use the distributed cache before and looking at Terracotta. Any other recommendation?
Thanks for any input!
Ehcache is popular at a few different sites I've worked. Indications I've heard are positive, but their use-case was somewhat simpler. Even so, the item cached shouldn't make any difference to the performance of the cache except possibly sizing issues (and you have said your items are rather large).
Something that is not clear is that you have said you don't want to send the parameters every time, but that they are different for each request. Trying to cache or bind something that is different every time is not helpful to you and you are far better off forgetting the cache altogether in this case and simply live with the overhead of sending the request parameters. Perhaps I've missed something!?
精彩评论