summaryrefslogtreecommitdiffstats
path: root/archives/extend/2013-April/000087.html
blob: b024dbf33316e5fda2d49ea562dc0dd7a44197d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
 <HEAD>
   <TITLE> [99s-extend] cowboy and chromium
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20cowboy%20and%20chromium&In-Reply-To=%3C90FA9B10-201C-469E-AF79-749CF56160F1%40gmail.com%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="000092.html">
   <LINK REL="Next"  HREF="000089.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[99s-extend] cowboy and chromium</H1>
    <B>Sasa Juric</B> 
    <A HREF="mailto:extend%40lists.ninenines.eu?Subject=Re%3A%20%5B99s-extend%5D%20cowboy%20and%20chromium&In-Reply-To=%3C90FA9B10-201C-469E-AF79-749CF56160F1%40gmail.com%3E"
       TITLE="[99s-extend] cowboy and chromium">sasa.juric at gmail.com
       </A><BR>
    <I>Wed Apr 10 14:00:47 CEST 2013</I>
    <P><UL>
        <LI>Previous message: <A HREF="000092.html">[99s-extend] Heartbeat?
</A></li>
        <LI>Next message: <A HREF="000089.html">[99s-extend] cowboy and chromium
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#87">[ date ]</a>
              <a href="thread.html#87">[ thread ]</a>
              <a href="subject.html#87">[ subject ]</a>
              <a href="author.html#87">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Hi,

I have recently in my production system replaced mochiweb with cowboy. The server generally works fine, except for a bizarre behavior which I cannot quite explain, so I post here, hoping to get some pointers.

After replacing mochiweb with cowboy, I noticed that in chromium (other major browsers work fine) often (but not always) a request lasts a little more than a minute. Further inspection in <A HREF="chrome://net-internals">chrome://net-internals</A> showed that browser tries to send a request, times out after 60 sec, retries and then succeeds immediately. The key point is that it doesn't happen always. First couple of requests work fine, then all of a sudden one doesn't work. At the same time requests from other browsers (including chrome) on the same machine work fine.

If I revert to mochiweb, the problem disappears. Other than web server related code, everything else is the same: the rest of my code, the server setup etc... In addition, I return same responses and headers in both versions.

After many attempts and failures, I might have worked around the issue. Namely, I included &lt;&lt;&quot;connection&quot;&gt;&gt;, &lt;&lt;&quot;close&quot;&gt;&gt; in all responses. After this change, it seems that long requests are not occurring. In any case, I can't reproduce it anymore, whereas before the change I could have reproduce it easily.

However, I'm not sure if I have really resolved the issue, I'm also not happy with connection closes since it degrades performance. And finally, I'm not sure if I quite understand the problem. 
The only theory I have is that due to keep-alive, chromium holds the connection, while cowboy closes it (I read somewhere that hardcoded timeout is 5 seconds, right?). In this case it might happen that chromium sends a request to a non existing socket and then hangs for a minute, waiting for the response which never arrives. 
This might further be amplified by the fact that in production, between browser and cowboy, there is a proxy/load balancer, so maybe load balancer still holds the connection despite the fact that server had closed it.

This is the only theory I currently have, and I would like to hear if you guys have some other idea or any kind of helpful pointer?

Thank you very much in advance and best regards,
Sasa
</PRE>

<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	<LI>Previous message: <A HREF="000092.html">[99s-extend] Heartbeat?
</A></li>
	<LI>Next message: <A HREF="000089.html">[99s-extend] cowboy and chromium
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#87">[ date ]</a>
              <a href="thread.html#87">[ thread ]</a>
              <a href="subject.html#87">[ subject ]</a>
              <a href="author.html#87">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://lists.ninenines.eu/listinfo/extend">More information about the Extend
mailing list</a><br>
</body></html>