`
sslaowan
  • 浏览: 374075 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

【译】Terracotta Deployment Guide

阅读更多

 

 

Sizing The Terracotta Client Hardware

Your existing application server hardware should be adequate to serve as Terracotta clustered JVM clients. Your workload partitioning strategy and the number of Terracotta client nodes you deploy will have an effect on the amount of heap allocated to each Terracotta client JVM.
 你的现有的应用服务器硬件应该能够足以作为Terracotta集群的JVM的客户端。你的负载分配策略和你部署的Terracotta客户端节点将影响对于每个Terracotta客户端JVM的堆分配的数量

 

As a general rule, each client JVM should do work on data that fits in its local heap. This good locality-of-reference characteristic will allow your application to operate at memory speed, faulting in object data from a Terracotta server instance only when first joining the cluster or when workload is rebalanced.
作为一般规则,每个客户端JVM应该工作在容纳在它本地堆中的数据之上。这种比较好的引用本地化的特征允许你的应用以内存速度运行,只有当第一次加入集群或者负载重现平衡时才会从Terracotta服务器实例上获得对象数据。

 

Another benefit of good locality-of-referene is that it minimizes the impact of having varying machine configurations across the application side of the cluster. In addition, load balancers can be used to send more work to machines with more resources.
另一个使用好的引用本地化的好处是最小化跨集群应用端不同机器配置带来的影响。此外,负载均衡器可以将更多的工作发送到具有更多资源的机器上。

 

You should also reduce the amount of clustered object data kept resident in the heap of more than one client JVM to a minimum to avoid redundant client JVM heap allocation for that data and to minimize the broadcasting that the Terracotta server must perform as that object data changes.
你也应该减少保存在不止一个JVM堆中的集群对象数据的数量,最小化的去避免多余的客户端JVM堆分配,和最小化的广播,Terracotta服务器必须在对象数据改变时工作

 

In exchange for its availability and scalability characteristics, Terracotta introduces some memory and CPU overhead to the application server process. This can be offset by adding more application servers to handle increased capacity requirements.

在交换可用性和可延展性特征时,Terracotta将一些内存和CPU用于应用服务器进程的开销。这可以通过增加更多的应用服务器来处理增涨的容量需求来抵消。

 

Load Balancing and Workload Partitioning

In order to achieve the good locality of reference mentioned earlier in the section on sizing the Terracotta client hardware such that each client JVM works on data that fits in its local heap and that data does not overlap with other client nodes, you must have some workload partitioning strategy. As a general purpose clustering solution, Terracotta does not ship with a particular workload partitioning strategy in the box. Workload partitioning can be implemented in a number of different ways.

为了实现前文提到的良好的引用本地化,即每个客户端JVM工作在放在本地堆中的数据对象,数据不会与其他客户端节点重叠,你必须具有一定的负载分配策略。作为通用的集群解决方案,Terracotta不提供开箱即用的特定的负载分配策略。负载分配可以由多种不同的方式实现

 

A simple form of such workload partitioning is a layer seven sticky load balancer that is able to route requests for a particular user session to the same Terracotta client application server and is likewise able to balance user sessions evenly across all available application servers. If you are using Terracotta in a user-session context, this sticky load balancing method of workload partitioning is highly recommended. In this scenario, WE STRONGLY DISCOURAGE THE USE OF ROUND-ROBIN OR OTHERWISE NON-STICKY LOAD BALANCING STRATEGIES.
一个简单的负载分配方式是一个七层粘性负载均衡器能够保证特定的用户session能够被路由到相同的Terracotta客户端应用服务器,同样能够在所有的可用的应用服务器之上平衡用户session。如果你在user-session上下文中使用Terracotta,强烈推荐使用粘性负载均衡方式。在这种场景下,我们强烈不建议使用ROUND-ROBIN火灾其他非粘性负载均衡策略。

Other forms of workload partitioning may be required for different use cases. Implementing workload partitioning algorithms in Java that can then be made cluster-aware via Terracotta is often a simple way to meet custom workload partitioning requirements.
其他的负载分配形式可能适用于不同的用例。用Java实现的负载均衡分配算法,通过Terracotta实现集群通常是一种能够满足个性化负载分配需求的简单途径。

 

Java Heap Sizing

To decide how much heap to allocate to a Terracotta server instance, you should know the size of the clustered object graph(s) that you expect to create. In the ideal case, each Terracotta client JVM will work on a set of object data that fits in its local heap. See the sections above on sizing the Terracotta client hardware and determining the number of Terracotta client nodes for a discussion of data partitioning and locality of reference considerations that will affect Terracotta client clustered data access patterns.
决定将多少堆分配给Terracotta服务器实例,你应该知道你期望创建的集群对象图的大小。在理想情况下,每个Terracotta客户端JVM都将工作在位于本地堆中的数据对象之上。查看关于设置Terracotta客户端硬件规模和决定Terracotta客户端节点的数量 那一段,然后讨论数据分区和引用本地化考虑将会影响Terracota客户端集群数据访问模式。

 

However, even in a well-partitioned cluster, there will necessarily be events that will cause a Terracotta client to request large amounts of object data from a Terracotta server instance. This will happen when a new Terracotta client node joins the cluster. As a new cluster member, a Terracotta client JVM will have no clustered object data yet in heap and must request any objects it needs from a Terracotta server instance. Also, when a Terracotta client JVM is taken out of service and its workload is rebalanced across the cluster, the other cluster nodes will necessarily request the relevant object data for their new workload from a Terracotta server instance.

然而,即使在很好的分区的集群中,也一定会有事件导致一个Terracotta客户端从Terracotta服务器实例请求大量的对象数据。这将发生在一个新的Terracotta客户端节点加入到集群中。作为一个新的集群成员,Terracotta客户端JVM将没有集群的对象数据在堆中,必须从Terracotta服务器请求所有的需要的对象。还有,当Terracotta客户端JVM挂了或者是集群重新负载,其他集群节点将为了新的负载从Terracotta服务器实例获得相关的数据。

 

As a final consideration for Terracotta server-instance heap sizing, be aware that very large heaps can lead to JVM garbage collection pauses that will cause the server instance to halt all work and have a negative impact on cluster throughput. We typically do not recommend a heap larger than 6-8 GB. If your requirements are such that you must have all clustered object data in heap, but it will not fit in the heap of the Terracotta server array you've allocated, and partitioning strategies have been exhausted, additional server instances must be provisioned. For more information, contact info@terracottatech.com.

作为Terracotta服务器实例堆大小的最终考虑,非常大的堆可能导致JVM垃圾回收暂停,从而导致服务器实例所有工作挂起,而对集群吞吐量产生负面影响。我们一般建议一个堆不要大于6-8GB.如果你的需求确实要求你必须将所有的集群对象都放在堆中,但是它又不能都放到Terracotta服务器已经分配的堆,分区策略已经用完了,额外的服务器实例必须被提供。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics