squid压力测试工具Web Polygraph
来源:互联网 发布:对外经贸知乎 编辑:程序博客网 时间:2024/05/18 10:04
http://www.web-polygraph.org
// this is just one of the simplest workloads that can produce hits// never use this workload for benchmarkingContent value1= { kind = "HTTP_value1"; // just a label mime = { type = undef(); prefixes = ["MP4_value1_pgclient/"]; extensions = [ ".mp4" ]; };size = exp(5MB); cachable = 100%;};Content value2= { kind = "HTTP_value2"; // just a label mime = { type = undef(); prefixes = ["MP4_value2_pgclient/"]; extensions = [ ".mp4" ]; };size = exp(5MB); cachable = 100%;};//ips//addr[] srv_ips =['127.0.0.1:8002'];//addr[] rbt_ips =['127.0.0.1' ** 10];addr[] srv_ips =['172.134.1-10.1-145:8002', '172.170.1-10.1-145:8002'];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 nowServer S = {kind = "S101"; contents = [ value1: 60%, value2: 40% ];direct_access = contents;addresses = srv_ips; // where to create these server agents};// a primitive robotRobot R = {kind = "R101";pop_model = { pop_distr = popUnif(); };recurrence = 40%; // req_rate = 1/sec;origins = S.addresses; // where the origin servers areaddresses = 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 durationPhase 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 robotsuse(S, R);
./polygraph-client --cfg_dirs ../share/polygraph/workloads/include/ --config ./simple.pg --verb_lvl 10 --log a.log --proxy 127.0.0.1:3128
- nginx
- url rewrite. request http url like "http://ip:port/MP4_value1_pgclient/w19fa92dc.44827bae:00001438/t03/_00000001.mp4" and "http://ip:port/MP4_value2_pgclient/w19fa92dc.44827bae:00001438/t03/_00000001.mp4".
#rewrite about polygraphrewrite "^(/MP4_value1_pgclient)" /video-test/value1_stream.mp4;rewrite "^(/MP4_value2_pgclient)" /video-test/value2_stream.mp4;
- cacheable: Represents 30% of the line "if sum% 10 <3 then" cacheable.
location ~ \.(flv|mp4|3gp) { set $v1 "null"; set $v2 "null"; set $v3 "null";if ($request_uri ~* ^\/[0-9a-zA-Z_]*_pgclient\/([0-9a-zA-Z:\.]*)\/([0-9a-zA-Z]*)\/([_0-9a-zA-Z]*)\.(flv|mp4|3gp)$ ) {set $v1 $1; set $v2 $2; set $v3 $3;header_filter_by_lua 'sum=0; string_key = ngx.var.v1 .. ngx.var.v2 .. ngx.var.v3;for i=1, string.len(string_key) dosum = sum + string.byte(string_key, i);end ngx.header["X-test_value"] = ngx.var.v1 .. ngx.var.v2 .. ngx.var.v3 .. "--" .. sum .. ":" .. sum%10; if sum % 10 < 3 then ngx.header["Cache-Control"] = "private"; else ngx.header["Cache-Control"] = "public";end';} }
- add header:
location ~ \.mp4 { mp4; expires 120s; add_header Cache-Control public; }
- squid压力测试工具Web Polygraph
- squid 压力测试工具
- web压力测试工具
- Web压力测试工具
- Web压力测试工具
- web压力测试工具
- web 压力测试工具
- web压力测试工具
- web压力测试工具
- Web压力测试工具
- Web 压力测试工具
- WEB压力测试工具
- web压力测试工具 压力测试 webbench
- Web应用压力测试工具
- [Tool]Web压力测试工具
- Web 压力测试工具 -- WebBench
- 总结web压力测试工具
- web压力测试工具介绍
- jQuery的ajax使用场景讨论(c#)
- Unix的轻巧“约取而实得”(中篇)
- sql存储过程完全教程
- 内存指针基地址查询算法
- Unix的轻巧“约取而实得”(下篇)
- squid压力测试工具Web Polygraph
- 【Android Training - 02】适配不同的屏幕[Lesson 2 - 适配不同屏幕密度]
- Cloud9 ide 云开发环境介绍
- 新iPad上市之后:剩下的iPad 2的另类利用
- plsql 调试权限的解决方法
- Java不用临时变量temp将两个数交换(面试题)
- select 1 from 浅析
- Visual C++中实现对图像数据的读取显示
- java编程循环语句使用中提升性能的几点建议