/auth/bare_openid?url=/user/registration can be extremely slow in production sometimes. To get to this page naturally, log in as an openid-only user and then visit an Allura page like /p/add_project which will send you to that page. Of course you can access it directly too if you want.
On sandboxes, jinja_master/master.html you need to change {% if g.production_mode %}{{g.analytics.display()}}{% endif %} so that it runs on a sandbox. After doing that, I still haven't been able to replicate the issue on a sandbox. I can replicate it on production only the first time using a new openid-only account. Refreshing the page comes back fast the second time.
New Relic trace shows a lot of slow mongo calls, see http://screencast.com/t/SBAapm50R It would make sense that this is database query related, since it's all fast on sandboxes. I haven't been able to find relevant slow queries in prod logs.
This may be specific to the SF theme, since custom_tracking_js is set in the theme.
Per the x-ray trace in New Relic, we gathered the following info:
The slowness is coming from the call to
User.my_projects()inrate_limit()while creating the user project on demand for an OpenID user. It looks like line 659 ofallura/model/auth.pymight be the source of the problem:Changing that to the following would be much more efficient:
However, the underlying issue seems to be that OpenID users are being associated with a single
Userinstance that has a ton ofProjectRoles (probably not*anonymoussinceuser_roles()has a short-circuit to return an empty list for*anon).A quick fix would be to short-circuit either the user account auto-gen,
rate_limit(), ormy_projects()for whatever user account gets used for OpenID users. Though, it might be worth while to determine why there are so manyProjectRoles associated with that user and see if we can remove & prevent those. User project auto-gen might be the best place, since the OpenIDUserinstance should have ausernamevalue of''(empty string).allura:cj/6713We should be able to drop the
ProjectRoles associated with the empty-username user (ObjectId("4c2b6c3d0594ca6a1200003a")) and this fix ought to keep new ones from being created (due to the change inUser.project_role()).There are currently 24,027.