Skip to content

Instantly share code, notes, and snippets.

@iarna
Last active August 29, 2015 13:59
Show Gist options
  • Save iarna/10942633 to your computer and use it in GitHub Desktop.
Save iarna/10942633 to your computer and use it in GitHub Desktop.
Relative gearman speeds with varous combinations of client/worker and server.

We're just issuing an echo here, which is the simplest command in the Gearman protocol. You send an echo packet to the server, the server responds back with what you sent it. The numbers here give a sense of how much overhead different approaches are adding.

The test here is with the word "ping". Substantially larger payloads are likely to be interesting, along with measures on time-to-first packet in the reply, as the node.js implementation is streaming end-to-end and will start replying before the original echo request actually completes. This also means that the entire echo body never need be held in memory.

  1. Client, server in one process, no packet encode/decode:

    echo: 4.07 wallclock secs @ 12289.63/s (n=50000)

  2. Client, server in one process, stream stubs:

    echo: 8.15 wallclock secs @ 6137.30/s (n=50000)

  3. Client with C++ server, via TCP:

    echo: 10.01 wallclock secs @ 4995.37/s (n=50000)

  4. Client, server in one process, via TCP:

    echo: 14.25 wallclock secs @ 3508.64/s (n=50000)

  5. Client with separate Node.js server, via TCP:

    echo: 14.50 wallclock secs @ 3448.23/s (n=50000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment