Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 223 commits ahead of iamaleksey:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


travis-ci status

Lua bindings to zeromq2. Check out the ZeroMQ Guide with Lua examples.


Download a compiled version of LuaJIT 2.0.0-beta11 + lua-zmq + zeromq2.2.0 32bit & 64bit.


See and ØMQ docs.


  • ZeroMQ version 2.1, 2.2 or 3.2.
  • Might work with some 2.0.x versions (2.0.6 and lower are not supported).

For Ubuntu 10.10 users:

  • The version of ZeroMQ (2.0.6beta) that comes with Ubuntu 10.10 will not work with these bindings. Please upgrade to version 2.1.


It is recommended to either compile Lua with the "-pthread" flag or preload on Linux when using this module (see this glibc bug report):

$ LD_PRELOAD=/lib/ lua

Release 1.0


$ sudo luarocks install lua-zmq


$ sudo luarocks install lua-llthreads
$ sudo luarocks install lua-zmq-threads

Latest Git revision

With LuaRocks

$ sudo luarocks install

For threads support:

$ sudo luarocks install
$ sudo luarocks install

With CMake:

$ git clone git://
$ cd lua-zmq ; mkdir build ; cd build
$ cmake ..
$ make
$ sudo make install

Throughput benchmark

Throughput benchmark using the tcp transport over localhost:
message size: 30 [B]
message count: 100000000

Using send/recv functions running under Lua 5.1.4:
mean throughput: 1577407 [msg/s]
mean throughput: 378.578 [Mb/s]

Using send/recv functions running under LuaJIT2 (git HEAD):
mean throughput: 5112158 [msg/s]
mean throughput: 1226.918 [Mb/s]

Using send_msg/recv_msg functions running under LuaJIT2 (git HEAD):
mean throughput: 6160911 [msg/s]
mean throughput: 1478.619 [Mb/s]

C++ code:
mean throughput: 6241452 [msg/s]
mean throughput: 1497.948 [Mb/s]

Running benchmarks

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


No packages published


  • C 68.6%
  • Lua 29.8%
  • CMake 1.6%