Please ignore this. Seems that I misinterpreted my test result. Actually Pipe performance is not that bad.<div><br></div><div>BR,</div><div class="gmail_extra"><br clear="all"><div>Somsak<br><br><a href="mailto:somsaks@gmail.com" target="_blank">somsaks@gmail.com</a><br>

</div><br>
<br><br><div class="gmail_quote">On Fri, Dec 7, 2012 at 4:58 PM, Somsak Sriprayoonsakul <span dir="ltr"><<a href="mailto:somsaks@gmail.com" target="_blank">somsaks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>Hello,</div><div><br></div><div>We were trying to use Varnish as L7 HTTP request router with absolutely NO cache.</div><div><br></div><div>We created very minimal VCL rules to select correct backend and return PIPE for all requests. Below are the snippet taken from the VCL.</div>


<div><br></div><div><div>sub vcl_recv {</div><div>        # if X-Forwarded-For has been set by CDN, leave it</div><div>        if (! req.http.X-Forwarded-For) {</div><div>                set req.http.X-Forwarded-For = client.ip;</div>


<div>        }   </div><div><br></div><div>        if (req.http.host ~ "<a href="http://desired.domain.com" target="_blank">desired.domain.com</a>" &&</div><div>                (req.request == "GET" &&</div>


<div>                ! ( (req.url ~ ".*\?.*[&]?.*") ||</div><div>                    (req.url ~ ".*/$") ||</div><div>                    (req.url ~ ".*/\?.*") ||</div><div>                    (req.url ~ ".*\?.*[&]?upload.*")</div>


<div>                ))  </div><div>        ) { </div><div>                set req.backend = tier1;</div><div>        } elsif (req.request == "PUT") {</div><div>                set req.backend = tier2;</div><div>


        } elsif (req.http.host ~ "<a href="http://another.domain.com" target="_blank">another.domain.com</a>") {</div><div>                set req.backend = tier_console;</div><div>        } else {</div><div>                set req.backend = default_tier;</div>


<div>        }   </div><div>        return (pipe);</div><div>}</div><div><br></div><div>sub vcl_pipe {</div><div>        set bereq.http.connection = "close";</div><div><br></div><div>        return (pipe);</div>


<div>}</div></div><div><br></div><div>With this, Varnish work as expected, but however the performance is much lower than in "lookup" mode.</div><div><br></div><div>We tested performance by using Tsung, had 3 servers simulated 15000 clients. Backends cosists of 2 servers running NGINX. We got the following results.</div>


<div><br></div><div>- Have TSUNG did the load balancing to 2 servers (TSUNG can do round-robin load balance by itself). We got around 4500-4800 request/sec</div><div>- TSUNG point to Varnish with above VCL. request/sec drop to around 900-1000 request/sec.</div>


<div>- If we change the last line to "return (lookup);" instead of "return (pipe);", we got around 3300 request/sec.</div><div><br></div><div>I tried to play around with thread_pool, thread_pool_min, and thread_pool_max as suggested on various web sites. Even with -p thread_pool_min=100, -p thread_pool_max=5000, -p thread_pools=8, -p session_linger=50, -p cli_timeout=25, -p listen_depth=8192 the performance didn't improve much (NOTE: Varnish server has 8 core)</div>


<div><br></div><div>Is there anyway to increase performance of PIPE only mode to be, at the least, in the same level as Lookup mode? What could we do to debug the performance?</div><div><br></div><div>Best Regards,</div>

<br clear="all">
<div>Somsak<br><br><a href="mailto:somsaks@gmail.com" target="_blank">somsaks@gmail.com</a><br></div><br>
</blockquote></div><br></div>