6

I've implemented RPXNow for several applications as a great abstraction for OpenID and OAuth to enable Google and Facebook sign-ins. My only complaint is that sign-in takes way too long. After clicking on Google's "Sign In" button, it takes 8-10 seconds for the whole process to finish, and this is from my local machine! I'm only querying https://rpxnow.com/api/v2/auth_info once for a response string from my AccountController, which includes the sign-in result and user profile.

So I opted to implement DotNetOpenAuth instead. Using Google as my provider, it still takes 7-9 seconds to complete sign in! It can't be my repository layer since a Forms login is instant. Hence, I must attribute the waiting period to the lag between my system, RPXNow and the authentication provider. The same delay takes place on my basic and premium RPXNow accounts.

Google OpenID login on StackOverflow always seems instant. How can I speed up my OpenID sign-ins? I'm willing to ditch RPXNow if I can bring sign in down to 1-3 seconds.


Edit: OK, so I went and timed how long my RPXNow request actually takes, and it's less than two seconds (1984ms and 2100ms from a cold start), but the entire process takes 7-8* seconds. Maybe it's the redirection or Google's sign-in box. I'll have to run some more diagnostics.

  • Warm start. RPXNow scripts, images and DNS were cached.

More testing: I'm testing this from a 384kbps ADSL connection, which is what most of the people here in SA still have. Here is the timing breakdown for signing in using Google:

Cold Start Breakdown:

  1. Load RPXNow widget: 3.1s
  2. Load pop-up window: 5.9s
  3. Click on Google provider: neglected
  4. Load Google sign-in box: 4.1s
  5. Submit Google details: neglected
  6. Wait for RPX to redirect: 7.7s (incl. 1.9s auth time)

Total sign-in time, excl. data entry:

20.8 seconds.

Too Long.

Warm Start Breakdown:

  1. Load RPXNow widget: 2.2s
  2. Sign-in via Google: 6.5s (incl. 1.8s auth time)

Total sign-in time, excl. data entry:

8.7 seconds.

Barely acceptable.

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
  • 90% of this problem sounds like a RPX support issue. – John Farrell Dec 22 '10 at 18:35
  • Or my implementation is broken. Or there is a caching solution that might be provided by the community. Either way, there are more eyes here to strutinise my method. – Petrus Theron Dec 22 '10 at 19:46
  • 1
    So how can we fix your implementation without seeing any of your code? – John Farrell Dec 22 '10 at 20:20
  • I'm using [RPXLib](http://code.google.com/p/rpxlib/) for my implementation. I could have asked RPX support on this, but I would probably have had to wait and any benefits gained would not be available to the community. Is it possible to cache the widget & images on my server, so they can be bundled with my other resources? – Petrus Theron Dec 23 '10 at 10:29
  • 1
    I'm seeing the same sort of problem using dotnetopenauth. It takes roughly the same amount of time on a cold start to redirect to myopenid, however warm logins are almost instant. – Timothy Strimple Sep 02 '11 at 07:22
  • I find Google to really take some time to authenticate with OpenID. Yahoo is faster, Facebook is similar. For cold starts Google is by far slower as a provider. – CMircea Aug 13 '12 at 16:41

1 Answers1

0

To be honest, we need to see your code. Some general performance ideas:

Cache when you can, either in a user-specific Session or the HttpCache if it is an application level variable you are constantly recomputing. Avoid writing out files to disk. To be honest it sounds like you are running up against either

  1. Seriously uncool network latency
  2. A busy-wait condition where something is waiting to acquire a locked resource
  3. A very poor algorithm doing something bad
  4. Writing something to disk a lot

My best suggestion is that you step through your code and try to test it locally. Consider using Stopwatch in System.Diagnostic and logging out your loading times where you suspect the problem code is at. Isolate the problem. Sounds like your main performance problem has little to do with OAuth or RPX in my opinion.

To increase your page load time consider running the page through Google PageSpeed Insights and make sure you are minifying your JS and CSS whenever possible.

whoblitz
  • 1,065
  • 1
  • 11
  • 17