View Full Version : WPAD slow

11th November 2014, 12:34
Hi all,

The QNetworkProxyFactory documentation warns that WPAD on Windows may be slow. However in my environment it is abysmally slow: 42 (how ironic regarding my nick!), sometimes 54 seconds until a GET http://www.google.com returns a result (unless it runs into an error like "host not found" etc.).

Referring to this discussion (https://bugreports.qt-project.org/browse/QTBUG-10106), I wonder if the timeout being a multiple of 6 seconds is accidental?

I don't really understand what's going on here, and would appreciate any explanation, enlightenment, workaround, solution, or even well-founded statement that performance cannot be improved on principle. Also I tried to simulate the setup with a browser (Firefox) in order to find out if they meet the same limitations, but didn't really succeed in getting deeper insight. I don't even know which questions I could ask my network administrator to narrow down the cause, apart maybe from asking which protocol they use to deliver the PAC file.

Can anyone numeralize a realistic minimal delay?

Any help very much appreciated! (Customers and project manager getting angry.)

11th November 2014, 14:01
Have you watched what happens behind the scenes on the network when you do a query? Something like Wireshark is very useful. Where is the longest delay... on the network or in the Qt code?

11th November 2014, 15:01
Hi Chris,

thank you once again for your care! :)

No, I haven't sniffed yet. Iirc, the delay seems to be caused by the very same WinHttpGetProxyForUrl() call mentioned in the linked discussion.

There is evidence that the network may be malfunctional with respect to WPAD or PAC delivery via VPN. I have deployed and run my application on a machine that is embedded in the network segment without need for VPN, configured proxy identically, and it replied almost instantly. (Hopefully this result is reliable and I didn't screw anything else.)

Seems to be another variation of PEBKAC. I'll stick to this theory until refuted. Thx for now.