question

daniela.z avatar image
1 Like"
daniela.z asked Ben Wilson commented

webserver number of running instances

We are having issues starting more than 5 model instances, causing the API to return the fail message:

The FlexSim webserver stops responding from that point on. Currently the way we solve this issue is by re-starting the server, all instances go away and the site comes backup. In the webserver configuration file we changed the number of “Max Instances of Flexsim” to 20 from the default 8, but we are still having the same issue.

Are there any other configuration settings that we need to change?

FlexSim 16.0.1
webserverapiserverconfigurationinstance
image001.png (10.8 KiB)
· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Ben Wilson avatar image
3 Likes"
Ben Wilson answered Ben Wilson commented

There is a Windows Registry setting that limits the amount of memory (desktop heap size) that Windows will allocate for non-interactive processes. Here is the registry path:

  1. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows

This key has a value that is a long string with more key/value pairs:

  1. %SystemRoot%\system32\csrss.exe
  2. ObjectDirectory=\Windows
  3. SharedSection=1024,20480,512
  4. Windows=On
  5. SubSystemType=Windows
  6. ServerDll=basesrv,1
  7. ServerDll=winsrv:UserServerDllInitialization,3
  8. ServerDll=sxssrv,4
  9. ProfileControl=Off
  10. MaxRequestThreads=16

The SharedSection key defines, in its 3rd "parameter", the memory quantity we're talking about. By default it may be 512 or 768 (512 in the example above). You need to increase this beyond the total amount of memory that all your instances will use simultaneously.

In my testing, I increased the size to 1536. When doing so, I was able to launch more instances, until the total memory usage of my instances was 1125. Then I increased the registry to 4096, and was able to launch 3030 worth of FlexSim instances. Finally I increased the memory to 8196 and was able to hit all 20 instances allowed by the configuration file.

Keep in mind this was just my sample model, your model may require more memory. Also, I wasn't running my instances. If they were running, they would take more memory.

In my testing, FlexSim was able to use up about 70-75% of the desktop heap size memory that I specified in the registry. The rest is still used by Windows or other processes, so do plan on some overhead not associated with FlexSim.

This Microsoft article describes what is going on. In particular, search the article for 'SharedSection' for more information.

After changing the 3rd part of SharedSection, you will need to reboot for the change to take effect.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.