distssh 1.0.0

Distributed load balance over SSH

To use this package, put the following dependency into your project's dependencies section:


This package provides sub packages which can be used individually:

distssh:distssh_common - Distributed load balance over SSH

distssh:msgpack-ll - A low level @nogc, nothrow, @safe, pure and betterC compatible MessagePack library


distssh is a frontend to ssh that find the least loaded host in a cluster and execute commands on it.

It can alternatively be used to find and run an interactive shell on the least loaded host.

Getting Started

distssh depends on the following software packages:

Download the D compiler of your choice, extract it and add to your PATH shell variable.

# example with an extracted DMD
export PATH=/path/to/dmd/linux/bin64/:$PATH

Once the dependencies are installed it is time to download the source code to install distssh.

git clone https://github.com/joakim-brannstrom/distssh.git
cd distssh
dub build -b release

Copy the file in build/ to wherever you want to install it. When you have placed it at where you want the run the install command to setup the needed symlinks:

/my/install/path/distssh --install

Done! Have fun. Don't be shy to report any issue that you find.


For distssh to be useful the environment variable DISTSSH_HOSTS has to be set. The ; is used to separate hosts. Example:

export DISTSSH_HOSTS='foo;bar;wun'

When that is done it is now ready to use!

Remote Shell

This is the simplest usage.

# or
distssh --shell

Remote Command

distssh -- ls

Export the Environemnt to Remote Host

This is useful for those development environments where it is heavy to reload the shell with the correct modules. By exporting and then importing the environment on the remote host this can be bypassed/sped up.

Note that this basically requires them to be equivalent.

# store an export of the env
distssh --export-env
# now the env is reused on the remote hosts
distcmd ls

It is also possible to clone the current environment without first exporting it to a file.

distssh --clone-env -- ls


These environment variables control the behavior of distssh.

  • DISTSSH_HOSTS: the hosts to load balance among. Hosts are separated by ;. Example:
export DISTSSH_HOSTS='localhost;some_remove'
distcmd ls
  • DISTSSH_IMPORT_ENV: filename to load the environment from. Example:
export DISTSSH_IMPORT_ENV="$HOME/foo.export"
distcmd ls
  • DISTSSH_ENV_EXPORT_FILTER: environment keys to remove when creating an export. Keys are separated by ;. Example:
distssh --export-env
Joakim Brännström
Sub packages:
distssh:distssh_common, distssh:msgpack-ll
distssh:distssh_common, distssh:msgpack-ll
1.0.0 2018-Apr-11
~master 2018-Apr-11
~server-mode 2018-Apr-02
~autocomplete 2018-Mar-27
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 1 downloads total