[Tutor] Python on multicore machines

Kent Johnson kent37 at tds.net
Fri Nov 27 17:09:30 CET 2009


On Fri, Nov 27, 2009 at 10:15 AM, OkaMthembo <zebra05 at gmail.com> wrote:
> Thanks everyone,
>
> I realise that my question is vague on a few fronts. To try and clarify,
> supposing i had a box running a
> Python web app on it, and the web server handles say, 10 concurrent
> requests.

This is still pretty vague, as there are many ways to write a Python
web app and most of those have many options for deployment. But any of
the major Python web frameworks have deployment options that support
concurrent requests. For example Django deployment options:
http://docs.djangoproject.com/en/dev/howto/deployment/#howto-deployment-index

Also, remember that a request handler will spend some of its time
blocked waiting for socket I/O or database access, and this is time
when other threads can run. Also, there are asynchronous request
handling models that do not rely on threads, for example Twisted.

Kent


More information about the Tutor mailing list