Traffic server 性能如何
各位xdjm,大家有在實際壞境中使用過traffic server,不知道性能如何啊?
這兩天我測試traffic和squid,用ab進行壓力單頁面測試,ts和squid都是命中內存cache,測試結果卻是,併發越高,traffic的性能和squid的差距越大。
《解決方案》
traffic的性能和squid的差距越大。是TS是好呢還是壞的那個?
TS在國內最大的用戶是阿里(淘寶)和新浪。
作cache/proxy測試,建議用TS自帶的一個壓測工具jtest,我剛簡單寫了一個README放上去:
https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=blob_plain;f=tools/jtest/README;hb=b8a8e390ff209f9132a3b7d98dc7d9be592333a8
FYI
《解決方案》
感覺相同的請求量伺服器負載會低一些,但會出現miss的情況。
《解決方案》
回復 2# aaaaaa
squid比traffic好,這也是我覺得比較奇怪的地方
《解決方案》
squid性能好,應也不奇怪,ab壓測是單URL測試,TS不見的有優勢,因為一個url的測試,在處理模式上squid的單線程機制反而有更大的優勢。而TS的多線程涉及的鎖以及調度開銷啥的,就代價大了。
你要跑出多線程的效果,才能體現出TS的優勢。建議測試工具用我們改過的http_load或上面說的jtest。在TS的代碼庫里有這兩個工具。原版標準的http_load壓TS也吃力,我們改的http_load狂吃內存來提高效率,才稍微可用一些。
FYI
《解決方案》
你們沒用Web Polygraph來測試,這個應該更公平吧!談談大家都用什麼工具測試?
《解決方案》
我們自己作性能測試的測試工具以前用http_laod,正在計劃逐步轉向TS原生設計的jtest。Web Polygraph真心沒用過,不知道性能如何。
《解決方案》
真心覺得還不錯啊! 提供PGL配置語言,功能強大,貼一段配置分享下:
// this is just one of the simplest workloads that can produce hits
// never use this workload for benchmarking
string user_agent_value1 = "IE";
string user_agent_value2 = "CHROME";
/////////////////////////////////////////////////////////////////////////////////////////////////////////
//MP4
/////////////////////////////////////////////////////////////////////////////////////////////////////////
Content MP4_value1= {
kind = "HTTP_MP4_value1"; // just a label
mime = { type = undef(); prefixes = ["MP4_value1_pgclient/"]; extensions = [ ".mp4" ]; };
size = exp(5MB);
cachable = 100%;
user_agent = user_agent_value1;
//add_header = add_headers_value1;
};
Content MP4_value2= {
kind = "HTTP_MP4_value2"; // just a label
mime = { type = undef(); prefixes = ["MP4_value2_pgclient/"]; extensions = [ ".mp4" ]; };
size = exp(5MB);
cachable = 100%;
user_agent = user_agent_value2;
//add_header = add_headers_value2;
};
//ips
//addr[] srv_ips =['127.0.0.1:8001'];
//addr[] rbt_ips =['127.0.0.1' ** 10];
addr[] srv_ips =['172.134.1-10.1-145:8001', '172.170.1-10.1-145:8001'];
addr[] rbt_ips =['172.133.10-19.1-110'];
// a primitive server cleverly labeled "S101"
// normally, you would specify more properties,
// but we will mostly rely on defaults for now
Server S = {
kind = "S101";
contents = [ MP4_value1: 60%, MP4_value2: 40% ];
direct_access = contents;
addresses = srv_ips; // where to create these server agents
};
// a primitive robot
Robot R = {
kind = "R101";
pop_model = { pop_distr = popUnif(); };
recurrence = 40%; //
req_rate = 1/sec; //tps
origins = S.addresses; // where the origin servers are
addresses = rbt_ips; // where these robot agents will be created
};
/* working set capacity */
working_set_cap(48933);
/* phases (note that load is kept at constant level) */
time ExpDur = 4000hour; // experiment duration
Phase phases1 = {
name = "phases1";
goal.duration = 10% * ExpDur;
};
Phase phases2 = {
name = "phases2";
goal.duration = ExpDur - phases1.goal.duration; // the rest of the run
};
schedule(
phases1, phases2
);
// commit to using these servers and robots
use(S, R);
客戶端和伺服器端多ip模擬,加header,修改user-agent;URL據work_set中的URL集合按照重複率recurrence = 40%構造request:http://host/MP4_value1_pgclient/w19fa92dc.44827bae:00001438/t03/_00000001.mp4,
working_set_cap(48933)這個設置穩定命中率。schedule能模擬高峰低谷的情況。
我沒用過jtest,不清楚有什麼樣的測試方案!