While evaluating LuaSQL as backend connection replacement I came across this. I did a quick performance test using mysqlslap and it showed that just reading and copying the result can be significantly faster with LuaSQL.
Benchmark details
What I did was just sending the query to the backend and building up a new result-set in LUA.
This is the code for LuaSQL:
require("luasql.mysql")
local _sqlEnv = assert(luasql.mysql())
local _con = nil
function read_auth(auth)
local host, port =
string.match(proxy.backends[1].address, "(.*):(.*)")
– We explicitly connect to db "test" since
mysqlslap …