

And the browser display provides a nice high-level overview. In the command line output we also get a rich dataset about how the insert performed that can be further parsed and analyzed. When Commands per Second and CPU Usage drop, and when Memory Usage levels off, we know it’s safe to shut down netcat.

Using redis-stat -server=8282 192.3.4.5:49156 1, we get updates every second from the command line as well as in the browser at localhost:8282. There is a very fun project for monitoring Redis called redis-stat. As you’ll see, I found a better alternative to time, and then kept the socat data since it was already in the mix. But notice I haven’t included any time statistics.

socat will automatically hang up on EOF by default, which is attractive as it allows simple benchmarking with time. Some versions of netcat have -c or -q0, but not mine :( This means netcat will hang after the data has been fully processed until it’s manually told to stop. I introduced socat into the equation because my version of netcat doesn’t auto-recognize EOF. # Flat Commands $ cat flat.txt | redis-cli -pipe -h 192.3.4.5 -p 49156 > /dev/null # Redis Protocol $ cat proto.txt | redis-cli -pipe -h 192.3.4.5 -p 49156 > /dev/null
