There are solutions that apply to any security type and those that can be used only for the Middle Tier application server. For more convenience, I marked simple solutions with the * symbol.
COMMON SOLUTIONS
1. Enable Server, InstantFeedback or DataView data access modes for ListViews with large amounts of data
This is not specific to the security module. Refer to the List View Data Access Modes article for more information.
2. Enable Security Permission Caching
Refer to the Security Permissions Caching article for more information.
3. Consider caching at the data store level
This may be suitable if you have many repetitive queries and the SQL server executes them slowly. See the How to use XPO caching in XAF article for more information.
4. Determine the cause of low performance and measure its effect in numbers with specialized profilers
Always profile your applications as described in the How to improve the application's performance article.
Often, you can improve the situation by modifying your custom code. For instance, you can reduce the number of SQL queries by following suggestions from points #5-7 of the aforementioned KB article.
MIDDLE TIER APPLICATION SERVER SOLUTIONS
1. Use the new and faster Middle Tier security implementation
If you are using .NET Core, migrate to v24.1+. XAF WinForms with Middle Tier Security execute much faster in v24.1. We boosted performance for both EF Core 8 and XPO ORM, as compared to v23.2 (XPO ORM results are even better - a 2.5x improvement). The graphs below show the current duration of batch of performance tests and also individual tests in 24.1 vs v23.2 for EF Core 8.
If you are using .NET Framework, refer to the migration guidelines for more information. If possible, consider migrating to .NET Core-based Middle Tier Security.
2. Adjust the data transport channel between the Middle Tier application server and client apps
- Consider using NetTcpBinding in your project. With v16.2, XAF Solution Wizard creates new projects with NetTcpBinding by default. According to the Microsoft documentation: "The Net.Tcp binding is the best performing binding type for two-way communications between different servers. One drawback is that it is not interoperable with non-WCF clients".
3. Tune a database's or an application server's response latency
In the case of long remote server response time, find the nature of this delay (client <=> service or service <=> database). Based on the results, consider moving an application's service to another server, for instance, closer to clients' applications or a database.
4. Use Client-Side Security (Integrated Mode) for ASP.NET applications
The Integrated Mode can remove unnecessary network overhead and thus improve overall application performance. The Middle Tier security does not make sense for an ASP.NET application from the logical, maintenance and performance point of view. These applications are client-server by default.
Hi Dennis,
would JSON be a solution too to improve performance?
Knowing the amount of request, it would be nice to be able to configure the service providing JSON payloads.
I tried to do it without any success: the feed is still using xml…
@Maxime: I am afraid I cannot answer your question without carefully profiling and researching your particular use-case scenario. Technical solutions may vary a lot depending on these results.
So, would you please follow the 1st step in this article to help understand the cause of this behavior and measure its effect first?
If you need assistance with DevExpress products after having executed this important step towards a solution, please submit a separate ticket using the https://www.devexpress.com/Support/Center/Question/Create service and provide us with your profiling logs, scenario descriptions and debuggable sample, because it is difficult to effectively research these performance problems due to their nature.
As a note, I have personally found that point 3 in most cases provides the biggest performance improvement for non-admin users. I've found this to be particularly true for the tree list, but also for grids. The difference is significant.
@Steve: Thanks for sharing your experience with the XAF community! BTW, this caching feature is enabled in new XAF v16.1+ projects by default.
Hello,
When i create the
public static System.ServiceModel.Channels.Binding CreateDefaultBinding() { NetTcpBinding binding = new NetTcpBinding();
How can i use this binding when using the code below ?public class CustomObjectSpaceProvider : SecuredObjectSpaceProvider
protected override IDataLayer CreateDataLayer(IDataStore workingDataStore)
{
var node = workingDataStore as DataCacheNode;
if (node == null) return new ThreadSafeDataLayer(XPDictionary, workingDataStore);
if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["TotalMemoryPurgeThreshold"]))
{
node.TotalMemoryPurgeThreshold = Convert.ToInt64(ConfigurationManager.AppSettings["TotalMemoryPurgeThreshold"]);
}
return new ThreadSafeDataLayer(XPDictionary, node);
}
@Decoder4: I've created a separate ticket on your behalf (T553861: Questions on configuring end point bindings when using the security system with a data store level cache). It has been placed in our processing queue and will be answered shortly.