Why do I receive the error "All available sessions are in use. Try again at a later time" on Web App Server?

조회 수: 18 (최근 30일)

I have successfully installed MATLAB Web App Server and can usually open and use apps without issue. However, I sometimes receive a popup with the following error when opening a new app session:

All available sessions are in use. Try again at a later time.
Why am I encountering this error?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 3월 27일
This error indicates that the maximum number of available web app sessions is currently in use. There are a few reasons you may encounter this error:

Maximum Sessions 

The maximum number of concurrent sessions is determined by the maximum_sessions setting. You can view and change the current value of this setting using webapps-config. Ensure that this value is set high enough for the number of concurrent sessions you are looking to support, and is within your server's hardware capabilities. See the Hardware Limitations section below for further information.
Note that the development version of MATLAB Web App Server is limited to 32 maximum concurrent sessions.

Hardware Limitations

The default value for the maximum number of sessions is based on your server’s hardware capabilities. If you are using a VM, you may want to consider increasing your VM’s virtual hardware capabilities to support more sessions. It is recommended that you do not increase the maximum number of sessions beyond the system requirements described here.

Prewarming

If you are receiving this error with fewer active sessions than expected, it is likely a result of prewarming.
By default, MATLAB Web App Server allocates 1/3 of your maximum available sessions to prewarm the MATLAB Runtime in order to reduce the time it takes to load a Web App. The server will prewarm workers for all runtime versions configured on the server.
These prewarmed sessions can only be used to run an app of the corresponding version – a prewarmed R2023a session can only run R2023a apps, and an R2023a app can only run on an R2023a worker session. As a result, sessions prewarmed for other runtime versions may be unavailable for a specific app. This can lead to the error you are receiving. For example, if your server prewarms two sessions for R2023a and two sessions for R2023b, you may receive this error upon opening an R2023a app even if the two prewarmed R2023b sessions are still available.
There are three settings you can configure to mitigate this issue:
  • maximum_sessions (MaxWorkers)
By default, MATLAB Web App Server prewarms approximately 1/3 of the maximum number of sessions. Increasing the maximum number of sessions using using webapps-config can increase the number of available sessions, both prewarmed and not. Note that it is recommended that you do not increase this value beyond the system requirements described here.
  • webapps-runtime
By default, sessions are prewarmed for all runtime versions configured on the server. You can view and edit the list of runtimes on the server using webapps-runtime. To maximize the number of usable sessions, it is recommended that you remove any unused runtime versions from the server (webapps-runtime remove) and if possible, compile all web apps using the latest supported version.
  • MaxPrewarmedWorkers
This value can be set to limit the number of worker sessions prewarmed for a specific runtime version. This can be viewed and set in the "webapps.config" file located in your config folder and is unset by default. You may use this value to reduce prewarming of lesser-used runtimes; for example, if all R2022a web apps on your server are used infrequently, you may set this value to 0 to prevent prewarming of R2022b worker sessions: 
<Runtime Path="/usr/local/MATLAB/MATLAB_Runtime/v912" MaxPrewarmedWorkers="0"/>
These apps can still be run by any available non-prewarmed workers, but no sessions will be reserved specifically for R2022b apps.Please note that the MaxPrewarmedWorkers configuration is undocumented and may change without notice. It is also not recommended to edit the "webapps.config" directly. Use caution if you choose to follow this workflow.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Server Management에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by