Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarter Views In CouchDB #11

Open
asonnenschein opened this issue Feb 9, 2014 · 0 comments
Open

Smarter Views In CouchDB #11

asonnenschein opened this issue Feb 9, 2014 · 0 comments

Comments

@asonnenschein
Copy link
Contributor

From Ryan:

When you hit that page (/metadata/record.iso.xml), Django sends a request to CouchDB requesting all of the urls. CouchDB responds very quickly, but then the crummy part starts. Django has to determine whether or not you have permission to view each one of the records. If you are logged out (an anonymous user), then Django has to pull out of the list each item that is unpublished. If you are logged in, Django shows URLs to unpublished records that you have access to. Django performs the authorization query one record at a time. Iterating over a large number of records takes a really long time, and eventually Nginx decides that there's not a response coming back and times out.

Remedies:

  • Change CouchDB view so that it only returns public records and Django doesn't have to run any permissions checks
  • Change the whole thing so that CouchDB is authentication-aware and only returns relevant records

Debugging on branch permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant