工人和关系之间的权衡
trade off between workers and connections
我订阅 shinyapps.io 基本计划。所以我有 3 个实例,每个实例最多 3 个工作人员,每个工作人员最多 50 个连接。
我想知道有什么区别
- 2 个工人,每个工人有 5 个连接。
- 1 个工作人员有 10 个连接。
本文来自this help page on tuning Shiny apps:
When should you worry about tuning your applications? You should
consider tuning your applications if:
Your application has several requests that are slow and you have enough concurrent usage that people’s expectations for responsiveness
aren’t being met. For example, If your response time for some key
calculations takes one second and you would like to make sure that the
average response time for your application is less than two seconds,
you will not want more than two concurrent requests per worker.
Possible Diagnosis: The application performance might be due to R’s single threaded nature. Spreading the load across additional
workers should alleviate the issue.
Remedy: Consider lowering the maximum number of connections per worker, and possibly increasing the maximum number of workers.
Also consider adding additional Application Instances and aggressively
scaling them by tweaking the Instance Load Factor to a lower
percentage.
您问题的答案可能取决于您的应用。如果您的应用程序相对简单且计算速度快且并发用户相对较少,您可能不会注意到两种情况之间的差异。但是,如果您有帮助页面中描述的复杂应用程序,您可能会注意到拥有更多工作人员(即,更多单独的线程向 R 服务器发送请求)将改善用户体验。
根据我的经验,我倾向于拥有复杂的应用程序,但并发用户很少(<10),我没有注意到与我所做的有限调整有什么不同。
我订阅 shinyapps.io 基本计划。所以我有 3 个实例,每个实例最多 3 个工作人员,每个工作人员最多 50 个连接。
我想知道有什么区别
- 2 个工人,每个工人有 5 个连接。
- 1 个工作人员有 10 个连接。
本文来自this help page on tuning Shiny apps:
When should you worry about tuning your applications? You should consider tuning your applications if:
Your application has several requests that are slow and you have enough concurrent usage that people’s expectations for responsiveness aren’t being met. For example, If your response time for some key calculations takes one second and you would like to make sure that the average response time for your application is less than two seconds, you will not want more than two concurrent requests per worker.
Possible Diagnosis: The application performance might be due to R’s single threaded nature. Spreading the load across additional workers should alleviate the issue.
Remedy: Consider lowering the maximum number of connections per worker, and possibly increasing the maximum number of workers. Also consider adding additional Application Instances and aggressively scaling them by tweaking the Instance Load Factor to a lower percentage.
您问题的答案可能取决于您的应用。如果您的应用程序相对简单且计算速度快且并发用户相对较少,您可能不会注意到两种情况之间的差异。但是,如果您有帮助页面中描述的复杂应用程序,您可能会注意到拥有更多工作人员(即,更多单独的线程向 R 服务器发送请求)将改善用户体验。
根据我的经验,我倾向于拥有复杂的应用程序,但并发用户很少(<10),我没有注意到与我所做的有限调整有什么不同。