How to make Ruby or Python web sites to use multiple cores?
<p>Even though <a href="http://twistedmatrix.com/pipermail/twisted-python/2004-May/007896.html">Python</a> and <a href="http://www.reddit.com/comments/6wmum/thread_safe_ruby_on_rails_in_22_release/">Ruby</a> have one kernel thread per interpreter thread, they have a global interpreter lock (GIL) that is used to protect potentially shared data structures, so this inhibits multi-processor execution. Even though the portions in those languajes that are written in C or C++ can be free-threaded, that's not possible with pure interpreted code unless you use multiple processes. What's the best way to achieve this? <a href="http://blogs.codehaus.org/people/tirsen/archives/001041_ruby_on_rails_and_fastcgi_scaling_using_processes_instead_of_threads.html">Using FastCGI</a>? Creating a <a href="http://blog.innerewut.de/files/images/stage_2.png">cluster or a farm</a> of virtualized servers? Using their Java equivalents, JRuby and Jython?</p>

<p>I'm not totally sure which problem you want so solve, but if you deploy your python/django application via an apache prefork MPM using mod_python apache will start several worker processes for handling different requests.</p>

<p>If one request needs so much resources, that you want to use multiple cores have a look at <a href="http://pyprocessing.berlios.de/" rel="nofollow">pyprocessing</a>. But I don't think that would be wise.</p>
