erlanghigh-availabilityerlang-otperlang-supervisormochiweb

OTP: how to supervise non-OTP components?


I am building an Erlang/OTP system which consists of a MochiWeb web server, some custom Erlang/OTP applications and a few non-native components, which are the following:

I would like to achieve a high level of uptime and availability and thus I would like to know what is the best way to monitor those non-Erlang/OTP elements of the system. Basically, I would like to have each element of the system to be supervised, monitored and restarted if needed. It is easy achieveable for Erlang/OTP applications, but I don't know how to do that with non-Erlang components.


Should I wrap them as Erlang/OTP applications and include into the OTP supervision tree?

Or should I use some third-party software tools to monitor and supervise those non-Erlang/OTP components of the Erlang/OTP system?

What is the best known practice to do that?


Solution

  • The answer is it depends :P

    I have seen both methods used, but I am not too sure if one has advantages over the other. My gut feeling would be to pick the one where you manage the application through a port from within erlang. That way, you have a nice centralized way of knowing if problems crop up, and can fix things easily.