News for hackers. Stuff that matters.
Re:Snap: A Haskell Web Framework by crazydiamond on Saturday May 22, 2010 @06:17AM (#1370106)
I had a look at the benchmarks. Could someone confirm -- larger values (bars) means better. So RoR is the worst, and Snap the best on both benchmarks.
Re:Snap: A Haskell Web Framework by chriseidhof on Saturday May 22, 2010 @07:02AM (#1370139)
Yes, it's the number of requests handled. More requests served is better.
Re:Snap: A Haskell Web Framework by acangiano on Saturday May 22, 2010 @08:49AM (#1370235)
What was the deployment stack like for Rails? The numbers are way off.
Re:Snap: A Haskell Web Framework by mightybyte on Saturday May 22, 2010 @05:00PM (#1371048)
I downloaded Rails, followed a few online tutorials to build the app, and ran script/server to run the server. As mentioned in the benchmarking document, we're not experts on Rails deployment and will gladly accept suggestions for improvements that can be implemented in a few minutes.
Re:Snap: A Haskell Web Framework by acangiano on Saturday May 22, 2010 @07:16PM (#1371261)
You are running the benchmark with WEBrick, a slow, development only web server. For Rails you should run nginx + Passenger.
Re:Snap: A Haskell Web Framework by davidmathers on Saturday May 22, 2010 @07:49PM (#1371306)
For Rails you should run nginx + Passenger

No, that's for a production website and requires setup. They just need to replace webrick with thin.

> gem install thin

then

> thin start

instead of

> ./script/server

Simple.

Re:Snap: A Haskell Web Framework by mightybyte on Sunday May 23, 2010 @01:49AM (#1371887)
I ran the benchmark with the thin server using the following httperf command:

httperf --hog --num-conns 1000 --num-calls 1000 --burst-length 20 --port 3000 --rate 1000 --uri=/pong

The best I got was 258 requests / sec and 13.5 average responses / sec. The chart on the website plots responses / sec. So thin seems to perform worse. I'm guessing that we're running into the limit of 1024 file descriptors. I didn't test with the libev version of Snap, so my testing had that limit too, but my guess is that Snap is faster and manages to stave off the limit long enough to serve a reasonable number of requests. But I don't know for sure.

Re:Snap: A Haskell Web Framework by rufugee on Saturday May 22, 2010 @08:58PM (#1371433)
Um...shouldn't it also be:

script/server -e production

Running in development mode severely hampers Rails' performance.

Re:Snap: A Haskell Web Framework by davidmathers on Saturday May 22, 2010 @09:39PM (#1371511)
Good point. I also noticed they're running snap with 4 threads. Since rails is multi-process rather than multi-thread they would actually need to set up something like passenger as acangiano suggested.

Better would be to just limit the test to single-process/single-thread. The idea should be to compare web frameworks not web servers.

Re:Snap: A Haskell Web Framework by mightybyte on Sunday May 23, 2010 @12:51AM (#1371823)
Yes, but it's also useful to compare similar levels of effort. Using 4 threads with Snap is a similar level of effort to using thin. Setting up 4 separate processes with passenger requires quite a bit more effort, especially if you haven't done it before.
Re:Snap: A Haskell Web Framework by davidmathers on Sunday May 23, 2010 @05:46AM (#1372076)
You can set up 4 processes with thin, just do:

> thin -e production -s 4 start

The problem is that each process listens on its own port. They can't all listen on port 3000, so you need some sort of proxy to parcel out the requests.

Re:Snap: A Haskell Web Framework by mightybyte on Sunday May 23, 2010 @12:43AM (#1371811)
I did use -e production, just didn't remember to mention it in the post above. I'll try thin though.
Re:Snap: A Haskell Web Framework by rufugee on Saturday May 22, 2010 @01:31PM (#1370687)
Agreed...I'm surprised Rails is SOOOO far behind everyone else.