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

Blocking call to videoscan command in update page's view can be potentially very slow. #227

Closed
bcipolli opened this issue Jul 10, 2013 · 3 comments
Assignees

Comments

@bcipolli
Copy link
Contributor

Line 277 of main/views.py
def update(request):
call_command("videoscan") # Could potentially be very slow, blocking request.

We do a blocking call to videoscan on every update page request. If a scan is actually necessary, this can take a potentially long time.

Proposed fix:
Trigger this check through AJAX. Have some text indicating the scan is proceeding, and either update the page (or message the user that a refresh is required) if something in the scan was actually found.

Priority:
Low priority. It's a confusing user experience (just hangs for a while) for something that's very infrequent. Otherwise, it's a slight performance hit, but no real worry there.

@gimick This would be something good to check on the Rpi, however; if performance there is poor, we should increase the priority.

@jamalex
Copy link
Member

jamalex commented Nov 13, 2013

Not sure if this was always so slow on the RPi, or if it has to do with some of the recent signals/cache invalidation stuff, but with a new DB (no VideoFiles), but 2500 videos on disk, the update page takes over 5 minutes to load for the first time.

@bcipolli
Copy link
Contributor Author

This definitely got slower. I would suggest two changes:

  1. Run videoscan on server startup, to avoid webpages from hanging. It would be clearer to the admin what's going on. This shouldn't be too much work, as there's a wrapper around the server starting already.
  2. In order for videoscan to do bulk creation, it will need to call into the signal directly from videoscan.

@bcipolli
Copy link
Contributor Author

This is easy - just call videoscan from the api request to get the annotated topic tree!

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

2 participants