Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Newest Mochiweb performance issues?

Received: by 10.227.57.144 with SMTP id c16mr1661151wbh.0.1321389256544;
        Tue, 15 Nov 2011 12:34:16 -0800 (PST)
X-BeenThere: mochiweb@googlegroups.com
Received: by 10.227.105.34 with SMTP id r34ls1292704wbo.5.gmail; Tue, 15 Nov
 2011 12:34:14 -0800 (PST)
Received: by 10.227.206.19 with SMTP id fs19mr1663345wbb.2.1321389254776;
        Tue, 15 Nov 2011 12:34:14 -0800 (PST)
Received: by 10.227.206.19 with SMTP id fs19mr1663344wbb.2.1321389254752;
        Tue, 15 Nov 2011 12:34:14 -0800 (PST)
Return-Path: <dialt...@gmail.com>
Received: from mail-dy0-f54.google.com (mail-dy0-f54.google.com [209.85.220.54])
        by gmr-mx.google.com with ESMTPS id g38si4150125wbp.3.2011.11.15.12.34.14
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Nov 2011 12:34:14 -0800 (PST)
Received-SPF: pass (google.com: domain of dialt...@gmail.com designates 209.85.220.54 as permitted sender) client-ip=209.85.220.54;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dialt...@gmail.com designates 209.85.220.54 as permitted sender) smtp.mail=dialt...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by dyk29 with SMTP id 29so556619dyk.27
        for <mochiweb@googlegroups.com>; Tue, 15 Nov 2011 12:34:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=content-type:mime-version:subject:from:in-reply-to:date
         :content-transfer-encoding:message-id:references:to:x-mailer;
        bh=P5gJca8Hw07kU7d81VAWu0XB7fqM9sBUQuGA8EMPkXs=;
        b=NReu9eGXD7Wg0MjrwkEgjhgNZNifg589HHicHY6L4XbtoQNpDrUXGeb75WHBkdj7Z9
         Ox5CWkPMTLpn5FaC+8tBao9nNU+DNPTvLwezpmOVaarz7krmQGdKIjRjjlQ6fQV7gT0m
         mSvcG/popSkImXPG61q4oGWmjxRQvF/lBK6j8=
Received: by 10.68.75.170 with SMTP id d10mr61330017pbw.49.1321389254091;
        Tue, 15 Nov 2011 12:34:14 -0800 (PST)
Return-Path: <dialt...@gmail.com>
Received: from lafayette.sf.adroll.com ([70.36.244.244])
        by mx.google.com with ESMTPS id d8sm67565761pbb.6.2011.11.15.12.34.12
        (version=TLSv1/SSLv3 cipher=OTHER);
        Tue, 15 Nov 2011 12:34:13 -0800 (PST)
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Apple Message framework v1251.1)
Subject: Re: [mochiweb] Newest Mochiweb performance issues?
From: Valentino Volonghi <dialt...@gmail.com>
In-Reply-To: <CAHqXiK=vcf+dSEpYjf5iP-P2yZ02vNicHmXrytjab92b29X...@mail.gmail.com>
Date: Tue, 15 Nov 2011 12:34:12 -0800
Content-Transfer-Encoding: quoted-printable
Message-Id: <4029701B-936C-4635-B526-D2E4295A9...@gmail.com>
References: <802FBA65-E4A5-4802-92E9-95F884C93...@gmail.com> <CACwMPm8QJqqkHLd0kgNG0Mauafb9Bx=82oVTFq=jfgYMLH5...@mail.gmail.com> <9F417F43-8707-4BFA-817C-31B8CA074...@gmail.com> <E85EC22B-4E5F-46A8-909B-70E265FFB...@gmail.com> <CACwMPm8c3COQkffnP6Wdg5cj2QRJxgESc-F6QCCKbJAVFXN...@mail.gmail.com> <365EE8F3-59D1-46DF-B4A4-C66E611AC...@gmail.com> <CACwMPm-eaSbYZ8Z7tmycXu75Jc3=q2quLtZoUPFxr3Hu+WK...@mail.gmail.com> <E5B82971-C0D4-4213-BE0E-465BEE4F0...@gmail.com> <A263BF37-8987-4448-A775-E5BA30859...@gmail.com> <CACwMPm_3gbZPWOFWCmriTZ1m-R8G60uSZNvNTDiLduai2qt...@mail.gmail.com> <2E975418-9BA9-4755-99FC-516BC2D9A...@gmail.com> <1066E796-5135-4AE9-9CD7-81C028801...@gmail.com> <D467AA71-E7FB-4F49-9E43-3E9C4BC09...@gmail.com> <CACwMPm8g1rZfxyk1rtBuFDEmpk+=HDnwUnS0gOk-Obe=ACu...@mail.gmail.com> <114AA310-8BF8-4E02-8E61-9E760E1FB...@gmail.com> <CAHqXiK=vcf+dSEpYjf5iP-P2yZ02vNicHmXrytjab92b29X...@mail.gmail.com>
To: mochiweb@googlegroups.com
X-Mailer: Apple Mail (2.1251.1)

On 15 Nov 2011, at 02:06, Ngoc Dao wrote:

> I think it is because Nginx disconnect and reconnect all the time with
> the backend server.
> =46rom Nginx doc (http://wiki.nginx.org/HttpProxyModule):
>=20
> It is an HTTP/1.0 proxy without the ability for keep-alive requests
> yet. (As a result, backend connections are created and destroyed on
> every request.) Nginx talks HTTP/1.1 to the browser and HTTP/1.0 to
> the backend server. As such it handles keep-alive to the browser.


I've run more performance tests between different versions of:

Ubuntu 11.04 and 11.10
Nginx 0.8.54 and 1.0.5
Erlang VM R14B03 and R14B04 (compiled both with same options)

This mixed in with my new code and my old code, just using ab, not a =
great tool to know actual performance but good to value differences.

I've also tried connecting directly to the mochiweb server and through =
nginx separately. I haven't run all of them yet but I have some numbers =
at the bottom.

With those numbers I don't think it's possible for nginx to be =
responsible for the slowdown, if at all considering that the new nginx =
has slightly smaller impact on performance when used even though it also =
does GeoIP. So I'd say nginx got slightly faster.

At this point it's either erlang that got slower between R14B03 and =
R14B04 or Ubuntu 11.10 that got slower than 11.04. The new mochiweb and =
my new code are considerably faster than my old code with old mochiweb =
even though the new code does more things by default, such as generating =
cookies, fetching more headers and so on. I'm gonna first try with a new =
erlang and if that proves still slow then I'll either stick with the old =
(but soon unsupported version of Ubuntu or change distribution =
entirely).

Given that Ubuntu 11.10 comes with Linux 3.0 which has several big =
changes among which Xen support, new process scheduler, big changes in =
memory management that maybe cause these slow downs.

All ran 100000 requests at 500 concurrency.

Erlang R14B03:

Ubuntu 11.04 - New Code - Direct Connection:
   - Requests per second:    4271.01 [#/sec] (mean)
   - Latency: 95% 112, 98% 262ms, 99% 3059, 100% 9286

Ubuntu 11.04 - New Code - Through Nginx 0.8.54:
   - Requests per second:    2460.42 [#/sec] (mean)
   - Latency: 95% 212, 98% 3091, 99% 3135, 100% 9214

Ubuntu 11.04 - Old Code - Direct Connection:
   [Required one retry to finish due to timeouts]
   - Requests per second:    3318.86 [#/sec] (mean)
   - LatencyL 95% 133, 98% 1063, 99% 3077, 100% 17182

Ubuntu 11.04 - Old Code - Through Nginx:
   - Requests per second:    1897.05 [#/sec] (mean)
   - Timeouts: 21
   - Latency: 95% 191, 98% 3118, 99% 3163, 100% 15006

Erlang R14B04:

Ubuntu 11.10 - New Code - Direct Connection:
   - Requests per second:    3306.48 [#/sec] (mean)
   - Latency: 95% 158, 98% 404, 99% 3086, 100% 9875

Ubuntu 11.10 - New Code - Through Nginx 1.0.5:
   - Requests per second:    1977.81 [#/sec] (mean)
   - Latency: 95% 244, 98% 3100, 99% 3168, 100% 9317

Ubuntu 11.10 - Old Code - Direct Connection:
   [Required several retries to finish due to timeouts]
   - Requests per second:    2966.25 [#/sec] (mean)
   - Latency: 95% 123, 98% 783, 99% 3058, 100% 23976

Ubuntu 11.10 - Old Code - Through Nginx 1.0.5:
   - Requests per second:    1880.54 [#/sec] (mean)
   - Timeouts: 34
   - Latency: 95% 215, 98% 3100, 99% 3288, 100% 15870

--=20
Valentino Volonghi
http://www.adroll.com