Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RSelenium concurrent users for multiple scenarios on Shiny

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.

like image 745
Clemsang Avatar asked Jan 08 '20 15:01

Clemsang


1 Answers

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.

like image 53
K. B. Avatar answered Oct 13 '22 05:10

K. B.