rstudio / shinyloadtest

Tools for load testing Shiny applications
https://rstudio.github.io/shinyloadtest
108 stars 22 forks source link

Failed to load issue (404 and 405 errors) #153

Closed michaelpaulhirsch closed 2 years ago

michaelpaulhirsch commented 2 years ago

Hi, Firstly, Thanks for a really great package. I have published a demo app on a new Connect server, but I am unable to load test apps on that server. I have tried from different machines, browsers, and networks but am getting a strange behaviour when trying to load test:

The UI elements will load correctly, but anything created inside the server function does not run, about 10 seconds later, the app will disconnect.

The network tab looks like this: image

and the console looks like this: image

At least one the following error messages will also appear in the console: Failed to load resource: the server responded with a status of 404 (Not Found) :8600/__sockjs__/n=OGMWzFt5JBEz8FSFlX/t=788227cde09e8a48bbb6308e75cc0972/w=170767e8/s=0/287/nxxvgpik/xhr_streaming?t=1648774786694:1
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

The app can be found here(link removed) and can be interactively but doesn't seem to work with shinyloadtest. Keen to hear if there is a solution or workaround for this

Thanks

schloerke commented 2 years ago

I was able to reprex your observed behavior. Thank you for the public link!

Unfortunately, SockJS polling is not supported. It needs to be a websocket. See https://rstudio.github.io/shinyloadtest/articles/limitations-of-shinyloadtest.html?q=sockjs#deployment-limitations

Is there a way for you to disable the polling behavior of SockJS? I am not familiar with the proper setting. I don't know if this setting will help: https://docs.rstudio.com/connect/admin/appendix/configuration/#Applications.DisabledProtocol

michaelpaulhirsch commented 2 years ago

Thanks for a quick reply Barret!

Have been trying to disable sockJS polling without much luck so far.

Could you clarify something I do not understand please? RStudio Connect must use sockJS and shinyloadtest supports testing of Connect, but shinyloadtest does not support sockJS. I feel like there is something missing here, wouldn't that mean that shinyloadtest is wholly incompatible with Connect?

Thank you, Michael

schloerke commented 2 years ago

@jcheng5 Do you know the setting to have Connect work with shinyloadtest? Thank you!!

michaelpaulhirsch commented 2 years ago

This was ultimately caused by a configuration on the F5 load balancer not passing RStudio connect-specific cookies through the load balancer to the connect server. Closing now as it is resolved, and was not a problem with shinyloadtest

schloerke commented 2 years ago

Thank you @michaelpaulhirsch for the followup! I hope your testing experience is smooth from here on out