Home
varnish on NetBSD, 2010-12-01 16:40:06 #

So for a while now i have been admiring varnish for its crazy speed. So I decided to add it to my system and try out a few things.

  • pkgsrc
    First I went to pkgsrc only to find varnish 2.0. I wanted the latest, varnish 2.1, so I had to upgrade that. There are also rc scripts included in there, but they're very rudimentary.
  • Next I needed to get varnish actually functioning, which required a few changes to my apache config (moving it to a different port).
    Listen 0.0.0.0:8282
    ...
    NameVirtualHost *:8282
    <VirtualHost *:8282>
    
  • Then actually setting up varnish
    #/etc/rc.conf
    varnishd=YES
    varnishd_flags="-a 0.0.0.0:80 -f /usr/pkg/etc/varnish/default.vcl -s malloc,25m"
    

    #/usr/pkg/etc/varnish/default.vcl
    backend default {
         .host = "127.0.0.1";
         .port = "8282";
    }
    
  • Now getting things to actually cache. Using google analytics means cookies are always set for everything.
    #/usr/pkg/etc/varnish/default.vcl
    sub vcl_recv {
        if (
            req.url ~ "^/static/" || 
            req.url ~ ".+\.html$" ||
            req.url ~ ".+\.js$" ||
            req.url ~ ".+\.css$" ||
            req.url ~ ".+\.jpg$" ||
            req.url ~ ".+\.gif$" 
           )
        {
            unset req.http.Cookie;
        }
    }
    

And that's pretty much it. I can keep messing around to get my hit rate up and I would like to setup different backends based on my Host headers, but otherwise I'm happy. 25MB is also really small.

tags: netbsd



reminiscing about NetBSD and NYCBSDCon, 2010-11-14 22:35:56 #

So I'm just back at home from a pretty full weekend of nycbsdcon meeting interesting peopl from netbsd and from apache and from dfbsd and from perl6 and from all kinds of stuff. I got to introduce myself as the illustrious owner of mspo.com and just a guy who's been around for a little while. ;)

Motivation to do more? Possibly.

Anyway, if you were there and I didn't meet you- sorry! If you're still in new york- I'm for meetups.

tags: netbsd



NYCBSDCon last call, 2010-11-11 07:18:00 #
NYCBSDCon is this weekend, so there's still a little time to make it!

tags: netbsd



cfengine3 now in main pkgsrc, 2010-11-08 17:59:22 #
cfengine3 was added to mainline pkgsrc by pettai@ so my wip/ pkg is gone.
He made some rc scripts, created an INSTALL file, and switched all of this:
${PREFIX}/share/doc/${PKGBASE}/inputs/failsafe.cf ${EGDIR}/failsafe.cf
With
${EGDIR}/inputs/failsafe.cf ${SYSCONFDIR}/failsafe.cf
which is good because I could never really figure out where those default files should end up.

tags: pkgsrc



lua in NetBSD userland, 2010-10-26 13:26:10 #
Userland Lua

NetBSD is adding a scripting language to userland

Not perl, not python, not tcl, but lua has made the grade as a userland scripting language for general use in NetBSD. This is a pretty sweet deal and I guess the approval into the kernel seemed like the fast track to userland success. I'm personally happy about the decision since including perl or python into operating system releases basically ruins the language's usability due to skewed release schedules. Lua, however, seems very stable. (releases seem infrequent enough, at least)

I wonder if NetBSD will be including luarocks or just sticking with pkgsrc.

Does cgilua work with bozohttpd? Maybe we'll find out.

tags: netbsd



0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25