Lua bindings to NanoMsg.
It is recommended to either compile Lua with the "-pthread" flag or preload libpthread.so on Linux when using this module (see this glibc bug report):
$ LD_PRELOAD=/lib/libpthread.so lua
With LuaRocks:
$ sudo luarocks install https://raw.github.com/Neopallium/lua-nanomsg/master/rockspecs/lua-nanomsg-scm-1.rockspec
For threads support:
$ sudo luarocks install https://raw.github.com/Neopallium/lua-llthreads/master/rockspecs/lua-llthreads-scm-0.rockspec
$ sudo luarocks install https://raw.github.com/Neopallium/lua-nanomsg/master/rockspecs/lua-nanomsg-threads-scm-0.rockspec
With CMake:
$ git clone git://github.com/Neopallium/lua-nanomsg.git
$ cd lua-nanomsg ; mkdir build ; cd build
$ cmake ..
$ make
$ sudo make install
When running the benchmarks you will need run two different scripts (one 'local' and one 'remote'). Both scripts can be run on the same computer or on different computers. Make sure to start the 'local' script first.
Throughput benchmark:
# first start local script
$ luajit-2 perf/local_thr.lua "tcp://lo:5555" 30 1000000
# then in another window start remote script
$ luajit-2 perf/remote_thr.lua "tcp://localhost:5555" 30 1000000
Latency benchmark:
# first start local script
$ luajit-2 perf/local_lat.lua "tcp://lo:5555" 1 100000
# then in another window start remote script
$ luajit-2 perf/remote_lat.lua "tcp://localhost:5555" 1 100000