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.confasoversip1.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/oversipasoversip1,oversip2, etc. Modify theCONFIG_FILEvariable and set it tooversip1.conf,oversip2.conf, etc. - Copy the init script
/etc/init.d/oversipasoversip1,oversip2, etc. Modify theNAMEvariable in those scripts by setting it tooversip1,oversip2, etc.- The
NAMEvariable makes the init script to look for a default file/etc/default/$NAMEand for a PID file/var/run/oversip/$NAME.
- The
- 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).