[Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

Scott, Barry barry.scott at forcepoint.com
Thu Jul 11 02:45:49 MDT 2019


On Tuesday, 9 July 2019 22:04:11 BST Tom Most wrote:

...snip...

> The reactor's own thread pool is really for DNS
> resolution.

Is that still true in the default case? We are use the twisted code that talks 
to DNS servers as the threaded resolver adds too much latency.

> You risk deadlocks in a system that
> ThreadPoolThreadPoolThreadPool
> 
> 3. The specifics of what long_computation are also important. If it doesn't
> release the GIL you won't get real parallelism (this is a Python thing, not
> a Twisted thing). See this recent thread on the topic
> <https://twistedmatrix.com/pipermail/twisted-python/2019-June/032371.html>.

We pass out the computational work to other processes over unix-domain-sockets 
to avoid the GIL issues.

> 
> Though the mechanisms differ athis thread on the topicny of the above would
> cause the response time to increase as you add load.
> 
> Good luck,
> Tom

Barry






More information about the Twisted-Python mailing list