亚洲中字慕日产2020,大陆极品少妇内射AAAAAA,无码av大香线蕉伊人久久,久久精品国产亚洲av麻豆网站

資訊專欄INFORMATION COLUMN

TRINI: an adaptive load balancing strategy

wudengzan / 1220人閱讀

摘要:這將預(yù)測出當(dāng)達(dá)到多少時(shí),將發(fā)生下一次算法把這個(gè)閾值傳給另一個(gè)線性回歸模型,這個(gè)模型將推測內(nèi)存的時(shí)間序列并預(yù)測新的一個(gè)發(fā)生的時(shí)間將四種基本算法改為對應(yīng)的感知性算法如果預(yù)選取的節(jié)點(diǎn)在很短的時(shí)間內(nèi)要發(fā)生,則跳過該節(jié)點(diǎn),評估其他節(jié)點(diǎn)。

TRINI: an adaptive load balancing strategy based on garbage collection for clustered Java system 1. Introduction

GC comes with a cost : Whenever it is triggered, GC has an impact on the system performance by pausing the involved programs.

major GC : usually causes the longest type of GC pauses

research shows that it is not possible to have a single "best-fit-for-all" GC strategy because the GC behavior is dependent on the application inputs and system configuration

GC is particular sensitive to the heap size and even small changes

it is commonly agreed that the GC plays an important role in the performance of Java system

core line of thinking

question : what techniques can be deployed so that the occurruence of MaGC events in the application nodes does not affect the performance of the cluster ?

solution : enhance a load balancer so that it selects the nodes that are not expected to have a MaGC event in the immediate futures

the behavior of load balancing strategies heavily influenced by the accuracy of its balancing decisions and the amount of resources it uses.

a deep understanding of these factors is key to comprehend the practicability of any load balancing strategy.

2. Background

Generational heap

對象按時(shí)間不同被分配到不同的叫作 generation 的內(nèi)存區(qū)中。新的對象創(chuàng)建在 youngest generation 中,因?yàn)?younger generation的存活率通常比 older generation 的低。也就是說,younger generation 更有可能包含垃圾,也更頻繁地被回收

younger generation 中的 GC 叫作 minor GC (MiGC),通常是廉價(jià)的,也很少造成性能問題。 MiGC 也負(fù)責(zé)將足夠老的活著的對象移動(dòng)到 older generation。這意味著 MiGC 在 older generation 的內(nèi)存分配方面起到重要作用

older generation 中的 GC 叫作 MaGC ,它通常被認(rèn)為是最昂貴的 GC 類型,因?yàn)樗鼘π阅苡绊懞艽?/p>

Garbage Collection Strategies

3種GC策略

種類 serial GC parallel GC concurrent GC
線程 單線程 多線程
適用 client JVM server JVM server JVM
throughput response time

Load balancing

4種負(fù)載均衡策略

round robin

random

weighted round robin

weighted random

3. Related Work 3.1 Garbage collection optimisation

propose new concurrent and parallel algorithm that impact performance less

3.2 Memory forecasting

本文目標(biāo)

forecast the MaGC events and make the information available outside the JVM

其他人提出的

look for way to invoke a GC

present an approach to estimate the number of dead object at any time, information that a JVM could to dicide when to trigger a MaGC.

3.3 Distributed system optimisation

our research work has enhanced a load balancer by considering the MaGC forecast in its decision layer. In such a case , the load balancer can obteain additional knowledge about the JVM in order to control the workload of the system.

4 Garbage colletion-aware load balancing strategy 4.1 Overview

objective —— define a GC-aware load balancing strategy ( TRINI ) which is able to dynamically adjust to the specific GC characteristics of the underlying application

這個(gè)策略能讓負(fù)載均衡器足夠準(zhǔn)確地預(yù)測 MaGC 事件的發(fā)生

TRINI 周期性地從應(yīng)用節(jié)點(diǎn)中檢索信息

根據(jù)應(yīng)用的 GC 特點(diǎn)找到最適合的 policy

使用被選出的 policy 進(jìn)行預(yù)測 MaGC 事件和均衡即將到來的負(fù)載

為了實(shí)現(xiàn)自適應(yīng),使用了MAPE-K模型

Monitoring element

obtain information

Analysis element

evaluate if any adaptation is required

Plan element

Execute element

Knowledge element

support other elements

is fulfilled by the set of program family

program family

包含一系列類似的程序。這些程序有共同的GC特點(diǎn)

例如按照 MaGC 時(shí)間長短劃分的 program family

每個(gè) program family 有2個(gè)屬性

an evaluation criteria

判斷應(yīng)用的 GC 行為是否有資格成為那個(gè)family

a policy

指定 GC 預(yù)測和負(fù)載均衡的規(guī)則

4.2 TRINI core process

core process that coordinate its MAPE-K elements

load balancer 一旦開始,便觸發(fā) core process

初始時(shí),core process 使用一個(gè)默認(rèn) policy —— 全部的可用 MiGC 歷史被用來預(yù)測 MaGC。初始 policy 考慮所有的在啟動(dòng)時(shí)的額外配置信息,例如負(fù)載均衡算法。初始 policy 被用于所有的 node

接下來,monitor 中指定的循環(huán)和分析在所有節(jié)點(diǎn)中并行地開始,直到完成負(fù)載均衡

根據(jù)程序的 GC 特點(diǎn)(這些特點(diǎn)被用來定義一系列可用的 program family),收集數(shù)據(jù)樣本

收集完成后,分析進(jìn)程檢查當(dāng)前的 program family 是否適合底層的 GC 特點(diǎn)。如果不適合,則其他 program family 的評價(jià)標(biāo)準(zhǔn)被評價(jià)去發(fā)現(xiàn)新的 program family

這些新的 program family 一直被使用,直到下一次評價(jià)階段發(fā)生。這些過程從 program family 的數(shù)據(jù)庫中檢索他們的配置信息。

4.3 MaGA : a major garbage collection forecast algorithm

TRINI最重要的能力 —— 準(zhǔn)確預(yù)測 MaGC 的發(fā)生

通過 MaGA 算法 —— 作者的另一篇論文

MaGA 內(nèi)容:

周期性地從 JVM 中檢索 GC 和內(nèi)存樣本,以記錄發(fā)生在 Young 和 Old generation 中的內(nèi)存分配活動(dòng)

利用最近的歷史數(shù)據(jù)(由可配置的 FWS(預(yù)測窗口大?。┫拗疲﹣眍A(yù)測下一個(gè) MaGC 事件

預(yù)測出在 Old Generation 用完之前,要在 Young Generation 中開辟出多少內(nèi)存(當(dāng) Old Generation 用完便會(huì)觸發(fā) MaGC)

算法使用 FWS 中的 old generation 歷史數(shù)據(jù)得到一個(gè)線性回歸模型。這樣做是為了預(yù)測 YoungGen 中的增長率,并由此推斷 OldGen 將超過其最大閾值的點(diǎn)在哪里,并且觸發(fā) GC 。這將預(yù)測出當(dāng) YoungGen 達(dá)到多少時(shí),將發(fā)生下一次 MaGC

算法把這個(gè) YoungGen 閾值傳給另一個(gè)線性回歸模型,這個(gè)模型將推測 YoungGen 內(nèi)存的時(shí)間序列并預(yù)測新的一個(gè) MaGC 發(fā)生的時(shí)間

4.4 Garbage collection-aware load balancing algorithms

將四種基本算法改為對應(yīng)的 GC 感知性算法

round robin

random

weighted round robin

weighted random

the main difference of new algorithms (compared against their original counterparts)

perform an additional check in the selection of the next node

如果預(yù)選取的節(jié)點(diǎn)在很短的時(shí)間內(nèi)要發(fā)生 MaGC ,則跳過該節(jié)點(diǎn),評估其他節(jié)點(diǎn)。

當(dāng)所有節(jié)點(diǎn)都要在接下來的很短的時(shí)間內(nèi)要發(fā)生 MaGC ,則算法會(huì)按照其原始版本的算法進(jìn)行,即按照沒有 GC 感知的版本進(jìn)行

4.5 MiGC-CV program families

自動(dòng)選擇 FWS

作者之前的一篇論文顯示, MaGA 算法的準(zhǔn)確性對 FWS 極其敏感。

FWS 限制了用來預(yù)測 MaGC 的知識(shí)水平(即:內(nèi)存分配的歷史信息的大小)

實(shí)驗(yàn)發(fā)現(xiàn), 沒有一個(gè)適合所有情況的最優(yōu) FWS 值

作者的另一篇論文表明,可用的歷史數(shù)據(jù)越多, MaGA 算法預(yù)測得越準(zhǔn)。但這不具有單調(diào)性。相反,最優(yōu) FWS 也會(huì)經(jīng)歷低谷

這種行為可以被 MiGCCV捕獲

MiGCCV 是用來衡量在 MaGC 之間發(fā)生的 MiGC 數(shù)量變化的系數(shù)

這種方法使得 MiGCCV 成為一種恰當(dāng)?shù)姆诸悩?biāo)準(zhǔn),這種標(biāo)準(zhǔn)可以把不同的 program 行為分到不同的 family 中

例如:當(dāng) MaGC 之間的 MiGC 的數(shù)量變化很大時(shí)(即 MiGCCV很大),使用歷史數(shù)據(jù)就很吃力,因?yàn)闅v史數(shù)據(jù)無法捕獲內(nèi)存行為的巨大變化(幾個(gè)數(shù)量級)。相反,如果只是用最近的歷史數(shù)據(jù)(意味著使用一個(gè)更小的 FWS ),則預(yù)測的準(zhǔn)確率會(huì)顯著提高。

5. Experimental evaluation 5.1 Experiment #1 Generality assessment

TRINI was applied to four load balancing algorithms to assess its generality

load balancing algorithms
original developed
round robin GC - round robin
weighted round robin GC - weighted round robin
random GC - random
weighted random GC - weighted random
test environment

52 virtual machines

50 applicationi nodes

1 load balancer

1 load tester node (performance test -- Apache JMeter)

garbage collection strategies

GC 策略是影響 GC 行為的一個(gè)主要因素

serial GC

parallel GC

concurrent GC

evaluation criteria

performance

throughput

response time

overhead

CPU (%)

memory (MB)

FA (forecast accuracy) ----- 3 metrics were calculated

FE ( forecast error)

MiGCAVG (the average number of MiGCs that occured between two MaGC events)

capture the relationship between the heap size and the memory allocaion required by an application (major factors influencing the GC)

MiGCAVG 越小, MaGC 發(fā)生的次數(shù)越多。此時(shí)程序的 old generation 總是非常頻繁的被耗盡

如果 MiGCAVG接近0,則會(huì)產(chǎn)生內(nèi)粗不足異常

MiGCCV (the coefficient of variation)

是 MiGCAVG 的標(biāo)準(zhǔn)差

用來比較不同程序在內(nèi)存使用方面的變化

performance improvement

TRINI worked well irrespective of GC stategies and load balancing algorithms

difference in memory behaviors across the tested application

analyse MiGCCV behaviors

MiGCCV越小,預(yù)測的準(zhǔn)確率越高

overhead

overhead

in the application nodes

TRINI proved to be lightweight in terms of CPU and memory ———— 增幅很小

by the data gathering process

in the load balancer node

相對較高 (compared to application nodes)

overhead is independent of load balancing algorithms

5.2 Experiment #2 Scalability assessment test environment

the cluster size is varizble

covering the range of 5~50 application nodes in increments of 5

the number of concurrent users was increaseed proportionally to the cluster size

5-node --> 50 users

10-node --> 100 users

and so on

performance

hypothesis (comfirmed)

performance improvements should not degrade when the cluster size increases (not strict)

the difference in improvements among the tested programs were due to their diversities in memory/GC behavior

overhead

cost in the application nodes

was minimal and relatively constant and independent of the cluster size

cost in the load balancer node

was dependent of the cluster size

5.3 Experiment #3 Reliability assessment test environment

50 nodes

duration of the test runs was increased from 1 to 24 hours

performance improvements

carry out a breakdown of the behavior of each experimental configuration on an hourly basis

remains stable through time

overhead

application node

minimal overhead ( relatively constant)

load balancer node

higher (but quite steady)

main contribution to this increase is the number of forecast processes, which is not influenced by time by the size of the cluster

stability in the memory footprint

data older than required FWS, the data is automatically purged

5.4 Final discussion for practitioners

to estimate the FA, the MiGCCV has proven to be a useful metric

more GC intensive applications can benefit most from TRINI

in terms of the overhead introduced to the load node, results have shown that the overhead usually follows a relatively linear growth with respect to the cluster size

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://www.ezyhdfw.cn/yun/66458.html

相關(guān)文章

  • JavaScript代碼整潔之道

    摘要:代碼整潔之道整潔的代碼不僅僅是讓人看起來舒服,更重要的是遵循一些規(guī)范能夠讓你的代碼更容易維護(hù),同時(shí)降低幾率。另外這不是強(qiáng)制的代碼規(guī)范,就像原文中說的,。里式替換原則父類和子類應(yīng)該可以被交換使用而不會(huì)出錯(cuò)。注釋好的代碼是自解釋的。 JavaScript代碼整潔之道 整潔的代碼不僅僅是讓人看起來舒服,更重要的是遵循一些規(guī)范能夠讓你的代碼更容易維護(hù),同時(shí)降低bug幾率。 原文clean-c...

    liaorio 評論0 收藏0

發(fā)表評論

0條評論

最新活動(dòng)
閱讀需要支付1元查看
<