<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 03/09/2016 06:45 AM, Ryan Stewart
      wrote:<br>
    </div>
    <blockquote
cite="mid:CA+ZzX4oVZsJxhr6GiHdcJGULeD0_zGWXvXXvfJtOcJ403qQR=Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div># Quick Background<br>
                <br>
                I inherited an Erlang system that's a fairly typical
                HTTP, almost-ReST API. The nature of the API and what it
                represents made Erlang a good choice for its concurrency
                aspects. As for the reliability aspects, we rely totally
                on a typical HTTP/S load balancer setup for HA. We do
                rolling restarts behind the LB and not hot code upgrades
                as enabled by Erlang because of the complexity of Erlang
                upgrades.<br>
                <br>
              </div>
              <div># The Question<br>
                <br>
              </div>
              Why should we run embedded mode in production? It seems
              that's the unspoken law for production systems, but why?
              Is there some performance overhead running in interactive
              mode? I've read about Code Loading Strategy in the System
              Principles User's Guide:<br>
              <a moz-do-not-send="true"
href="http://erlang.org/doc/system_principles/system_principles.html#id56789"
                target="_blank">http://erlang.org/doc/system_principles/system_principles.html#id56789</a><br>
              <br>
            </div>
            I've also read about the mode differences in the code
            server:<br>
            <a moz-do-not-send="true"
              href="http://erlang.org/doc/man/code.html" target="_blank">http://erlang.org/doc/man/code.html</a><br>
            <br>
          </div>
          I don't see anything in any of the stdlib/OTP docs about *why*
          you would choose embedded vs interactive mode. I'm leaning
          heavily toward using interactive mode everywhere, dev through
          production, because it's so much simpler and easy to
          understand. Someone please talk me out of it if that's a
          terribly Bad Idea.<br>
          <br>
        </div>
        <div>Ryan<span class=""></span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <tt>My understanding is that embedded is preferred for any
      production use, to make sure the system will fail-fast upon
      startup if there are any problems loading dependencies.  The best
      time to have something fail is when it first starts, due to its
      lifetime being undefined and possibly infinite (ignoring heat
      death in the universe, and other natural disasters that should be
      written out of legal agreements :-).  Ideally this concept is
      extended into the runtime of the server, into initialization and
      configuration source code, to make sure the server can fail-fast
      upon startup when the server is misconfigured, rather than waiting
      an arbitrary number of hours or days to find out that a problem
      exists.  This approach helps to avoid a reliance on a
      fire-fighting mentality that becomes dependant on monitoring for
      feedback on a system</tt>'s health due to the source code being a
    potentially unknowable black-box for some organizational reason.<br>
    <br>
    The interactive mode helps when testing, since things are loaded
    automatically and you can have less concern about the dependencies,
    since you are actively creating or modifying the dependencies.  In
    production, you want an iron fist's control on all the dependencies,
    to make sure everything is repeatable and the service is stable,
    otherwise the development is pursuing stability in a serious way. 
    So, that means that production usage should demand that all the
    dependencies come from a specific place at a specific version that
    is known and tracked, to be easily replicated, without any
    ambiguity.<br>
    <br>
    Best Regards,<br>
    Michael<br>
  </body>
</html>