<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
        <title>Kristian Lyngstøl's blog. spew posts.</title>
        <subtitle>A free software hacker's random rants. spew posts.</subtitle>
        <link href="http://kly.no/feedspew.xml" rel="self" />
        <link href="http://kly.no/" />
        <id>http://kly.no/</id>
        <updated>2022-05-09T00:00:00Z</updated>
        <author>
                <name>Kristian Lyngstol</name>
                <email>kly@kly.no</email>
        </author>
        <entry>
                <title>Announcing Spew</title>
                <link href="http://kly.no/posts/2012_04_25_Announcing_Spew.html" />
                <link rel="alternate" type="text/html" href="http://kly.no/posts/2012_04_25_Announcing_Spew.html" />
                <id>http://kly.no/posts/2012_04_25_Announcing_Spew.html</id>
                <updated>2012-04-25T00:00:00Z</updated>
		<published>2012-04-25T00:00:00Z</published>
                <summary>Spew just hit github. It can generate HTTP requests really
 fast, and that's all it's supposed to do.</summary>
		<author><name>Kristian Lyngstøl</name><email>kly@kly.no</email></author>
                <content type="html"><![CDATA[<p><cite>Posted on 2012-04-25</cite></p>
<p>I just pushed my HTTP request spewer, <tt class="docutils literal">spew</tt>, to github.</p>
<p><a class="reference external" href="http://github.com/varnish/spew">http://github.com/varnish/spew</a></p>
<p>It's Linux-specific, since it uses epoll, and the http.c-code is still
nasty, but it's also fast.</p>
<p>A reminder of what it can do:</p>
<a class="reference external image-reference" href="http://kly.no/misc/no_stress_2.png">
<img alt="http://kly.no/misc/no_stress_2.png" src="http://kly.no/misc/no_stress_2.png" style="width: 60%;" />
</a>
<p>The feature list contains:</p>
<ul class="simple">
<li>Spew opens N connections, sends M requests over each connection and then
re-opens the connection and repeats.</li>
<li>Fast request generation</li>
<li>&quot;Keep-Alive support&quot; (sort of!)</li>
<li>No analysis at all.</li>
<li>Native IPv6 support</li>
<li>Configurable, both on the command line and config file</li>
<li>It survives despite what happens if you bring your HTTP server down for a
moment. It might need some time to catch up, though.</li>
</ul>
<p>Most of the boilerplate code is actually from an old defunct project I
abandoned in 2009. All the stuff that deals with options and config files
and debug messages and whatnot. The only thing I've done recently is
<tt class="docutils literal">src/http.c</tt> and integration.</p>
<p>Also: I know the code is still horrible. Patches are welcome, as are
requests, (constructive!) comments, etc.</p>
		
		<a href="http://kly.no/posts/2012_04_25_Announcing_Spew.html#disqus_thread">Comments</a>
		]]></content>
        </entry>
        <entry>
                <title>No Stress</title>
                <link href="http://kly.no/posts/2012_04_23_No_stress.html" />
                <link rel="alternate" type="text/html" href="http://kly.no/posts/2012_04_23_No_stress.html" />
                <id>http://kly.no/posts/2012_04_23_No_stress.html</id>
                <updated>2012-04-23T00:00:00Z</updated>
		<published>2012-04-23T00:00:00Z</published>
                <summary>I spent a day hacking on a PoC for simple stress testing
 of HTTP (read: Varnish). This is a sneak preview of what I
 saw was possible.</summary>
		<author><name>Kristian Lyngstøl</name><email>kly@kly.no</email></author>
                <content type="html"><![CDATA[<p><cite>Posted on 2012-04-23</cite></p>
<p>After my last post about testing Varnish
(<a class="reference external" href="http://kly.no/posts/2012_04_19_Testing_Varnish.html">http://kly.no/posts/2012_04_19_Testing_Varnish.html</a>), and a few years of
frustration, I decided to take a look at what is actually possible.</p>
<p>So this is an example:</p>
<a class="reference external image-reference" href="http://kly.no/misc/no_stress.png">
<img alt="http://kly.no/misc/no_stress.png" src="http://kly.no/misc/no_stress.png" style="width: 60%;" />
</a>
<p>What you are seeing is Varnish doing 183k req/s on my home machine. The
important thing, however, is that the tool generating this load, cleverly
called <tt class="docutils literal">a.out</tt>, is running at 22% CPU load, and it's the single-threaded
result of one day of dirty hacking. Compare this to <tt class="docutils literal">httperf</tt> which is
hard to get over 100k req/s, or <tt class="docutils literal">siege</tt> which kills itself at about 15k
req/s on the same machine.</p>
<p>This being a prototype, the code will never see the light of day. Trust me
when I say it's horrible - that's what you get from a day of fiddling.
However, it has demonstrated to me what's possible, and I might re-start
this project now that I have an idea of what I want to do.</p>
<p>As for how <tt class="docutils literal">a.out</tt> works? It's connection-oriented, so it maintains N
open connections at any given time and spews M requests over each
connection in rather large (configurable) bursts. It also manages to NOT
die if you stop the server for a while (<tt class="docutils literal">httperf</tt> doesn't like this and
<tt class="docutils literal">siege</tt> doesn't really need any help to murder itself). It collects
roughly 0 statistics and it does not really care about response.</p>
<p>So no, it's not very good. But it's fast, and that was what I set out to
achieve.</p>
<p><em>Update:</em> So this tool is a bit more powerful. I've been able to do
280-290k req/s with a single process (and thread). This is the same machine
I did the 275k req/s record with using httperf, but that required two extra
machines to generate traffic.... Will be interesting to try booting those
tomorrow.</p>
<a class="reference external image-reference" href="http://kly.no/misc/no_stress_2.png">
<img alt="http://kly.no/misc/no_stress_2.png" src="http://kly.no/misc/no_stress_2.png" style="width: 60%;" />
</a>
		
		<a href="http://kly.no/posts/2012_04_23_No_stress.html#disqus_thread">Comments</a>
		]]></content>
        </entry>
</feed>
