0

I am evaluating Terracotta for my current problem statement. The process is CPU intensive and takes about 5-10 GB working memory(RAM). Each object in memory is 1 kilobyte fine and consists of a handful of primitive data types. The whole RAM data goes through thousands of iterations and each iteration changes all the objects. Each object is modified completely. The process takes days to finish.

The million+ objects are partitioned and now run on multiple core machines, but i need more power and much more RAM(for bigger problems). The data/objects processed by one thread is not shared with others

Would Terracota be a good solution? Would syncing up of the million of objects to the clustering server be a really bad bottleneck rendering it ineffective?

4

1 回答 1

0

我认为 Terracotta 最适合缓存和快速检索。作为放置率,我看到每个缓存服务器实例每秒有 10K“批量放置”。“批量更新”模式意味着您可以一次性放置一组条目,这将比单次放置更有效。

以下是批量更新的示例:

cache.setNodeBulkLoadEnabled(true);
try
{
  Collection<Element> entries= new ArrayList<Element>();
  while (...)
  {
    entries.add(new Element(key, value));
  }
  cache.putAll(entries);
}
finally
{
  cache.setNodeBulkLoadEnabled(false);
}

此外,Terracotta 具有 BigMemory 功能,能够使用 JVM 堆之外的内存。要启用它,您必须在 ehcache.xml 中添加:

<cache name="com.xyz.MyPOJO" maxMemoryOffHeap="3g">
  <terracotta/>
</cache>

上面的示例将在 JVM 之外使用 3Gig 的 Ram。一般来说,您的堆大小不应大于 4G,否则您的 JVM 将在 GC 上花费大量周期......在您的情况下,这会进一步减慢您的计算速度。

另一种检查方法是“计算/数据网格”解决方案。您可以从http://www.gridgain.comhttp://www.gigaspaces.com开始

于 2012-09-27T19:20:53.633 回答