From: Joshua B. <jrb...@lb...> - 2007-08-15 17:34:34
|
In our last conversation about Apache, Graham roasted me for erroneously claiming global variables are of no concern because of the python GIL. It seems I can't get this right, but if you're using Apache I recommend looking at previous posts by Graham :) -josh On Aug 14, 2007, at 3:53 PM, Graham Dumpleton wrote: > On Aug 15, 5:23 am, Joshua Boverhof <jrbover...@lbl.gov> wrote: >> Probably, it has a class attribute "location". So unless you're >> writing over this there there is nothing else to worry about. >> >> Make sure to look up what the python GIL is in case you haven't come >> across it yet, however, if you're using Apache mod_python there are >> real concurrency issues you need to be concerned with. > > This claim that there are real concurrency issues with mod_python > because of the GIL is over inflated and is a common claim used to > discredit mod_python that doesn't seem to want to go away. :-( > > First off, if prefork MPM is used by Apache, it is a total non issue > as each Apache child process is single threaded. > > Second, in worker MPM, because there are multiple Apache child > processes running concurrently, one can still take advantage of > multiple cores in a CPU or multiple CPUs. > > Third, because all the connection handling, URL mapping, request and > response content reading/writing is all handled by C code in Apache's > core, where the GIL is not even held, there are still huge > opportunities for overlapping processing. > > Finally, because all static serving of files, or execution of other > Apache modules and languages is nothing to do with Python, again no > GIL is held, so again there are still huge opportunities for > overlapping processing. > > In other words, there is a huge amount of other stuff happening at the > same time. You would only incur noticeable problems if your Python > handlers were doing very intensive processing that takes some time in > pure Python code. Even this would have less impact than using a single > distinct multithreaded Python process because of the fact that Apache > spreads requests across multiple processes and is doing all this other > stuff at the same time allowing it to still use the available CPUs > effectively. So, Apache is going to handle all this a lot better than > trying to host a web service in a single Python process using Apache > as only a proxy. > > Graham > >> On Aug 9, 2007, at 3:13 PM, Denis Laroche wrote: >> >> >> >>> Sorry if the question has already been asked. I tried to search in >>> the archives but got a "timed out" message from the search server. >> >>> I'd like to know if it's ok to use an instance of a services >>> locator (class generated by wsdl2py) in multiple threads. >> >>> Thanks in advance. >> >>> -- >>> D. Laroche >> >>> -------------------------------------------------------------------- >>> -- >>> --- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a >>> browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Pywebsvcs-talk mailing list >>> Pywebsvcs-t...@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk >>> Also archived athttp://groups.google.com/group/pywebsvcs >> >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a >> browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Pywebsvcs-talk mailing list >> Pywebsvcs-t...@lists.sourceforge.nethttps://lists.sourceforge.net/ >> lists/listinfo/pywebsvcs-talk >> Also archived athttp://groups.google.com/group/pywebsvcs > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Pywebsvcs-talk mailing list > Pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk > Also archived at http://groups.google.com/group/pywebsvcs |