diff options
Diffstat (limited to 'archives/extend/2014-March/000356.html')
-rw-r--r-- | archives/extend/2014-March/000356.html | 96 |
1 files changed, 96 insertions, 0 deletions
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 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [99s-extend] Updating Cowboy applications + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Updating%20Cowboy%20applications&In-Reply-To=%3C53210CB8.5080109%40mcq.io%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <style type="text/css"> + pre { + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ + } + </style> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000355.html"> + <LINK REL="Next" HREF="000357.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[99s-extend] Updating Cowboy applications</H1> + <B>Joshua McQuistan</B> + <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20Updating%20Cowboy%20applications&In-Reply-To=%3C53210CB8.5080109%40mcq.io%3E" + TITLE="[99s-extend] Updating Cowboy applications">joshua.mcquistan at mcq.io + </A><BR> + <I>Thu Mar 13 02:41:12 CET 2014</I> + <P><UL> + <LI>Previous message: <A HREF="000355.html">[99s-extend] Getting started error: behaviour cowboy_http_handler undefined +</A></li> + <LI>Next message: <A HREF="000357.html">[99s-extend] Updating Cowboy applications +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#356">[ date ]</a> + <a href="thread.html#356">[ thread ]</a> + <a href="subject.html#356">[ subject ]</a> + <a href="author.html#356">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>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 + +</PRE> + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000355.html">[99s-extend] Getting started error: behaviour cowboy_http_handler undefined +</A></li> + <LI>Next message: <A HREF="000357.html">[99s-extend] Updating Cowboy applications +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#356">[ date ]</a> + <a href="thread.html#356">[ thread ]</a> + <a href="subject.html#356">[ subject ]</a> + <a href="author.html#356">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend +mailing list</a><br> +</body></html> |