From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3561 63.128.0.0/15 X-Spam-Status: No, score=-1.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from us-smtp-delivery-110.mimecast.com (us-smtp-delivery-110.mimecast.com [63.128.21.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B5B2520193 for ; Sat, 6 Aug 2016 04:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zendesk.com; s=mimecast20150210; t=1470456633; bh=G3OuKGZUYFAK/SOjQttY7iESeYVxc5z9HcLqS3pwq7g=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding; b=HkY1LeLh7KOW6IvgL5cnUKkdiFqhpDq8t0TXPP3I/whFNOKMXKQeqAxKOh1Y1bhcpzYdPPE3nBOyJq/5oEY2RsRFLY130iSFxGwcx3YcQKII38hGGND8QTf6Ak7ZSKgXgWKZBQS7RGTEGn7TCkJdkVpgnV2dRUgbKqmlXvWn7yY= Received: from mail-lf0-f70.google.com (mail-lf0-f70.google.com [209.85.215.70]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-84-DBp9ZjpxP8aDBIfyFyVIhw-1; Sat, 06 Aug 2016 00:10:32 -0400 Received: by mail-lf0-f70.google.com with SMTP id k135so163019594lfb.2 for ; Fri, 05 Aug 2016 21:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zendesk.com; s=zencorpemail; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/i377W37P09DB4eLBJc8QXPB2imlP5zDIajGE90iAlU=; b=IHC7GbwDTHParp976gjySpr+bkz2KgEdzU4GGJJ2Q+eAGzGF7i18Si2CgOHjQuqQO1 QPR1esymQ+y0OKF2lVuP5/HnTD+2Bzz/BHIMbiON6M1NTCi+Vbeu959MkRXx2qbt5M24 BU7COQNCclJmNYJm4HbkFGyHs6VeqkB6zn76s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/i377W37P09DB4eLBJc8QXPB2imlP5zDIajGE90iAlU=; b=Mn3j6ZyiUf5tBUxFQuk0P9eWL7JIiDPSUaHXrt3sxdyne9eFoaZF5HVOYrPn3LeQvK 4ZfrjBlWezAIYpv26ksEnORmu+p2n0s+bGJjvY37DgJmdVwZYwbrhsJM/jTE2zYktoM8 EO4MzbqUbjtLZJzEvmnqDm/6kDT4Llz70X66t0QZs4qe9tkpwRH9WKT9wGf41Ho6y+tS f4Cj5U+nsort22w07gGQkqLXgUINlGCywigw/mKuT9IkNXmJ1shTRd0cCSAkP71vOUV+ +xK/qAWyjWV03IiuOTMFkGDSx+CvlttVd38wEk+45Gdi/WdcN2NP2WWVjcoViJoWsXml m4Ng== X-Gm-Message-State: AEkoousGgW24HQm8d142eIiq31jkaiPEVgJnZ0Vo64AXA17haQtQ3zV6kI5x3uxVaqeQ0lOvTu0zP5Gh7lsm3bPCZfNRERCalaP07lDzQZ6wi1KI9UP6MkGVd9DeMTmWzklKPKf0xY9UogZe4zPPRo0gFClfq6O1kcpsLjKXmBe8D+fR8Etij6IQ6uZS X-Received: by 10.194.11.102 with SMTP id p6mr73612857wjb.104.1470456630827; Fri, 05 Aug 2016 21:10:30 -0700 (PDT) X-Received: by 10.194.11.102 with SMTP id p6mr73612564wjb.104.1470456625141; Fri, 05 Aug 2016 21:10:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.211.9 with HTTP; Fri, 5 Aug 2016 21:10:24 -0700 (PDT) In-Reply-To: <202FC1D8-3042-4CBF-9DEA-85D1BEA080F3@2be.co.il> References: <58D32D89-4523-436E-8C0E-FA8F4E7AFFB2@plezi.io> <20160806010126.GA7486@dcvr> <202FC1D8-3042-4CBF-9DEA-85D1BEA080F3@2be.co.il> From: Michael Fischer Date: Fri, 5 Aug 2016 21:10:24 -0700 Message-ID: Subject: Re: Please join the Rack Specification discussion for `env['upgrade.websocket']` To: Boaz Segev Cc: Eric Wong , unicorn-public X-MC-Unique: DBp9ZjpxP8aDBIfyFyVIhw-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: On Fri, Aug 5, 2016 at 8:09 PM, Boaz Segev wrote: > > Your Rack app could take the socket and inject it into an > > event loop running in a separate thread. That event loop > > could be 100% C code running without GVL for all unicorn > > cares. > > > Running two (or more) event loops, each with it's own resources, is waste= ful and promotes needless context switches. > > There is no reason to hijack a socket when the server can easily provide = callbacks for IO related events using it's existing established event loop. I suspect we're missing the forest for the trees here :) Unicorn is a forking webserver, not an event-driven or threaded webserver. Whether Unicorn ever supports the proposed standard or not, I wouldn't recommend it be used for typical applications that use WebSockets, as they usually involve persistent connections. Unicorn would quickly run out of worker processes capable of serving such connections anyway, so I question whether it's worth delving into the dirty details of IO syscalls. Best regards, --Michael