<br><br><div class="gmail_quote">On Sun, Jul 15, 2012 at 1:38 AM, Werner Thie <span dir="ltr"><<a href="mailto:werner@thieprojects.ch" target="_blank">werner@thieprojects.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 7/14/12 12:39 AM, gelin yan wrote:<br>
><br>
><br>
> On Wed, Jul 11, 2012 at 2:08 AM, Werner Thie <<a href="mailto:werner@thieprojects.ch">werner@thieprojects.ch</a><br>
</div><div class="im">> <mailto:<a href="mailto:werner@thieprojects.ch">werner@thieprojects.ch</a>>> wrote:<br>
><br>
> On 7/10/12 6:17 AM, Laurens Van Houtven wrote:<br>
> > FWIW, I have used Ampoule to great effect, but as JP points out<br>
> it's hardly the only option. You're bound to end up with some<br>
> measure of multiprocessing. Bear in mind that not all workloads are<br>
> well-suited for this kind of problem! Always measure before deciding<br>
> to make your codebase that much more complicated :)<br>
> ><br>
> ><br>
> > cheers<br>
> > lvh<br>
> ><br>
> ><br>
> ><br>
> > On 10 Jul 2012, at 18:03, <a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a>> wrote:<br>
> ><br>
> >> On 03:14 pm, <a href="mailto:augustocaringi@gmail.com">augustocaringi@gmail.com</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:augustocaringi@gmail.com">augustocaringi@gmail.com</a>> wrote:<br>
> >>> Hi,<br>
> >>><br>
> >>> I'm researching the best way to implement/use a Twisted-based<br>
> >>> server in a multicore environment...<br>
> >>><br>
> >>> There is the Ampoule project, that I realize is considered the<br>
> >>> best way to do that. Right?<br>
> >><br>
> >> It's a way. "Best" depends on the details and goals of the project.<br>
> >><br>
> >> Here's a stackoverflow question/answer on basically the same<br>
> topic. In<br>
> >> particular, it specifically answers the question of a listening port<br>
> >> shared between multiple processes and gives examples of how to<br>
> do this:<br>
> >><br>
> >> <a href="http://bit.ly/MiCHtQ" target="_blank">http://bit.ly/MiCHtQ</a><br>
> >><br>
> >> Jean-Paul<br>
> >>> I'm also reading about the internals of Nginx HTTP server. This<br>
> >>> server utilizes the same reactor pattern of Twisted (epoll<br>
> based)...<br>
> >>><br>
> >>> "What resulted is a modular, event-driven, asynchronous,<br>
> >>> single-threaded, non-blocking architecture which became the<br>
> foundation<br>
> >>> of nginx code." <a href="http://www.aosabook.org/en/nginx.html" target="_blank">http://www.aosabook.org/en/nginx.html</a><br>
> >>><br>
> >>> But to maximize the use of processors in a multicore<br>
> environment,<br>
> >>> Nginx do this:<br>
> >>><br>
> >>> "nginx doesn't spawn a process or thread for every connection.<br>
> >>> Instead, worker processes accept new requests from a shared<br>
> "listen"<br>
> >>> socket and execute a highly efficient run-loop inside each<br>
> worker to<br>
> >>> process thousands of connections per worker"<br>
> >>><br>
> >>> My question: There is something similar in Twisted? Or do you<br>
> >>> think that is easy to implement something like that?<br>
> >>><br>
> >>> Thanks!<br>
> >>><br>
> >>> --<br>
> >>> Augusto Mecking Caringi<br>
> We observed really great scaling on multi cores with moving the<br>
> application part either to ampoule for PDF production or in the other<br>
> case I wrote an implementation of self regulating process pool based on<br>
> spread, leaving only the serving to twisted in both cases.<br>
><br>
> With handing work out to other processes you get another benefit which<br>
> is isolation of python, which is the only way to use a package, like<br>
> reportlab which survives no sort of reentrancy, for a webservice.<br>
><br>
> Werner<br>
><br>
> _______________________________________________<br>
> Twisted-Python mailing list<br>
> <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
</div></div>> <mailto:<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>><br>
<div class="im">> <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
><br>
><br>
> Hi Werner<br>
><br>
> I want to know whether you have experienced any serious bug with<br>
> ampoule? What version of ampoule did you use? Is it 0.2.0? Thanks.<br>
<br>
</div>Hi gelin<br>
<br>
Python 2.7.1 Stackless 3.1b3 060516 (release27-maint, Aug 9 2011,<br>
02:32:21)<br>
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import ampoule<br>
>>> ampoule.__version__<br>
'0.2.0'<br>
>>> import twisted<br>
>>> twisted.__version__<br>
'12.0.0'<br>
<br>
sitting in production now for almost six month, a webservice for<br>
template based PDF production with reportlab & z3c.rml.<br>
<br>
The only maintenance I do is creating more templates, never done a<br>
restart so far, logs are clean.<br>
<br>
As painless as one could wish for<br>
<div class="HOEnZb"><div class="h5"><br>
Werner<br>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>Hi Werner<br><br> Thanks for your valuable info. It looks like you are using stackless python with twisted. Have you taken any benefit from both of them? Stackless is awesome but I have no idea what is the better way to work with twisted. Thanks.<br>
<br>Regards<br><br>gelin yan<br>