Appengine, performance degradation with python27

前端 未结 6 903
天涯浪人
天涯浪人 2021-01-31 10:03

I wanted to test python27 on appengine so I have migrated my app from python25. Performance got more than 2x slower for every request! Then I\'ve returned to python25 and perfor

6条回答
  •  余生分开走
    2021-01-31 10:26

    Somewhere on Usenet I read a statement like this from Google "he Python 2.7 runtime is slower than the Python 2.5 runtime in some cases and faster in others. We aren't publicizing the reasons why at this point.". Seems nobody has found so far a scenario where 2.7 is faster than 2.5 thus ...

    I read into this

    1. Google is aware of a preformace issue.
    2. They not sure how to handle it.

    My profiling indicates that python 2.7 multithreaded applications spend ca. 35 % of their time in {method 'acquire' of 'thread.lock' objects} - and seemingly that happens in googles RPC code. There are also indication that importing has serious locking issues.

    Basically you can't do anything about it except waiting for the AppEngine to fix it. See also this comprehensive documentation about the slowdown.

    Factors which almost certainly don't play a significant role in this are:

    • uploading pyc files (the GAE infrastructure does that for you)
    • the server provisioning (GAE is such a massive scale and even in closed beta 2.7. was slow)
    • WSGI vs. CGI (wouldn't explain such a huge performance hit)

    The ugly thing is that Google did a massive price hike in two steps but told us "by using multithreaded python 2.7 you can run so much more effective that the new prices don't look so bad". Unfortunately the Python 2.7. runtime is still labeled "experimental" and doesn't deliver production quality performance.

提交回复
热议问题