One thing which I think has been fixed in recent FMS and/or windows installs which used to be a real bottleneck was using 'localhost' rather than 127.0.0.1 if you're connecting with PHP to the same server...
If it's not a connection to the same server, then take a loom at network latencies, since the point that you've 'tracked it to' is when the actual call to the WPC is made...
We were having a huge issue with one particular database when we upgraded (?) to Win 2008 R2. Turning off external (AD) authentication on that database fixed it. Don't know if that helps.
Yip - nobody has ever been able to explain to me why that makes such a difference, but as you've discovered it does… there must be something weird going on with DNS caching which means it waits for a timeout whilst resolving localhost or something…
This only seems to happen on Windows servers of certain flavours - exactly which I'm unsure of, but since it makes no difference using 127.0.0.1 everywhere, I just do that in case the server that this ends up on happens to be one of those windows flavours…
Glad it worked for you