lighty's life

lighty developer blog

How to Spawn a Backend Process

I'm not completly sure yet how I will add the spawning of processes to the new mod_proxy_core. The current idea is mod_spawn described as below. If you have specific needs or ideas how to implement it, add your comment please.

Expect: Header Handling Is In

Just a short one: Handling for HTTP/1.1 Expect: 100-continue has been added. With the new infrastructure it was only a few lines to get it in. curl and some WebDAV clients were using it to verify that the server speaks HTTP/1.1.

1.4.12 Becomes 1.5.0

moo poked me today and was so right: "With all the changes going into SVN we shouldn't call the next release 1.4.12, but 1.5.0". Lifting the restriction on 'try to stay compatible to the 1.4.x plugin-API I started right away on ripping the internals apart and put them together sliglty different. If you are developing a plugin for 1.4.x right now, be asured that it won't work without changes in 1.5.0. Let me explain what is changing.

PRE-RELEASE: lighttpd-1.4.12-20060724-0947.tar.gz

I just uploaded the 3rd pre-release of lighttpd 1.4.12: "www.lighttpd.net/download/lighttpd-1.4.12-20060724-0947.tar.gz"://www.lighttpd.net/download/lighttpd-1.4.12-20060724-0947.tar.gz This pre-release should work on most platforms and it mainly got improvements for our "mongrel":http://mongrel.rubyforge.org/index.html users. A small test has shown that we can even improve the performance of mongrel by balancing over 2 local instances (on a single-cpu machine).

X-Sendfile's New Friend: X-Rewrite-*

Today on IRC I got a question on:
Fobax can you x-send-file from fast-cgi to a proxy request?
Or asked in another way ?
Can you use a mod_proxy_core backend to rewrite a URL or a Host header ?
After 30 minutes of coding ... Yes, you can ...

Mod_proxy_core Got X-Sendfile Support

As promissed mod_proxy_core would combine the features from mod_proxy and mod_fastcgi. mod_proxy gave the balancers, mod_fastcgi gave its fail-over handling and now support for X-Sendfile.

Hash Balancing With Mod_proxy_core

mod_proxy and mod_proxy_core support 3 balancers to spread the load over multiple backends. One of them is Hash balancing which is very good for balancing the load of caching proxies like Squid. If you compare the performance of Hash-Balancing to the classic round-robin balancing you should see a increase of the performance as the backends can use their caches a lot better. With RR each backend has to handle the full URL namespace, with Hash-Balancing only a part. This increases the cache-locality and the overall performance.

Reverse-Proxying Mod_proxy_core

I just added and commited the header rewriting support for mod_proxy_core.
$HTTP["url"] =~ "^/proxyme(/|$)" {
  proxy-core.balancer = "round-robin"
  proxy-core.protocol = "http"
  proxy-core.backends = ( "en.wikipedia.org" )
  proxy-core.rewrite-response = (
    "Location" => ( "^http://en.wikipedia.org/(.*)" => "http://127.0.0.1:1025/proxyme/$1" ),
  )
  proxy-core.rewrite-request = (
    "_uri" => ( "^/proxyme/?(.*)" => "/$1" ),
    "Host" => ( ".*" => "en.wikipedia.org" ),
 )
}

Mod_proxy_core Commited to Svn

mod_proxy_core just got commited to SVN and is now available to testers.
server.modules = ( ..., "mod_proxy_core", .. )

## works
$HTTP["url"] =~ "^/proxyme/" {
  proxy-core.balancer = "round-robin"
  proxy-core.protocol = "http"
  proxy-core.backends = ( "wikipedia.org" )

  ## to be done
  proxy-core.rewrite-response = (
    "Location" => ( 
      "^http://en.wikipedia.org/(.*)" => "http://127.0.0.1:1025/$1" ) )
  proxy-core.rewrite-request = (
    "URI" => (
      "^/proxyme(/.*)" => "$1" ) )
}