Listing 2 Polyfill-2.pg
1. /*
2. * PolyFill-2 workload designed to pre-fill the caches before
3. * running PolyMix-2 experiments
4. *
5. */
6.
7. // These specs must be kept in sync with the PolyMix-2 workload
8. // Eventually we will re-arrange .pg files to make this synchronization
9. // automatic (XXX)
10.
11. #include `\"{}/usr/local/polydev/workloads/include/contents.pg`\"{}
12. #include `\"{}/usr/local/polydev/workloads/include/phases.pg`\"{}
13.
14. // there is one workload parameter, namely cache size
15. size Cache_size = 2GB; // adjust as needed
16.
17. // make contents 100% cachable
18. [ cntImage.cachable, cntHTML.cachable, cntDownload.cachable,
19. cntOther.cachable ] = 100%;
20.
21. // the price for having no pointers/references in PGL:
22. // we have to re-define the relationship after modifying cntImage
23. cntHTML.may_contain = [ cntImage ];
24.
25. // describe PolyFill-2 server
26. Server S = {
27. kind = `\"{}PolyFill-2-srv`\"{}; // just a label
28.
29. contents = [ cntImage: 65%, cntHTML: 15%, cntDownload: 0.5%, \
cntOther ];
30. direct_access = [ cntHTML: 95%, cntDownload: 0.8%, cntOther ];
31.
32. pconn_use_lmt = zipf(16);
33. idle_pconn_tout = 15sec;
34. http_versions = [`\"{}1.0`\"{} ]; // newer agents use
HTTP/1.1 by default
35. };
36.
37. // where the simulated servers and robots will be located
38. // these ips will need adjustments based on your local environment
39. addr[] srv_ips = ['10.100.1.3:8080', '10.100.1.3:8888' ];
40. addr[] rbt_ips = ['10.100.123.123' ** 5 ];
41.
42. // describe PolyFill-2 robot
43. Robot R = {
44. kind = `\"{}PolyFill-2-rbt`\"{}; // just a label
45. origins = srv_ips;
46.
47. recurrence = 5%; // just a little bit of hits
48. embed_recur = 100%;
49. interests = [`\"{}public`\"{}: 50%, `\"{}private`\"{} ];
50. pop_model = { pop_distr = popUnif(); };
51.
52. pconn_use_lmt = zipf(64);
53. http_versions = [`\"{}1.0`\"{} ]; // newer agents use
HTTP/1.1 by default
54. };
55.
56.
57. /* phases */
58.
59. Phase phWarm = { name = `\"{}warm`\"{}; goal.duration = 2min; \
log_stats = false; };
60. Phase phMeas = { name = `\"{}meas`\"{}; goal.fill_size =
2*Cache_size; };
61.
62. // build schedule using some well-known phases and phases defined above
63. schedule(phWarm, phMeas, phCool);
64.
65. // assign agents (servers and robots) to their hosts
66. S.addresses = srv_ips;
67. R.addresses = rbt_ips;
68.
69. // commit to using these servers and robots
70. use(S, R);
|