OAuth with Signpost slow after change of host


#1

Hello,

I am a developer on a fairly mature product that has been using the Java based Signpost OAuth library successfully for many months. (signpost 1.2.1.1).

We recently moved from cloud servers to our own in-house servers (which of course changed our requesting IP, although the domain name was unchanged), and our login/oauth process has become agonizingly slow. Specifically, I’ve determined through careful log statements that these two Signpost calls seem to take a very long time, sometimes 30-45 seconds:

authUrl = provider.retrieveRequestToken(consumer, callback);


provider.retrieveAccessToken(consumer, oauthVerifierToken);

Does anyone know of an explanation for this, given that nothing else in the system has changed? Is it possible that Twitter is somehow caching IPs or throttling requests based on IP? Would it make sense to recreate the app key/secret?

We are really at a loss to understand the sudden (and dramatic) change in response time. Any thoughts or suggestions very much appreciated.

Thanks,
Chris

(@stolte116)


#2

Hi Max,

I can’t think of any reason why our servers in particular would treat the traffic on these two methods differently for you on one server versus another. When these methods have latency issues, it tends to either be across the board or particular to certain user accounts or specific application records.

If you still have access to your former servers, I would trace the request path from your servers to api.twitter.com’s OAuth methods and compare that to the request path on your new servers. I would review the Java VM settings comparatively between machines, perhaps making adjustments specific to your new server environment around network performance.

Try to understand where in the connection process the delay is happening… is it on connect? Are you slowly receiving data? Do you receive data and then the connection hangs? What’s the behavior with other APIs on Twitter? Other APIs outside of Twitter? What about from within another programming language?