Re: Non-Blocking I/O?

Jean-Paul Calderone <[email protected]> Tue, 22 Jan 2019 09:45:07 -0500
Newsgroups gmane.comp.python.twisted.web
Message-ID <CAEeXt4Pbd2g6YsnCVqY5r7E0dSuoQJFrdoVZR921nLf2zE8bQg@mail.gmail.com>
--===============3119038109056895282==
Content-Type: multipart/alternative; boundary="000000000000ad92a805800d0661"

--000000000000ad92a805800d0661
Content-Type: text/plain; charset="UTF-8"

On Mon, Jan 21, 2019 at 8:11 PM <[email protected]> wrote:

> Hi,
>   I currently use Twisted Web as a WSGI container for my Flask
> application.
> I'm trying to get good concurrent user requests but running into some
> hiccups.
>
> I see that for each user session that hits my server, twistd creates an
> OS thread. This of course will not scale will with concurrent users.
>

This behavior is defined by the WSGI specification.  If you don't want this
behavior, you don't want WSGI.

Perhaps you want to write a native Twisted application, perhaps using
klein.  Or you could find one of the WSGI variations that aims to support
asynchronous operation instead of multithreaded operation (but Twisted
doesn't provide a container for any of those).

Jean-Paul


>
> Is there a better way or perhaps command parameter I can use to support
> concurrent users with something like non-blocking IO which can handle
> thousands of concurrent users.
>
> thanks!
> Darren
>
> _______________________________________________
> Twisted-web mailing list
> [email protected]
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
>

--000000000000ad92a805800d0661
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, Jan 21, 2019 at 8:11 PM &lt;<a hr=
ef=3D"mailto:[email protected]">[email protected]</a>&gt; wrote:<br></d=
iv><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">Hi,<br>
=C2=A0 I currently use Twisted Web as a WSGI container for my Flask <br>
application.<br>
I&#39;m trying to get good concurrent user requests but running into some <=
br>
hiccups.<br>
<br>
I see that for each user session that hits my server, twistd creates an <br=
>
OS thread. This of course will not scale will with concurrent users.<br></b=
lockquote><div><br></div><div>This behavior is defined by the WSGI specific=
ation.=C2=A0 If you don&#39;t want this behavior, you don&#39;t want WSGI.<=
/div><div><br></div><div>Perhaps you want to write a native Twisted applica=
tion, perhaps using klein.=C2=A0 Or you could find one of the WSGI variatio=
ns that aims to support asynchronous operation instead of multithreaded ope=
ration (but Twisted doesn&#39;t provide a container for any of those).</div=
><div><br></div><div>Jean-Paul</div><div>=C2=A0</div><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">
<br>
Is there a better way or perhaps command parameter I can use to support <br=
>
concurrent users with something like non-blocking IO which can handle <br>
thousands of concurrent users.<br>
<br>
thanks!<br>
Darren<br>
<br>
_______________________________________________<br>
Twisted-web mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">Twisted-=
[email protected]</a><br>
<a href=3D"https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web" =
rel=3D"noreferrer" target=3D"_blank">https://twistedmatrix.com/cgi-bin/mail=
man/listinfo/twisted-web</a><br>
</blockquote></div></div>

--000000000000ad92a805800d0661--


--===============3119038109056895282==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVHdpc3RlZC13
ZWIgbWFpbGluZyBsaXN0ClR3aXN0ZWQtd2ViQHR3aXN0ZWRtYXRyaXguY29tCmh0dHBzOi8vdHdp
c3RlZG1hdHJpeC5jb20vY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL3R3aXN0ZWQtd2ViCg==

--===============3119038109056895282==--