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

Profiling and Testing Loqui #16

Open
howardbaik opened this issue Jan 16, 2024 · 2 comments
Open

Profiling and Testing Loqui #16

howardbaik opened this issue Jan 16, 2024 · 2 comments

Comments

@howardbaik
Copy link
Contributor

howardbaik commented Jan 16, 2024

Performance workflow

Estimated peak traffic: 10~20 concurrent users per R process.

Is Loqui fast enough?

Using shinyloadtest, we can generate large amounts of realistic traffic to Loqui, then analyze latency. I ran a load test by inputting a Google Slides URL and rendering video with 10 workers and eventually got this Event Waterfall plot:

image

and these boxplots for Event Duration:

Screenshot 2024-01-16 at 5 00 55 PM

Key takeaways

The example videos on Loqui and the HTML display of the Loqui-rendered video are taking up lots of time.

What's making Loqui slow?

Using profvis, I found that httr::GET(url, httr::write_disk(tmp)) and the preceding code to create a tempfile, tempfile(fileext = paste0(".", type)) is taking up the most time.

Screenshot 2024-01-16 at 12 15 05 PM

cc @cansavvy

Resources:

  1. Talk on shinyloadtest and profvis in Shiny: Joe Cheng | Shiny in production: Principles, practices, and tools | RStudio (2019)
  2. The Optimization Loop
@cansavvy
Copy link
Collaborator

cansavvy commented Jan 18, 2024

This is great investigation work. Thanks for putting this down in an issue @howardbaek ! Have you done an initial search to see if there's a more efficient version of httr::GET(url, httr::write_disk(tmp)) we could use? Even if that might me using Python?

@howardbaik
Copy link
Contributor Author

howardbaik commented Jan 19, 2024

I realized that I was unnecessarily repeating calls to gsplyr::download(), which runs httr::GET(url, httr::write_disk(tmp)) under the hood, so I dealt with that in this commit 71a6c93

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