How to Run Multiple Instances of OverSIP

OverSIP runs in a single core. In certain scenarios (i.e. when acting as an Outbound Edge Proxy) it maybe useful to run multiple instances of OverSIP by sharing the same configuration files (so multiple cores are used). Note however that, unless you provide some mechanism for sharing memory, all those OverSIP instances will be independent.

BTW: OverSIP single thread architecture based on the “Reactor Design Pattern” is really efficient and fast, are you sure you need more?

To run multiple instances of OverSIP in the same host the following steps must be done:

Debian and Ubuntu

  • Copy the main configuration file /etc/oversip/oversip.conf as oversip1.conf, oversip2.conf, etc. Modify the port values in those files so different instances of OverSIP won’t attempt to bind in the same port (it would make OverSIP to fail).
  • Copy the default file /etc/default/oversip as oversip1, oversip2, etc. Modify the CONFIG_FILE variable and set it to oversip1.conf, oversip2.conf, etc.
  • Copy the init script /etc/init.d/oversip as oversip1, oversip2, etc. Modify the NAME variable in those scripts by setting it to oversip1, oversip2, etc.
    • The NAME variable makes the init script to look for a default file /etc/default/$NAME and for a PID file /var/run/oversip/$NAME.
  • Add the new init scripts to the system runleves:
    update-rc.d oversip1 defaults
    update-rc.d oversip2 defaults
    ...
    

And that’s all. Now you have multiple OverSIP instances, each one with its own init script but sharing the configuration files under /etc/oversip/ directory (all but the main configuration file oversipN.conf).