2đź‘Ť
You could have asked each of these as a separate question; any time you feel the need to enumerate a list, you should probably do that. But here goes:
- Yes, you would gain something. By hosting your Django application in Twisted, you get access to the Twisted mainloop and thereby all Twisted APIs, which you can access easily with something like Crochet. You also eliminate the overhead of having a separate web server, since Twisted can serve as an external web server as well as an application container.
- Performance is probably bottlenecked on your database and your Django code. Twisted is likely to be slightly slower than something like
nginx
at, for example, serving your static content directly, but you can make that difference fairly minimal by running your twisted server under PyPy. It seems like you’re asking about concurrency though – something like “will Twisted’s WSGI container run only one Django request at a time?” – to which the answer is “no”. Twisted’s WSGI container is multi-threaded and will run Django code more or less as it expects to be run. - It’s not clear what you’re asking here, so perhaps ask that other question after all.
2đź‘Ť
Nope, unless you heavily modify django db adapters and some core component you will not get any advantage. There are some tool for simplyfing the job, but you will be on the bleeding edge trying to adapt something built with the blocking paradigm since the beginning, to something completely different.
On the other side, performance should not be worst, as 99.9% of the time your app itself is the bottleneck, not your WSGI infrastructure.
Regarding async django, lot of people had luck with gevent, but you need to carefully analyze your app to be sure all of the components are gevent-friendly (and this could not be an easy task, expecially for db adapters).
Remember, even if your app is 99.9999999% non-blocking, you are still blocking.