gemfire自定义序列化无济于事 [英] gemfire custom serialization not helping

查看:253
本文介绍了gemfire自定义序列化无济于事的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gemfire作为我的缓存。缓存堆大小远高于100GB。我发现当我们从客户端将数据放入gemfire缓存时,它会将数据序列化并发送到服务器,而在服务器上,数据以序列化形式存储。
问题:

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. 当我尝试执行任何on-server函数调用时,它会开始反序列化数据,它确实是耗费时间,有时需要一个多小时才能遍历缓存中的对象。 (对象数量接近600万)。

  2. 我尝试使用gemfire自定义序列化(DataSerializer类)。并且所有数据在缓存中所占用的内存量大约为60GB,如果我使用Java默认序列化则相同。

  3. 我尝试使用名为Kryo的库 https://github.com/EsotericSoftware/kryo 这确实有很大帮助,但我仍然不明白为什么gemfire序列化对我没有帮助,因为我正在单独序列化类的每个属性,因此编写类标题和任何其他元数据不应该有任何负担。

  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.

推荐答案

您是否考虑过使用<$ c服务器cache.xml中的$ c> read-serialized = true 选项?将此属性设置为true将允许服务器对缓存的对象执行操作,而不必先进行反序列化。在关键文档中了解更多相关信息。

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.

这篇关于gemfire自定义序列化无济于事的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆