RSelenium concurrent users for multiple scenarios on Shiny
Asked Answered
M

1

6

I am trying to do a charge test with RSelenium on my deployed Shiny application. Several users connect to the adress and do random tasks at the same time.

I have searched doParallel but the number of concurrent process is limited by numbers of core - 1.

I have tried the following command line to start N process in the background at the same time. A number is given as parameter to define browser's port. It is working until 3 process but over some process fail and are not always the same.

'start /b "P1" Rscript R/run_tests.R 1 &
start /b "P2" Rscript R/run_tests.R 2 &
start /b "P3" Rscript R/run_tests.R 3 &
start /b "P4" Rscript R/run_tests.R 4 &
start /b "P5" Rscript R/run_tests.R 5'

run_tests open a new web driver and navigate on the webpage.

A solution would be to ask several colleagues to run this code for 3 process but I would like to reach 20 users.

Answer on Windows will be more appreciated but Linux is not a problem. Do you know the proper way to do it with RSelenium ? Thanks a lot for any clue.

Mobility answered 8/1, 2020 at 15:48 Comment(2)
Not sure about Shiny but have you tried the selenium grid?Collate
it is a solution but infortunately R langage is not supported. ThanksMobility
J
1

I have some experience with JMeter but it seems not appropriate for your case, as written here.

Shiny relies on Javascript to respond to user interactions and communicate with R as opposed to RESTful HTTP calls. This means standard load testing frameworks like JMeter do not accurately simulate load.

Please have a look at the info for shinyloadtest. I have not used it personally, but according to the documentation it can be installed under Windows and supports:

  • Record a typical user session for the app.
  • Replay the session in parallel, simulating many simultaneous users accessing the app.
  • Analyze the results of the load test and determine if the app performed well enough.

Hope this helps.

Jar answered 18/1, 2020 at 21:16 Comment(1)
RSelenium is a need as I have several senarios that are really different and I am doing screenshots with a RMarkdown to check that everything is okay with visual inspection and OCR to check for errors.Thanks a lot for these two clues.Mobility

© 2022 - 2024 — McMap. All rights reserved.