Message from discussion
Cooperatively reading/writing a request/response in Django
network library" <gevent@googlegroups.com>
Received: by 10.52.100.3 with SMTP id eu3mr3738831vdb.0.1350524310737;
Wed, 17 Oct 2012 18:38:30 -0700 (PDT)
X-BeenThere: gevent@googlegroups.com
Received: by 10.221.10.72 with SMTP id oz8ls34417vcb.5.gmail; Wed, 17 Oct 2012
18:38:29 -0700 (PDT)
Received: by 10.52.19.201 with SMTP id h9mr3368528vde.0.1350524309905;
Wed, 17 Oct 2012 18:38:29 -0700 (PDT)
Date: Wed, 17 Oct 2012 18:38:29 -0700 (PDT)
From: Alex K <dummy...@mail.ru>
To: gevent@googlegroups.com
Cc: uWSGI developers and users list <uW...@lists.unbit.it>
Message-Id: <fad3de42-c259-4a94-bb6c-0c52f7a21795@googlegroups.com>
In-Reply-To: <C187B3BF-4598-4FA7-8C37-0991C50475E5@co.sapo.pt>
References: <C187B3BF-4598-4FA7-8C37-0991C50475E5@co.sapo.pt>
Subject: Re: Cooperatively reading/writing a request/response in Django
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_513_29585927.1350524309444"
------=_Part_513_29585927.1350524309444
Content-Type: multipart/alternative;
boundary="----=_Part_514_15916629.1350524309444"
------=_Part_514_15916629.1350524309444
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Hi Andre,
Quotation from uWSGI docs "Currently uWSGI async mode does not support the=
=20
read of POST data in async mode. This is not a big problem for most of the=
=20
apps, but if your webserver handler does not do buffering of the post data=
=20
(as apache) you could get some performance problem with big uploads."
May I suggest Nginx as a front-end with Django app served by gevent-fastcgi=
=20
via FastCGI.
Alex K
On Wednesday, October 17, 2012 11:53:57 AM UTC-4, Andr=C3=A9 Cruz wrote:
>
> Hello.=20
>
> I have a Django application that does uploads and downloads of files.=20
> Since these are slow requests, I don't want a thread or a process per=20
> request, so I was thinking of using greenlets.=20
>
> I have setup a uWSGI server with the Gevent loop, and I can do long=20
> polling requests just fine. I wait for a Gevent.Event and the thread=20
> switches to another greenlet which handles other requests meanwhile. The=
=20
> problem is that it seems read()s from the Django request object are not=
=20
> cooperative, as also response writes. Is there anyway to make these=20
> cooperative as well?=20
>
> Thanks,=20
> Andr=C3=A9 Cruz
------=_Part_514_15916629.1350524309444
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi Andre,<br><br>Quotation from uWSGI docs "Currently uWSGI async mode does=
not support the read of POST data in=20
async mode. This is not a big problem for most of the apps, but if your=20
webserver handler does not do buffering of the post data (as apache) you
could get some performance problem with big uploads."<br><br>May I suggest=
Nginx as a front-end with Django app served by gevent-fastcgi via FastCGI.=
<br><br>Alex K<br><br>On Wednesday, October 17, 2012 11:53:57 AM UTC-4, And=
r=C3=A9 Cruz wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hello.
<br>
<br>I have a Django application that does uploads and downloads of files. S=
ince these are slow requests, I don't want a thread or a process per reques=
t, so I was thinking of using greenlets.
<br>
<br>I have setup a uWSGI server with the Gevent loop, and I can do long pol=
ling requests just fine. I wait for a Gevent.Event and the thread switches =
to another greenlet which handles other requests meanwhile. The problem is =
that it seems read()s from the Django request object are not cooperative, a=
s also response writes. Is there anyway to make these cooperative as well?
<br>
<br>Thanks,
<br>Andr=C3=A9 Cruz</blockquote>
------=_Part_514_15916629.1350524309444--
------=_Part_513_29585927.1350524309444--