<div dir="ltr">Hi Alex£¬<div> Thanks for your reply. Yes, I has been testing squid using as a reverse proxy. I tried the way of adding <span style="font-family:arial,sans-serif;font-size:14px">PGL AddrMap in my config file, but errors showed up when starting polygraph-client. My config file is as following:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:14px">----------------------------------------------------------------------------------------------------------------------------------</span></div><div><div><font face="arial, sans-serif"><span style="font-size:14px">ObjLifeCycle olcStatic = {</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> birthday = now + const(-1year); // born a year ago</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> length = const(2year); // two year cycle</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> variance = 0%; // no variance</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> with_lmt = 100%; // all responses have LMT</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> expires = [nmt + const(0sec)]; // everything expires when modified</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">};</span></font></div>
<div><br></div><div><font face="arial, sans-serif"><span style="font-size:14px">Content SimpleContent = {</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> size = exp(13000KB); // response sizes distributed exponentially</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> cachable = 100%; // 20% of content is uncachable</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> obj_life_cycle = olcStatic;</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">};</span></font></div><div><br></div><div><font face="arial, sans-serif"><span style="font-size:14px">Server S = {</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> kind = "S101";</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> contents = [ SimpleContent ];</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> direct_access = contents;</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> addresses = ['218.202.111.138:80']; // where to create these server agents</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">};</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">AddrMap Map = {</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> addresses = S.addresses;</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> names = ['218.202.111.5:8101'];</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">};</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">// a primitive robot</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px">Robot R = {</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> kind = "R101";</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> pop_model = { pop_distr = popUnif(); };</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> recurrence = 55% / SimpleContent.cachable; // adjusted to get 55% DHR</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"><br>
</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> req_rate = 10/sec;</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px"> origins = Map.names; // where the origin servers are</span></font></div>
<div><font face="arial, sans-serif"><span style="font-size:14px"> addresses = ['218.202.111.138' ** 10]; // where these robot agents will be created</span></font></div><div><font face="arial, sans-serif"><span style="font-size:14px">};</span></font></div>
<div><span style="font-size:14px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:14px;font-family:arial,sans-serif">// commit to using these servers and robots</span><br></div><div><font face="arial, sans-serif"><span style="font-size:14px">use(S, R);</span></font></div>
</div><div><br></div><div>The error info showed up when i started polygraph-clients is as following:</div><div>------------------------------------------------------------------------------------------------------------------------------------------------------</div>
<div><div>fyi: PGL configuration stored (664bytes)</div><div>000.00| fyi: all 10 Robot IP address(es) lack interface name or netmask</div><div>000.00| found 10 Robot IP address(es) total (0 unique address(es) with interface name and netmask).</div>
<div>000.00| fyi: no bench selected with use()</div><div>000.00| ./<a href="http://my_simple.pg:41" target="_blank">my_simple.pg:41</a>: error: Robot cannot find configuration for <a href="http://server@218.202.111.5:8101" target="_blank">server@218.202.111.5:8101</a></div>
</div><div>I am a newer for polygraph, and can not unstand <span style="font-family:arial,sans-serif;font-size:14px">WebAxe workload configuration c</span><font face="arial, sans-serif"><span style="font-size:14px">ompletely, so i think there are some mistakes in my configuration file. Can you help me take a look at my config file showed above for which part is wrong, and how i should modify it?</span></font></div>
<div><br></div><div> Currently, I just modify the source code as following to make it work with my squid server:<br>---------------------------------------------------------------------------------------------------------------------------------------</div>
<div><div>ostream &Oid2Url(const ObjId &oid, ostream &os) {</div><div><span class="" style="white-space:pre"> </span>if (oid.foreignUrl())</div><div><span class="" style="white-space:pre"> </span>return os << oid.foreignUrl();</div>
<div><br></div><div><span class="" style="white-space:pre"> </span>if (oid.secure())</div><div><span class="" style="white-space:pre"> </span>os << "https://";</div><div><span class="" style="white-space:pre"> </span>else</div>
<div>-<span class="" style="white-space:pre"> </span>os << (oid.scheme() == Agent::pHTTP ? "http://" : "ftp://");</div><div>+<span class="" style="white-space:pre"> </span> os << (oid.scheme() == Agent::pHTTP ? "/" : "ftp://");</div>
<div><br></div><div><span class="" style="white-space:pre"> </span>Oid2UrlHost(oid, false, os);</div><div><span class="" style="white-space:pre"> </span>Oid2UrlPath(oid, os);</div><div><span class="" style="white-space:pre"> </span>return os;</div>
<div>}</div></div><div><br></div><div>I think that is not right way to use polygraph for test reverse proxy, so look forward to your reply!</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><div>
<br></div><div><br></div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-11 0:05 GMT+08:00 Alex Rousskov <span dir="ltr"><<a href="mailto:rousskov@measurement-factory.com" target="_blank">rousskov@measurement-factory.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 03/10/2014 02:02 AM, xu tony wrote:<br>
> I've been using the "Simple tests" introdued by polygraph's User<br>
> manual to test my squid server. During testing, I found my squid can't<br>
> pull the resource from orign(that is polygraph-server) successfully.<br>
<br>
</div><div class="">> 3¡¢The command i used for starting polygraph-server and polygraph-client<br>
> is ,<br>
> /usr/local/polygraph/bin/polygraph-client --config<br>
</div><div class="">> ../workdir/<a href="http://my_simple.pg" target="_blank">my_simple.pg</a> --verb_lvl 10 --proxy<br>
> <a href="http://218.202.111.5:8101" target="_blank">218.202.111.5:8101</a><br>
<br>
<br>
> During test, i found squid have got requests from<br>
> ploygraph-client,but using a wrong url to pull resource (that is<br>
> polygraph-server).Part of my squid access log is showed as below:<br>
> --------------------------------------------------------------------------------------------------------------<br>
> 218.202.111.138 - - [10/Mar/2014:15:58:49 +0800] "GET<br>
> <a href="http://w1cbc2601.7f1c694f:8/t03/_00000003" target="_blank">http://w1cbc2601.7f1c694f:8/t03/_00000003</a> HTTP/1.1" 503 1513 "-" "-"<br>
> TCP_MISS DIRECT 0 -<br>
<br>
</div>The wrong domain name in the above log implies that your Squid is<br>
confused as to where the requests are going. This would not happen with<br>
a regular Squid configuration. Starting with a simple forward proxy<br>
configuration for Squid may be a good idea before moving on to more<br>
complex stuff (squid.conf.default may work after adding http_access<br>
rules to allow Polygraph traffic).<br>
<div class=""><br>
<br>
> I snapped http-request packets from polygraph-client, and found<br>
> request-line of http-request is not what squid expected,which caused the<br>
> squid can't pull resource from polyserver.The request-line in<br>
> http-request sent by polyclient is like that :<br>
> "GET <a href="http://218.202.111.138/w1cbc0feb.0fea1bae:00000008/t03/_00000001" target="_blank">http://218.202.111.138/w1cbc0feb.0fea1bae:00000008/t03/_00000001</a><br>
> HTTP/1.1"<br>
<br>
</div>Yes, this is what you told Polygraph to send. In a forward proxy test<br>
that you are running (from Polygraph point of view), the URL should look<br>
like the one logged above.<br>
<div class=""><br>
<br>
> The right request-line which the squid expected ,i think, shoud be like:<br>
> "GET /<a href="http://218.202.111.138/w1cbc02ee.0c726ba0:00000008/t03/_00000015" target="_blank">218.202.111.138/w1cbc02ee.0c726ba0:00000008/t03/_00000015</a> HTTP/1.0"<br>
<br>
</div>No, but if you are testing a reverse proxy, the Request URI that Squid<br>
expects should look like this:<br>
<br>
GET /w1cbc02ee.0c726ba0:00000008/t03/_00000015 HTTP/...<br>
<br>
It would still be logged as a full URL (with a host name) by Squid IIRC,<br>
but the packet capture should show from-Polygraph Request URIs without<br>
the protocol scheme and host name components.<br>
<br>
Please note that some packet capture GUIs such as Wireshark sometimes<br>
"restore" the full URL when rendering high-level details of the captured<br>
packet, even when a full URL is not present in the packet. Make sure you<br>
look at what has been actually sent and what what was rendered by GUI.<br>
<div class=""><br>
<br>
> So, i want to know which part is wrong in my test, if i have made<br>
> some mistakes in test, or polyclient sent http-request with wrong<br>
> request-line, or my squid had some problems ,or anything else? How can i<br>
> fix it?<br>
<br>
</div>You have configured Polygraph for a forward proxy test (the --proxy<br>
option does that). One possibility is that you have also configured your<br>
Squid to be a reverse proxy. If the two configurations are out of sync,<br>
bad things like the one you have described may happen.<br>
<br>
If you want to test a reverse proxy, you have to change Polygraph<br>
configuration. Do not use --proxy at all (reverse proxies are origin<br>
servers from the HTTP protocol point of view). Add a PGL AddrMap that<br>
maps proxy address (<a href="http://218.202.111.5:8101" target="_blank">218.202.111.5:8101</a>) to the Polygraph server address<br>
(S.addresses). And use map.names for Robot's origins field (R.origins)<br>
instead of S.addresses you are using there now. The WebAxe workload<br>
configuration distributed with Polygraph has a [more complex] example on<br>
how to do that.<br>
<br>
If you do not want to test a reverse proxy, reconfigure your Squid to be<br>
a regular forward proxy (starting with squid.conf.default may be a good<br>
idea).<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
<br>
</blockquote></div><br></div>