3 comments

[ 4.3 ms ] story [ 18.6 ms ] thread
You can use this to link with nginx+lua/openresty/whatever to get a Q-powered web service that can do more than a few thousand connections per second.

Cool stuff! I can see a single machine running this being loads faster than a whole elaborate cluster of php/perl/python/node servers even with some caching.

Could this also work with just the integrated web server in q? I never tried it, but I wonder why lua is involved? Is it supposed to run parts of the logic in lua? Or does just using nginx as a reverse proxy not work well?

Using kdb as an nginx backend isn't going to work well at high loads because you'll run out of TCP port numbers to use for connections. You might try keepalive, but it still requires clients to behave.

It's in lua because nginx doesn't have a module system: getting a lua module available on all our edge nodes caused less friction than a bunch of nginx patches and an nginx deploy.

My kdb is behind haproxy; just using kdb's built-in HTTP/1.0 webserver for now. I am still experimenting with stored procedures and haproxy's regexp filtering/rewriting.

Has anyone ever compared the performance of kdb+ on Linux versus BSD? It works under compatibility mode under the latter but I have never benchmarked it against some other OS. Apparently there is Kx customer demand for a Solaris version but none for BSD?