This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xiang.zhang
Recipients xiang.zhang
Date 2017-12-22.06:14:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513923244.99.0.213398074469.issue32408@psf.upfronthosting.co.za>
In-reply-to
Content
Recently we update our environment from Python2.7.5 to Python2.7.13. Then one process's CPU usage grow from 15% to 70%. The cause is urllib.proxy_bypass_environment, the commit I wrote in #26864. Our environments get a no_proxy environment variable which contains 4000+ items. See the performance difference:

cascading-controller:~ # time python2 -c 'import urllib; urllib.proxy_bypass_environment("1.1.1.1")'

real	0m1.134s
user	0m1.126s
sys	0m0.007s
cascading-controller:~ # time python2 -c 'import urllib; urllib.proxy_bypass_environment("1.1.1.1")'

real	0m0.037s
user	0m0.024s
sys	0m0.013s

Temporarily I increased regex cache size to 6000 and the CPU usage and time return to a reasonable range.
History
Date User Action Args
2017-12-22 06:14:05xiang.zhangsetrecipients: + xiang.zhang
2017-12-22 06:14:04xiang.zhangsetmessageid: <1513923244.99.0.213398074469.issue32408@psf.upfronthosting.co.za>
2017-12-22 06:14:04xiang.zhanglinkissue32408 messages
2017-12-22 06:14:04xiang.zhangcreate