Question

I am using gemfire as my cache. The cache heap size is well above 100GB. I discovered that when we put data in gemfire cache from client, it would serialize the data and send to server, and on server the data is stored in serialized form. Problems:

  1. When i try to execute any on-server function call, it then starts deserializing the data and it is really time consuming, some times it takes more than an hour just to iterate through the objects in cache. (Number of objects are close to 6 million).
  2. I tried using gemfire custom serialization (DataSerializer class). And the amount of memory it takes after all the data is in cache is about 60GB which is the same if I were to use Java default serialization.
  3. I tried using a library called Kryo https://github.com/EsotericSoftware/kryo and that does helps a lot, but i still don't understand why gemfire serialization doesn't help me as i am serializing each attribute of the class individually so there shouldn't be any burden to write class headers and any other meta data.

Any help would be really appreciated.

Était-ce utile?

La solution

Have you looked into using the read-serialized=true option in the server cache.xml? Setting this attribute to true will allow the server to perform operations on the cached objects without having to deserialize first. Read more about it in the Pivotal documentation.

Autres conseils

Vivek,

if the size of the object is too large, it would help to use Delta Propagation feature of Gemfire https://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.gemfire.6.6/getting_started/quickstart_examples/delta_propagation.html

This would still have some serialization/deserialization cost but the difference is from the client side you would only be sending "what has changed in the object" to the server on a put and theoretically this is what gets replicated to other servers and clients if you have interest list registered on clients.

I have also found that a normal PUT on the client cache is far more performant than using a Function execution (onRegion or onServers etc.)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top