<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>ryah</title>
  <link>http://four.livejournal.com/</link>
  <description>ryah - LiveJournal.com</description>
  <lastBuildDate>Tue, 19 Aug 2008 08:02:28 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>four</lj:journal>
  <lj:journalid>1329</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/84250385/1329</url>
    <title>ryah</title>
    <link>http://four.livejournal.com/</link>
    <width>100</width>
    <height>94</height>
  </image>

<item>
  <guid isPermaLink='true'>http://four.livejournal.com/906096.html</guid>
  <pubDate>Tue, 19 Aug 2008 08:02:28 GMT</pubDate>
  <title>ebb version 0.3</title>
  <link>http://four.livejournal.com/906096.html</link>
  <description>This release includes a rather large refactoring of the internals. In particular, the core of Ebb was extracted and expanded into a separate C library called &lt;a href=&quot;http://tinyclouds.org/libebb/&quot;&gt;libebb&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;New features in Ebb 0.3 are&lt;ul&gt;&lt;li&gt;support for chunked requests (transparent)&lt;br /&gt;&lt;li&gt;support for chunked responses (set the header &quot;Transfer-Encoding: chunked&quot;)&lt;br /&gt;&lt;li&gt;support for HTTPS. Use by supplying two extra parameters to the options hash&lt;pre&gt;  Ebb::start_server(SimpleApp.new, 
                     :port =&amp;gt; 4001,
                     :ssl_cert =&amp;gt; &quot;/home/ryan/projects/ebb/benchmark/ca-cert.pem&quot;,
                     :ssl_key =&amp;gt; &quot;/home/ryan/projects/ebb/benchmark/ca-key.pem&quot;
                    )&lt;/pre&gt;to use HTTPS you must have GnuTLS installed. This is optional.&lt;br /&gt;&lt;li&gt;support for pipelined requests&lt;br /&gt;&lt;li&gt;no longer dependent on glib&lt;/ul&gt;Download at &lt;a href=&quot;http://rubyforge.org/projects/ebb/&quot;&gt;the RubyForge project page&lt;/a&gt; or by running&lt;pre&gt;gem install ebb&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;update 0.3.1&lt;/b&gt; fix small bug with chunked responses&lt;br /&gt;&lt;b&gt;update 0.3.2&lt;/b&gt; add hack to work with Merb (who doesn&apos;t send Content-Length headers even though she should).</description>
  <comments>http://four.livejournal.com/906096.html</comments>
  <category>programming</category>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/899827.html</guid>
  <pubDate>Sat, 09 Aug 2008 21:35:06 GMT</pubDate>
  <title>flow v0.0.1</title>
  <link>http://four.livejournal.com/899827.html</link>
  <description>An evented web server for YARV (Ruby 1.9)&lt;br /&gt;&lt;br /&gt;Features:&lt;ul&gt;&lt;li&gt; rack interface&lt;br /&gt;&lt;br /&gt;&lt;li&gt; persistant and pipelined requests&lt;br /&gt;&lt;br /&gt;&lt;li&gt; streaming uploads, each request is in a &lt;a href=&quot;http://www.infoq.com/news/2007/08/ruby-1-9-fibers&quot;&gt;fiber&lt;/a&gt; and will magically yield if you try to read from the request body but the data hasn&apos;t arrived yet. (like   for large uploads.) to you env[&apos;rack.input&apos;] blocks but in reality it never  blocks.  Uploads are not buffered.&lt;br /&gt;&lt;br /&gt;&lt;li&gt; responses can also be streamed. see &lt;a href=&quot;http://github.com/ry/flow/tree/779cd9ffdb549fa314b44102bcb0a6c223a21811/async_example.rb&quot;&gt;async_example.rb&lt;/a&gt; for an example of the interface. (this interface is subject to change!)&lt;br /&gt;&lt;br /&gt;&lt;li&gt; the event loop is exposed, combining your own event loop watchers with async responses allows you to do access external sockets without blocking (database, memcached, other web servers).&lt;br /&gt;&lt;br /&gt;&lt;li&gt; supports chunked requests and responses. chunked requests are transparent - it just happens. chunked responses are done when the response header.  &apos;Transfer-Encoding&apos; =&amp;gt; &apos;chunked&apos; is set (case-sensitive)&lt;/ul&gt;&lt;br /&gt;requires &lt;a href=&quot;http://rev.rubyforge.org&quot;&gt;rev&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;uses the parser from &lt;a href=&quot;http://tinyclouds.org/libebb/&quot;&gt;libebb&lt;/a&gt; which is based on Mongrel&apos;s parser. it does not use the server code from libebb, though (that&apos;s the difference between ebb and flow).&lt;br /&gt;&lt;br /&gt;You can download it by running &lt;pre&gt;gem install flow&lt;/pre&gt; You can start it with:&lt;pre&gt;Flow.start_server(ev_loop, rack_app, :port =&amp;gt; 5000)
ev_loop.run&lt;/pre&gt;&lt;br /&gt;the git repo is &lt;a href=&quot;http://github.com/ry/flow/tree/master&quot;&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The next release will support MRI (perhaps without supporting streaming uploads or by using &lt;a href=&quot;http://gist.github.com/4631&quot;&gt;poor man&apos;s fibers&lt;/a&gt;). I&apos;m still developing Ebb - i hope to have a new release soon.</description>
  <comments>http://four.livejournal.com/899827.html</comments>
  <category>libebb</category>
  <category>flow</category>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/898935.html</guid>
  <pubDate>Wed, 06 Aug 2008 19:42:47 GMT</pubDate>
  <title>flow</title>
  <link>http://four.livejournal.com/898935.html</link>
  <description>i wrote another web server today. it only works on yarv and it requires rev but it&apos;s mostly written in ruby (instead of c).&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://github.com/ry/flow/tree/master&quot;&gt;http://github.com/ry/flow/tree/master&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;it uses fibers and not threads. (maybe i&apos;ll add deferred requets later)&lt;br /&gt;it should handle chunked uploads (and &lt;s&gt;soon&lt;/s&gt; chunked responses)&lt;br /&gt;it does pipelined requests too, i think&lt;br /&gt;but not ssl.&lt;br /&gt;&lt;br /&gt;it works like &lt;a href=&quot;http://github.com/ry/flow/tree/0af258c216de0b7b5bed4254ff09774c4917be75/lib/flow.rb#L94&quot;&gt;this&lt;/a&gt;&lt;pre&gt;    def on_read(data)
      @parser.execute(data)
    rescue Ebb::RequestParser::Error
      close
    end&lt;/pre&gt;&lt;b&gt;update&lt;/b&gt; i made &lt;a href=&quot;http://four.livejournal.com/899827.html&quot;&gt;a gem release&lt;/a&gt;</description>
  <comments>http://four.livejournal.com/898935.html</comments>
  <category>libebb</category>
  <category>flow</category>
  <category>ebb</category>
  <lj:mood>addicted</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/897303.html</guid>
  <pubDate>Mon, 04 Aug 2008 09:52:42 GMT</pubDate>
  <title>ebb rewrite</title>
  <link>http://four.livejournal.com/897303.html</link>
  <description>I&apos;m nearing a release of Ebb 0.3. Ebb is a Ruby language (YARV or MRI) web server. The new version is includes a large rewrite of the internals to use my new library &lt;a href=&quot;http://tinyclouds.org/libebb/&quot;&gt;libebb&lt;/a&gt;. This brings several new features. For example, support for HTTPS (if you have GnuTLS installed), pipelined requests, chunked requests. This is mostly due to &lt;a href=&quot;http://github.com/ry/libebb/tree/7f734d35349a68fda25259e45b5fbf28aa0e2d96/ebb_request_parser.rl&quot;&gt;the new parser&lt;/a&gt; in libebb which eases the implementation of such features.&lt;br /&gt;&lt;br /&gt;If you&apos;d like to try it out - the following commands might get you started:&lt;pre&gt;git clone git://github.com/ry/ebb.git
cd ebb
rake compile
ruby benchmark/application.rb&lt;/pre&gt;If you find some bugs I&apos;d love to hear about it :)&lt;br /&gt;Hopefully by the end of the week things will stabilize enough to make a GEM release.</description>
  <comments>http://four.livejournal.com/897303.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/893825.html</guid>
  <pubDate>Sun, 27 Jul 2008 13:32:53 GMT</pubDate>
  <title>ssl on libebb</title>
  <link>http://four.livejournal.com/893825.html</link>
  <description>I added support for HTTPS to &lt;a href=&quot;http://tinyclouds.org/libebb&quot;&gt;libebb&lt;/a&gt; using &lt;a href=&quot;http://www.gnu.org/software/gnutls/&quot;&gt;gnutls&lt;/a&gt;. Usage should be transparent to the user, just replace  &lt;code&gt;ebb_server_init&lt;/code&gt; with &lt;code&gt;ebb_secure_server_init&lt;/code&gt;. libebb provides a default memory-based SSL session cache; this can be overridden by the user.</description>
  <comments>http://four.livejournal.com/893825.html</comments>
  <category>libebb</category>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/886617.html</guid>
  <pubDate>Tue, 08 Jul 2008 15:24:20 GMT</pubDate>
  <title>ebb 0.2.1</title>
  <link>http://four.livejournal.com/886617.html</link>
  <description>I released ebb-ruby 0.2.1. It has some contributed bug fixes.&lt;br /&gt;&lt;br /&gt;ebb is a ruby web server library.&lt;br /&gt;&lt;br /&gt;download it &lt;a href=&quot;http://rubyforge.org/frs/?group_id=5640&quot;&gt;here&lt;/a&gt;</description>
  <comments>http://four.livejournal.com/886617.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/861613.html</guid>
  <pubDate>Wed, 23 Apr 2008 06:17:32 GMT</pubDate>
  <title>request</title>
  <link>http://four.livejournal.com/861613.html</link>
  <description>Dear Python People,&lt;br /&gt;&lt;br /&gt;I have &lt;a href=&quot;http://github.com/ry/ebb/tree/master/src/ebb_python.c&quot;&gt;a half-working binding of Ebb to Python&lt;/a&gt; through the WSGI interface. I would like someone who can code Python-C bindings and has some experience with WSGI to check it out - perhaps fix some things - and try to get Django (or whatever y&apos;all use) running. Is anyone interested? I&apos;d be happy to give you detailed code explanations.&lt;br /&gt;&lt;br /&gt;ry</description>
  <comments>http://four.livejournal.com/861613.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/858918.html</guid>
  <pubDate>Sat, 19 Apr 2008 16:22:19 GMT</pubDate>
  <title>ebb v0.2</title>
  <link>http://four.livejournal.com/858918.html</link>
  <description>i released ebb-ruby version 0.2&lt;br /&gt;- can listen on arbitrary fd and unix domain sockets&lt;br /&gt;- supports tcp keep-alive&lt;br /&gt;- introduces &lt;code&gt;&lt;a href=&quot;http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin&quot;&gt;App#deferred?&lt;/a&gt;&lt;/code&gt;&lt;br /&gt;- bug fixes and clean code clean up</description>
  <comments>http://four.livejournal.com/858918.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/857593.html</guid>
  <pubDate>Sat, 12 Apr 2008 17:10:48 GMT</pubDate>
  <link>http://four.livejournal.com/857593.html</link>
  <description>Slides from my RuPy talk about Ebb&lt;br /&gt;&lt;a href=&quot;http://s3.amazonaws.com/four.livejournal/20080412/rupy.pdf&quot;&gt;http://s3.amazonaws.com/four.livejournal/20080412/rupy.pdf&lt;/a&gt;</description>
  <comments>http://four.livejournal.com/857593.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/856000.html</guid>
  <pubDate>Mon, 07 Apr 2008 02:08:44 GMT</pubDate>
  <title>spawn_thread?</title>
  <link>http://four.livejournal.com/856000.html</link>
  <description>I &lt;a href=&quot;http://github.com/ry/ebb/commit/7bfe53508a2139735c8641bfe57cbc2317b7c3cd&quot;&gt;added&lt;/a&gt; a new feature to Ebb-Ruby. If the application responds to the method &lt;code&gt;spawn_thread?&lt;/code&gt;, Ebb will pass that method the request environment before dispatching. If &lt;code&gt;spawn_thread?&lt;/code&gt; returns true, the request will be handled asynchronously, otherwise synchronously.&lt;br /&gt;&lt;br /&gt;Previously Ebb had the option to spawn a thread for every request or no request. This allows finer control.&lt;br /&gt;&lt;br /&gt;The implementation is simply&lt;pre&gt;if app.respond_to?(:spawn_thread?) and !app.spawn_thread?(client.env)
  process(app, client)
else
  Thread.new(client) { |c| process(app, c) }
end&lt;/pre&gt;&lt;br /&gt;For example, suppose you have one action POST /upload which will respond slowly because it does image resizes. You can write your application code to spawn those requests into a thread so the Ebb can continue to handle other requests while ImageMagick chugs. The rest of your application is snappy, say, and hence would not need the overhead of spawning a thread for each request.&lt;br /&gt;&lt;br /&gt;I&apos;m trying to release 0.2 in the next few days - it will include this feature.</description>
  <comments>http://four.livejournal.com/856000.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/854992.html</guid>
  <pubDate>Sun, 30 Mar 2008 19:07:23 GMT</pubDate>
  <title>slides</title>
  <link>http://four.livejournal.com/854992.html</link>
  <description>Here are the slides from my talk at euruko about ebb&lt;br /&gt;&lt;a href=&quot;http://s3.amazonaws.com/four.livejournal/20080330/euruko.pdf&quot;&gt;http://s3.amazonaws.com/four.livejournal/20080330/euruko.pdf&lt;/a&gt;</description>
  <comments>http://four.livejournal.com/854992.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/851574.html</guid>
  <pubDate>Mon, 24 Mar 2008 00:41:14 GMT</pubDate>
  <title>keep-alive</title>
  <link>http://four.livejournal.com/851574.html</link>
  <description>I just &lt;a href=&quot;http://github.com/ry/ebb/commit/0067b531f823399b43fd6d828b226eadb23a3dd3&quot;&gt;commited&lt;/a&gt; some code to support keep-alive. it&apos;s really surprising how much this speeds up things:&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080324/keep-alive.png&quot;&gt;&lt;br /&gt;(mongrel does not support keep-alive) pushing 8000 req/sec from ruby apps - hilarious&lt;br /&gt;&lt;br /&gt;The next bit of trickery is to support Expect/Continue (RFC 2616, sections 8.2.3 and 10.1.1). Once that is complete and the uploading is cleaned up a bit, I think Ebb will be a proper working web server.</description>
  <comments>http://four.livejournal.com/851574.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/849504.html</guid>
  <pubDate>Tue, 18 Mar 2008 12:36:23 GMT</pubDate>
  <title>Ebb 0.1.0</title>
  <link>http://four.livejournal.com/849504.html</link>
  <description>Ebb 0.1.0 is done.&lt;br /&gt;&lt;br /&gt;There are many changes and bug fixes since the last release:&lt;ul&gt;&lt;li&gt;Can now stream responses&lt;br /&gt;&lt;li&gt;Supports threaded requests now. Previously it could only process requests in a sequential manor. If a certain request took very long to process (say 10 seconds) the entire Ebb instance would hang. Now Ebb can spawn a new thread for each request to avoid this problem. (Rails cannot handle threaded requests, so it is disabled for ebb_rails however Merb users will enjoy this feature.)&lt;br /&gt;&lt;li&gt;Better memory usage. Previously Ebb was allocating all of it&apos;s memory statically at start up. Now it allocates on demand.&lt;br /&gt;&lt;li&gt;API changes - most notably the &lt;code&gt;Ebb::Server&lt;/code&gt; class has been removed. The server is started with &lt;code&gt;Ebb.start_server()&lt;/code&gt; now.&lt;/ul&gt;I&apos;ve started &lt;a href=&quot;http://groups.google.com/group/ebbebb&quot;&gt;a mailing list&lt;/a&gt; for questions and patches and moved the official repository to &lt;a href=&quot;http://github.com/ry/ebb/tree/master&quot;&gt;GitHub&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;If you try it out please send me an email about your experiences :)</description>
  <comments>http://four.livejournal.com/849504.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/848525.html</guid>
  <pubDate>Tue, 11 Mar 2008 21:57:11 GMT</pubDate>
  <title>threaded ebb</title>
  <link>http://four.livejournal.com/848525.html</link>
  <description>I&apos;ve become obsessed with getting Ebb to handle threads better and I think it&apos;s doing much better now. The main benchmark that I measure against is an application which sleeps every 10 requests for a given amount of time. This is a very realistic situation, I think; you would not want your server performance to crumble because of a single slow resource. Mongrel, which handles each request in its own thread, does this the best. But now Ebb can handle this too while only taking a modest hit at the throughput. Here is the benchmark showing all other servers being pummeled by the odd slow request. &lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080311/wait.png&quot;&gt;&lt;br /&gt;(&lt;code&gt;ebb_sequential&lt;/code&gt; is the exact same code base but without threading the requests. It can be enabled with the &lt;code&gt;-S&lt;/code&gt; option to &lt;code&gt;ebb_rails&lt;/code&gt;.)&lt;br /&gt;&lt;br /&gt;To demonstrate that &lt;code&gt;ebb_threaded&lt;/code&gt; still performs well with fast applications here are my standard graphs:&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080311/ebb.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;As you can see the sequential ebb is faster and perhaps might work better on websites where the application responds quickly to each request. Some sort of hybrid configuration would be easy to hack onto Ebb so that you could use threaded processing for certain URLs and sequential for others. The key bit looks like this&lt;pre&gt;    while @running
      FFI::server_process_connections()
      while client = FFI::waiting_clients.shift
        if threaded_processing
          Thread.new(client) { |c| c.process(app) }
        else
          client.process(app)
        end
      end
    end&lt;/pre&gt;You&apos;d just have to first evaluate &lt;code&gt;client.env[&apos;PATH_INFO&apos;]&lt;/code&gt; to see if you want threaded processing or sequential.&lt;br /&gt;&lt;br /&gt;I&apos;ll play around with this code for a few more days before I release it in a gem. It&apos;s quite possible there is something incredibly buggy and/or wrong.</description>
  <comments>http://four.livejournal.com/848525.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>6</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/847870.html</guid>
  <pubDate>Sun, 09 Mar 2008 21:28:31 GMT</pubDate>
  <title>ev loop - ruby interface</title>
  <link>http://four.livejournal.com/847870.html</link>
  <description>I&apos;ve made several attempts at rewriting the core interface between libev event loop and Ruby. The current implementation is the fastest:&lt;pre&gt;    trap(&apos;INT&apos;)  { @running = false }
    FFI::server_listen_on_port(port)
    puts &quot;Ebb listening at http://0.0.0.0:#{port}/&quot;
    @running = true
    while FFI::server_process_connections() and @running
      if client = FFI::waiting_clients.shift
        process_client(app, client)
      end
    end&lt;/pre&gt;The key here is &lt;code&gt;FFI::server_process_connections()&lt;/code&gt; which accesses the libev event loop, checks to see if there are any pending events, if so processes them - after all pending requests are finished it returns. If there are not any pending events the call blocks. The blocking is good because it prevents that while loop from running unrestrained. I have a timeout on libev which executes an event after 0.1 seconds just to get the function to return from it&apos;s blocked state occasionally.&lt;br /&gt;&lt;br /&gt;Ruby&apos;s thread scheduler will not act while a C FFI function is being called. This setup is a bit precarious for multithreaded applications - they only get processing time when that loop runs.&lt;br /&gt;&lt;br /&gt;It would be better if I could separate libev&apos;s loop from Ruby a bit more. I tried that today by putting &lt;code&gt;ev_loop()&lt;/code&gt; in it&apos;s own pthread separated from the Ruby VM. The question then is, how does the Ruby side sit and wait for new connections? libev callbacks into the RubyVM cannot be executed from the outside like this. The solution I settled on was using a pipe with a nonblocking write side and a blocking read side. Thus the Ruby loop can gracefully block until new connections come in, but still free up the scheduler to handle other threads. This is how it looks&lt;pre&gt;    notify_fd = FFI::server_listen_on_port(port)
    notifier = IO.new(notify_fd)
    puts &quot;Ebb listening at http://0.0.0.0:#{port}/&quot;
    
    while notifier.read(1)
      if client = FFI::server_next_client()
        process_client(app, client)
      end
    end&lt;/pre&gt;I like this a lot because it offers a clear interface. Unfortunately it just isn&apos;t very fast! Here it is compared to Ebb 0.0.4 and Thin:&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080309/post.png&quot;&gt; &lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080309/concurrency.png&quot;&gt; &lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080309/response.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;Revert back or profile and hope for an obvious fix? Any suggestions?</description>
  <comments>http://four.livejournal.com/847870.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/845734.html</guid>
  <pubDate>Tue, 04 Mar 2008 08:48:52 GMT</pubDate>
  <title>v0.0.3</title>
  <link>http://four.livejournal.com/845734.html</link>
  <description>Ebb 0.0.3 is up on &lt;a href=&quot;http://ebb.rubyforge.org/&quot;&gt;rubyforge&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/a2ec2b5c0b93ca91/aa3b8f7758681829#aa3b8f7758681829&quot;&gt;x-posted here&lt;/a&gt;&lt;/small&gt;</description>
  <comments>http://four.livejournal.com/845734.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/844791.html</guid>
  <pubDate>Sat, 01 Mar 2008 11:05:40 GMT</pubDate>
  <title>python</title>
  <link>http://four.livejournal.com/844791.html</link>
  <description>I&apos;m very happy to hear about &lt;code&gt;Py_BEGIN_ALLOW_THREADS&lt;/code&gt;, which if I understand it correctly will allow Python threads to coexist with Ebb&apos;s event loop&amp;mdash;something that is of continual concern in Ruby. (Ruby 1.9 has a new function called &lt;code&gt;rb_thread_blocking_region&lt;/code&gt; which does the same.) Testing Ebb against the many &lt;a href=&quot;http://www.wsgi.org/wsgi/Servers&quot;&gt;WSGI servers&lt;/a&gt; will be fun. I&apos;m especially interested in how it compares to &lt;a href=&quot;http://code.google.com/p/modwsgi/&quot;&gt;mod_wsgi&lt;/a&gt;.</description>
  <comments>http://four.livejournal.com/844791.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/844074.html</guid>
  <pubDate>Thu, 28 Feb 2008 11:55:59 GMT</pubDate>
  <title>ebb version 0.0.1 is released</title>
  <link>http://four.livejournal.com/844074.html</link>
  <description>&lt;a href=&quot;http://ebb.rubyforge.org/&quot;&gt;http://ebb.rubyforge.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(i hope for a flood of bug reports!)</description>
  <comments>http://four.livejournal.com/844074.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>20</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/843971.html</guid>
  <pubDate>Wed, 27 Feb 2008 17:06:34 GMT</pubDate>
  <title>Benchmarks from a real computer</title>
  <link>http://four.livejournal.com/843971.html</link>
  <description>I&apos;m getting very near the first release. I&apos;m a bit nervous!&lt;br /&gt;&lt;br /&gt;I had a chance to run the benchmarks on a non-shitty computer (unlike mine) and found something surprising, the performance difference between Mongrel and Evented Mongrel almost disappears. I&apos;m highly suspicious of this (are my benchmark scripts actually running Evented Mongrel on both?)&lt;br /&gt;&lt;br /&gt;Nevertheless, the results are fun to see&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080227/post_size.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080227/response_size.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080227/concurrency.png&quot;&gt;</description>
  <comments>http://four.livejournal.com/843971.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/841030.html</guid>
  <pubDate>Wed, 13 Feb 2008 02:00:11 GMT</pubDate>
  <title>i rewrote the dispatcher for ebb and now it&apos;s awesome!</title>
  <link>http://four.livejournal.com/841030.html</link>
  <description>I &lt;a href=&quot;http://repo.or.cz/w/ebb.git?a=commit;h=f85dcbe8eab0c708cf57e78466c7d5014d11bb70&quot;&gt;rewrote&lt;/a&gt; the dispatcher for Ebb after I learned about &lt;code&gt;rb_thread_schedule()&lt;/code&gt; and was able to allow each request to thread off inside of Ruby while still maintaining high throughput. That is, I solved &lt;a href=&quot;http://four.livejournal.com/839951.html&quot;&gt;the problem&lt;/a&gt; with concurrent connections. (maybe. i hope. it is 3am, after all.)&lt;br /&gt;&lt;br /&gt;The first benchmark simulates a slow response handled by a Rails application. The evented servers do not get around this blockade and end up hanging. Ebb is now able to side step this a continue to serve.  Every 10th request the Ruby application sleeps for 2 seconds.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080213/ebb_waiting.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;Here is the response size chart that I&apos;ve been posting a lot. There is a slow down from &lt;a href=&quot;http://s3.amazonaws.com/four.livejournal/20080204/responses.png&quot;&gt;previous versions&lt;/a&gt; but it&apos;s worth the speed hit if Ebb no longer blocks.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080213/ebb_response.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;(Both benchmarks are run with Ruby 1.8.6. I wonder how this all handles in 1.9?)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I will be speaking at &lt;a href=&quot;http://www.rupy.eu/2008/2/12/rupy-speakers-announced&quot;&gt;RuPy 2008&lt;/a&gt; about Ebb. I have to hurry up and get started on the Python side of things now.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;update&lt;/h2&gt;&lt;br /&gt;i reverted this code. it might come back later but i was seeing bad performance. see the branch &lt;a href=&quot;http://repo.or.cz/w/ebb.git?a=shortlog;h=pthread_for_libev_loop&quot;&gt;pthread_for_libev_loop&lt;/a&gt;. with the revert - ebb will perform as evented mongrel in the face of slow apps - i.e. very shitty.</description>
  <comments>http://four.livejournal.com/841030.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>18</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/839951.html</guid>
  <pubDate>Sun, 10 Feb 2008 23:19:55 GMT</pubDate>
  <title>Not Everything Is Good In Evented Land</title>
  <link>http://four.livejournal.com/839951.html</link>
  <description>I want to expose a weakness in Ebb. As with all evented servers (Thin and Evented Mongrel included) Ebb cannot process requests while handling one. That means, once Ebb passes the request off to Ruby it simply waits until Ruby returns an answer - and can do nothing else. If Ruby returns a response in under a second, I see very good performance from Ebb (see &lt;a href=&quot;http://four.livejournal.com/837058.html&quot;&gt;benchmarks from last week&lt;/a&gt;). However once the responses get a little slow (emulated by putting a &lt;code&gt;sleep(wait_time)&lt;/code&gt; into Ruby) the server falls apart.&lt;br /&gt;&lt;br /&gt;Oh, but Ebb isn&apos;t meant to be run by itself naked and helpless in front of a storm of traffic. There should be many of them to circumvent the fact that Ruby/Rails do not handle concurrent code well. So we put them behind a load balancer, and better yet, a &lt;a href=&quot;http://brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-for-nginx-and-mongrel&quot;&gt;fair load balancer&lt;/a&gt; which will not send requests to an upstream server that does not respond. That is, while one Ebb is hung up on some crappy Rails code, the load balancer will divert requests to others.&lt;br /&gt;&lt;br /&gt;But still, the results are not so good. I setup a small application which will wait for &lt;code&gt;x&lt;/code&gt; seconds every 10th request. Then I setup 4 Ebbs behind nginx/0.6.25 with the fair proxy patch and hit them with &lt;code&gt;ab&lt;/code&gt; for different values of &lt;code&gt;x&lt;/code&gt;.&lt;pre&gt;  ebb (c=50,wait=1)  34.75 req/sec (174 completed)
  ebb (c=50,wait=2)  15.53 req/sec (90 completed)
  ebb (c=50,wait=3)  8.29 req/sec (48 completed)
  ebb (c=50,wait=5)  2.0 req/sec (10 completed)
  ebb (c=50,wait=7)  1.43 req/sec (10 completed)
  ebb (c=50,wait=10)  1.8 req/sec (18 completed)&lt;/pre&gt;Then I did the same but with traditional threaded Mongrel&lt;pre&gt;  mongrel (c=50,wait=1)  62.74 req/sec (320 completed)
  mongrel (c=50,wait=2)  29.86 req/sec (180 completed)
  mongrel (c=50,wait=3)  17.63 req/sec (106 completed)
  mongrel (c=50,wait=5)  2.8 req/sec (14 completed)
  mongrel (c=50,wait=7)  4.28 req/sec (30 completed)
  mongrel (c=50,wait=10)  2.99 req/sec (30 completed)&lt;/pre&gt;:-/&lt;br /&gt;&lt;br /&gt;Perhaps this could be address with some sort of hybrid solution? (Record the response time of URLs and start threads for the ones that are continually lagging?)</description>
  <comments>http://four.livejournal.com/839951.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/839457.html</guid>
  <pubDate>Sun, 10 Feb 2008 15:39:18 GMT</pubDate>
  <title>ebb supports rails</title>
  <link>http://four.livejournal.com/839457.html</link>
  <description>I &lt;a href=&quot;http://repo.or.cz/w/ebb.git?a=commit;h=ce6701a3977279d45dd0bc04de046de8992c89cd&quot;&gt;added&lt;/a&gt; an executable to easily run rails applications with Ebb.&lt;br /&gt;&lt;br /&gt;You should download Ebb: &lt;code&gt;git clone git://repo.or.cz/ebb.git&lt;/code&gt;&lt;br /&gt;and install the gem: &lt;code&gt;rake package &amp;&amp; sudo gem i pkg/ebb-0.0.1.gem -- --with-ev-dir=/usr/local&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;(or where ever your &lt;a href=&quot;http://software.schmorp.de/pkg/libev.html&quot;&gt;libev&lt;/a&gt; is installed. Also make sure you have &lt;code&gt;glib-config&lt;/code&gt; in your path.)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;cd&lt;/code&gt; into your rails project and run: &lt;code&gt;ebb_rails start&lt;/code&gt;</description>
  <comments>http://four.livejournal.com/839457.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/839053.html</guid>
  <pubDate>Fri, 08 Feb 2008 23:23:04 GMT</pubDate>
  <title>Large POST support</title>
  <link>http://four.livejournal.com/839053.html</link>
  <description>I &lt;a href=&quot;http://repo.or.cz/w/ebb.git?a=commit;h=60c2af505ddde70710a36aa636a6c6573b7bb3cc&quot;&gt;added&lt;/a&gt; support for file uploads.&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080209/posts.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;It&apos;s not a spectacular graph. I have a bigger buffer. Once we start writing to file, I&apos;m slightly worse than the other servers. Hopefully this can be improved. &lt;br /&gt;&lt;br /&gt;I think this is the last major feature to add - now I can work at just making things better and smaller.</description>
  <comments>http://four.livejournal.com/839053.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/837058.html</guid>
  <pubDate>Sun, 03 Feb 2008 18:46:33 GMT</pubDate>
  <title>Sunday Night Hacking</title>
  <link>http://four.livejournal.com/837058.html</link>
  <description>Wow! I &lt;a href=&quot;http://repo.or.cz/w/ebb.git?a=commit;h=acea8d77681aa622a6cfd253c82310b4a038e6ce&quot;&gt;changed around some memory management&lt;/a&gt; and suddenly Ebb is much faster&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080204/responses.png&quot;&gt; &lt;img src=&quot;http://s3.amazonaws.com/four.livejournal/20080204/concurrency.png&quot;&gt;&lt;br /&gt;&lt;br /&gt;I&apos;m worried that these statistics are too good to be true (Perhaps Ebb is dropping connections or so?) but I can&apos;t see any evidence of that in my tests.&lt;br /&gt;&lt;br /&gt;&lt;s&gt;Ebb&apos;s memory usage is also insanely better. During this benchmark I see this:&lt;br /&gt;Ebb ~ 4 MB&lt;br /&gt;Mongrel ~ 19 MB&lt;br /&gt;Thin ~ 23 MB&lt;br /&gt;Evented Mongrel ~ 24 MB&lt;/s&gt;&lt;br /&gt;&lt;br /&gt; I started code for request bodies now - once that is done it will be usable as a real server (modulo some smaller features). Maybe there can be a first release next week?</description>
  <comments>http://four.livejournal.com/837058.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://four.livejournal.com/836126.html</guid>
  <pubDate>Thu, 31 Jan 2008 00:28:13 GMT</pubDate>
  <title>github</title>
  <link>http://four.livejournal.com/836126.html</link>
  <description>I will be pushing Ebb also to &lt;a href=&quot;http://github.com/ry/ebb/tree/master&quot;&gt;GitHub&lt;/a&gt; now (in addition to the functional but less pretty &lt;a href=&quot;http://repo.or.cz/w/ebb.git&quot;&gt;repo.or.cz&lt;/a&gt;). Supposedly GitHub does subversion mirroring automatically, but I haven&apos;t figured out how that works yet. If nothing else the &lt;a href=&quot;http://github.com/ry/ebb/commit/863f3d2dd7a55543d19b2b25a0b17831f52aa925&quot;&gt;commit pages&lt;/a&gt; are easier to read.</description>
  <comments>http://four.livejournal.com/836126.html</comments>
  <category>ebb</category>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
</channel>
</rss>
