News for hackers. Stuff that matters.
Re:Web Framework Benchmarks Round 5 by snaky on Friday May 17, 2013 @06:49PM (#5727069)
OpenResty is twice as fast as raw Go at multiple queries DB test (dedicated hardware), huh.
Re:Web Framework Benchmarks Round 5 by stefantalpalaru on Friday May 17, 2013 @07:17PM (#5727171)
A pure Go MySQL driver is being used for the Go test. OpenResty probably uses a thin wrapper around the C library.
Re:Web Framework Benchmarks Round 5 by xt on Friday May 17, 2013 @07:20PM (#5727178)
The openresty mysql driver is in pure lua. It has a very efficient socket/pooling mechanism, using sockets from nginx.
Re:Web Framework Benchmarks Round 5 by snaky on Friday May 17, 2013 @07:50PM (#5727281)
It would be even more (much more?) effective to use preconfigured https://github.com/chaoslawful/drizzle-nginx-module location and 'ngx.location.capture' I suppose

And http://leafo.net/lapis/ is missing again.

Re:Web Framework Benchmarks Round 5 by xt on Friday May 17, 2013 @07:59PM (#5727311)
I benchmarked the pure postgresql lua driver to be ˜3 times as fast as the nginx-postgresql-c driver. When you use the nginx drivers from a lua context you have to use an internal nginx request to that location, so there's some overhead.

If you want to improve even further on the lua drivers, LuaJIT FFI is probably the right answer.

Re:Web Framework Benchmarks Round 5 by snaky on Friday May 17, 2013 @08:11PM (#5727356)
>˜3 times as fast as the nginx-postgresql-c driver

That's interesting..

>LuaJIT FFI is probably the right answer

Do you mean calling nginx internal functions (DB driver or location capture, like ngx_eval module does in that case) via FFI (I doubt if that is safe in any way) or just use libpq from LuaJIT directly?

Re:Web Framework Benchmarks Round 5 by xt on Friday May 17, 2013 @08:20PM (#5727378)
I haven't benchmarked the mysql drivers, so results might be different there.

There's some work being done by openresty author w.r.t. ffi for openresty itself, it might yield interesting results. And yes, I think both the option you listed are viable. But the lua drivers already perform very well.

Re:Web Framework Benchmarks Round 5 by bhauer on Friday May 17, 2013 @08:01PM (#5727320)
I asked leafo about adding Lapis and he sounded interested. Since then I haven't harassed him. I figure he will get to it when he can.