You can improve responsiveness by reviewing complex ViewModels and understanding the data that their expressions require. MDriven also includes built-in memory lifecycle behavior that periodically removes unused structures.
Review complex ViewModels
MDriven uses declarative ViewModels and their OCL expressions to look ahead and fetch data efficiently.
Use the Analyze expressions button in the ViewModel dialog to inspect the automatically generated diagram of the classes and relationships accessed by a view. This is particularly useful for views that combine information through many associations and derivations.
Query Plans
MDriven's documented approach to data fetching is a Query Plan. They help address situations where a view would otherwise trigger many individual queries.
Repeated individual queries are especially costly when latency is high, because each query incurs the latency penalty. Review expression dependencies and the resulting Query Plan when a ViewModel becomes complex.
Manage memory
MDriven Server includes memory optimization behavior that does not require configuration:
- Large blobs in a model are held in a shared location for all clients.
- Unused data structures are periodically pruned, usually every few minutes, including structures in views and in EcoSpaces of active users.
- ViewModels that have not been used for a few minutes are removed.
- Subscriptions and change publishers within EcoSpaces are removed every few minutes.
Use the ServerInfo page to temporarily adjust the time for pruning stale applications and the server pruning interval. These temporary settings can help you observe the effect of other changes without waiting for the usual intervals.
Tune .NET Framework garbage collection only when applicable
For .NET Framework versions earlier than 4.8.1, and not .NET Core on IIS, MDriven Server uses Server GC with the Interactive setting by default. The documented intent is to run garbage collection in the background and minimize short user delays. Garbage-collection tuning involves a balance among user experience, memory use, and CPU use.
For lower working-set memory per site, add the following settings to the runtime section of aspnet.config in C:\Windows\Microsoft.NET\Framework64\v4.0.30319:
<performanceScenario value="HighDensityWebHosting"/>
<gcTrimCommitOnLowMemory enabled="true"/>
The documentation recommends both settings when more than one Turnkey or MDriven Server instance runs on the same Windows machine. This guidance does not apply to .NET Core on IIS.
