gemfire custom serialization not helping

夙愿已清 提交于 2019-12-12 10:16:16

问题


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.


回答1:


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.




回答2:


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.)



来源:https://stackoverflow.com/questions/22396122/gemfire-custom-serialization-not-helping

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!