Home Download Documentation Development Community Support
NOTE: This documentation is for version 0.6-beta of nanomsg, but the latest released version is 1.1.4. Please see the documentation for 1.1.4 for the most up-to-date information.


Environment variables that influence the way nanomsg works


This functionality is experimental and a subject to change at any time

Following environment variables are used to turn on some debugging for any nanomsg application. Please, do not try to parse output and do not build business logic based on it.


If set to non-empty string nanomsg will print errors to stderr. Some errors will be resolved by nanomsg itself (e.g. if nanomsg can’t establish connection it will retry again in a moment). Some depend on the environment (e.g. port that is bound by another process need to be released). In any case nanomsg will not repeat the error message until error is clear and appear again (e.g. connection established then broken again).


If set to non-empty string nanomsg will print some statistics to stderr. That’s statistics is intended for debugging purposes only.


The nanomsg address to send statistics to. Nanomsg opens NN_PUB socket and sends statistics there. The data is sent using ESTP protocol.


The output of both debugging facilities (NN_PRINT_ERRORS, NN_PRINT_STATISTICS) is intended for reading by human and a subject for change at any time (even after 1.0 release).

The NN_STATISTICS_SOCKET facility is intended to use by system administrators to debug network and application issues. The ESTP format is stable. But the nanomsg support of it is experimental and is subject to change or removal until 1.0 release.

Anyway, there is no excuse for making application logic based on the data described here. And by application logic we mean any of the following:

  • Load balancing

  • Failover

  • Routing requests

  • Executing nn_connect/nn_bind

There are other ways for load-balancing and failover in nanomsg. If you feel you can’t do something, consider ask on the mailing list first.



Paul Colomiets <>

"nanomsg" is a trademark of Garrett D'Amore.