On Sunday, 6 November 2011 02:01:26 UTC+11, bFlood wrote: > > thanks Anand, good to know you guys are on the case. Brandon's comment > gave me hope so I looked into my code a little deeper. Here are a > couple of comments (I'm by no means a Python expert so I'm unsure > about a GIL details) > > 1) I still see the issue above, random delays between calls under > load. For example, a call to memcache takes a few ms on one request > but then takes 200-300ms on another. Under no load it always quick >
Remember, your instance is limited to 600MHz. Under load, you're probably hitting this limit and our limiting mechanism is kicking in. However, 200ms seems excessive. > > 2) access from the native appspot.com domain seems faster then a > custom one (I can't remember if this is an issue with the existing > runtime too) > *shurggs* I don't know much about this part of the system. > > 3) on one of my larger tests involving existing code that was running > horribly in the threaded runtime , the main culprit turned out to be > the xml minidom. I'm assuming it's not threadsafe so I'll need to move > to lxml > Pure-python xml parsing is probably fairly CPU intensive. Depending on the performance difference, lxml may or may not help. > > 4) I use a lot of static class methods, I'm not sure if the class def > is locked by the GIL (I had thought not) > > Is this threadsafe with the GIL? > class Util(): > @staticmethod > def DoSomething(): > pass > I'm not a Python expert, but I think this is OK. Of course, if your static method mutates global data, then you need to protect that data with a lock. > > 5) I'm using webapp2, are there any know issues there? > Nope, not as far as I know. > > 6) Are async RPC calls necessary to get the threadsafe benefits (ex > async urlfetch)? or can we use the standard sync calls as well? > Nope, doesn't matter. You can use sync or async, or a combination. > > thanks, python27 is going to be great > brian > > > > > > > > > On Nov 4, 9:42 pm, Anand Mistry <[email protected]> wrote: > > Although I can't get into any details, we are aware of these issues in > the > > python27 runtime. Like you noted, the runtime is experimental (hey, > we've > > only been live for one release cycle), and improvements are still > coming. > > > > On a more general note, the python27 runtime is implemented using the > > CPython interpreter from python.org and hence is open to issues related > to > > the GIL. I suggest readinghttp:// > wiki.python.org/moin/GlobalInterpreterLockto get some background > > into multi-threading performance issues in Python. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/4AubKIWfTpcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
