From c807880f7ac73f813b2660ea81a00f7712a4e793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 29 Aug 2016 12:39:49 +0200 Subject: Add old mailing list archives --- archives/extend/2014-March/000356.html | 96 ++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 archives/extend/2014-March/000356.html (limited to 'archives/extend/2014-March/000356.html') diff --git a/archives/extend/2014-March/000356.html b/archives/extend/2014-March/000356.html new file mode 100644 index 00000000..a1742223 --- /dev/null +++ b/archives/extend/2014-March/000356.html @@ -0,0 +1,96 @@ + + + + [99s-extend] Updating Cowboy applications + + + + + + + + + + +

[99s-extend] Updating Cowboy applications

+ Joshua McQuistan + joshua.mcquistan at mcq.io +
+ Thu Mar 13 02:41:12 CET 2014 +

+
+ +
Hello all,
+
+I have written a Cowboy application that works fine over localhost. I'm
+now looking at ways of deploying and updating it i.e., moving from dev
+to prod in a nice manner.
+
+I have dug around the archives and have found that Cowboy does not
+support hot code reloading meaning either a restart of the vm or playing
+with code:reload_file is necessary.
+
+The latter suggests a possible rewriting of OTP's code loading mechanism
+and seems like it might be sensible to avoid.
+
+The other approach then is a restart. In previous (non-Cowboy) set ups
+I've used nginx on port 80 / 443 that talks to the web app via a unix
+socket (e.g., "web/socket"). When updating I'll start a new instance on
+a new socket (e.g., "web/socket.new") then rely on the file system's
+"mv" to switch it to "web/socket"; this works because the underlying
+file system guarantees mv to be atomic (or at least to never see a
+missing file). I can then ask the old process to shut down nicely in the
+background.
+
+For this to work it would require Cowby / Ranch to be able to listen on
+unix sockets. A glance at the documentation suggests that unix sockets
+aren't available, is this the case? What's the feasibility of it getting
+added?
+
+It might just be simpler to load-balance across multiple servers and
+safely take them out one at a time while updating.
+
+My other question is, how do others approach this problem? Did I miss
+something vitally obvious?
+
+Regards,
+Joshua
+
+
+ + +
+

+ +
+More information about the Extend +mailing list
+ -- cgit v1.2.3