classification
Title: Proxy handling
Type: performance Stage:
Components: None Versions: Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ciprian.trofin, orsenthil
Priority: normal Keywords:

Created on 2010-03-26 07:33 by ciprian.trofin, last changed 2010-03-26 08:43 by ciprian.trofin.

Files
File name Uploaded Description Edit
proxy.png ciprian.trofin, 2010-03-26 08:43 Setting up the Windows proxy
Messages (3)
msg101742 - (view) Author: Ciprian Trofin (ciprian.trofin) Date: 2010-03-26 07:33
After I installed Python 2.6.5, I noticed a drop in performance of web connections via proxy.

This script:
---------------------------------------------------------
import time
import urllib2

timeMark = time.time()
opener = urllib2.build_opener()
textWeb = opener.open("http://www.google.com/").read()
print time.time() - timeMark
---------------------------------------------------------

takes about 60 seconds to complete (consistently)

The same script, run using Python 2.6.2 is completed in less than 1 second  (0.2seconds)

The test system:
- Windows XP SP3
- internet connection via corporate connection, using a proxy (the proxy is set in Control Panel - Internet Options etc)
msg101743 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010-03-26 07:55
How are setting up and using your proxy? It would also help you discuss your approach at python-help@python.org and if you see any specific issues, raise it in the bug report.
msg101745 - (view) Author: Ciprian Trofin (ciprian.trofin) Date: 2010-03-26 08:43
I attached a screenshot.

The proxy is on the corporate network. I'm not setting it up, I'm only using it. Internet Explorer needs that setting in order to connect. Firefox needs this proxy set as "manual proxy configuration".

I looked deeper into the situatioan, usign the following (modified) script:

---------------------------------------------------
import time
import urllib2

timeMark = time.time()
opener = urllib2.build_opener()

proxy = urllib2.ProxyHandler({"http" : "http://10.249.1.63:80"})
opener.add_handler(proxy)

textWeb = opener.open("http://www.google.com/").read()

print time.time() - timeMark

---------------------------------------------------

The only difference from the script above: I set up the proxy manually.
I tested the new script in 2.6.5

With Windows proxy active: same problem, long waiting time.
With Windows proxy disabled: fast execution.
History
Date User Action Args
2010-03-26 08:43:54ciprian.trofinsetfiles: + proxy.png

messages: + msg101745
2010-03-26 07:55:11orsenthilsetnosy: + orsenthil
messages: + msg101743
2010-03-26 07:33:14ciprian.trofincreate