Migrating a nopCommerce project to .NET 6
This post is a continuation of a series of articles about updating the nopCommerce project:
nopCommerce is a free and open source CMS for creating online stores. In this article, we will touch on why we are constantly trying to update the platform of our application. Let’s talk about what we have achieved in terms of performance with .NET 6 and try to give a practical assessment of the result that we got.
Reasons for migration
Everyone who follows nopCommerce updates is well aware that we try to update the application core as quickly as possible, this is facilitated by the constantly evolving Microsoft technologies that are reflected in the .NET Core platform.
One of the main goals is to transition to a Long Term Support (LTS) release. This is because the current version of .NET 5 will be supported and patched for 1.5 years from release. The updated version of nopCommerce 4.50 is already based on the .NET 6 platform, which will be supported for 3 years, which is important for end users and will allow the community enough time to update their stores and plugins for them. At the same time, waiting for the next version will be accompanied by regular updates, including security updates.
With the release of .NET 6, Microsoft developers are the most complete approach to the fact that .NET provides a single development platform for all types of applications available, from desktop and web applications to development for mobile devices. This unification opens up the possibility for us to implement a mobile application for nopCommerce in a single C# code base, which will certainly have a positive impact on our developer community in terms of immersion and understanding of the entire nopCommerce ecosystem.
Also, when moving to .NET 6, we planned to raise the bar for the performance of our application. I will say in advance that the results of the measurements showed quite interesting data in terms of the evolution of nopCommerce, which we would like to share.
Performance measurements in the application
As a testing tool, we decided to choose a fairly popular SaaS service for testing load and scalability – loader.io. The server on which the application is deployed is an average machine used for development:
The tests were run under Windows 10 (19044.1415) and IIS 10 (10.0.19041.1415). For the test, we took the standard database that comes with the application installation. All this is running MS SQL Server 2019 (19.0.2000).
To simulate the load, a test configuration was chosen that will connect 250 users within a minute. Users will visit several random pages of the application. This will be enough to trace the overall picture of the application’s behavior, and will allow you to more clearly see the difference relative to previous versions.
Next, I will give a table of correspondence between versions of the nopCommerce application and versions of the .NET platform.
.NET Core 3.1
We ran 3 identical load tests in a row to get an idea not only about the nature of the load, but also about the memory consumption on the server. The average results after several runs are shown below.
Response time measurement (lower is better). The trend of performance increase relative to .NET 5 and .NET Core 3.1 versions is clearly visible – by 46.1% and 65.3%, respectively.
Measurement of application memory consumption (less is better). The tests were run sequentially for each platform without resetting the application pool. Here it should be taken into account that the memory overhead of the .NET platform itself has increased, apparently this is an inevitable price for increasing performance. However, it should be noted that the optimizations that were promised in .NET 6 can be traced here.
Let’s now take a closer look at how the load was distributed in an application on the .NET 6 platform, and compare similar data for tests based on .NET 5. It is important to note here that we are trying to show the general trend of the system on different platforms, and not to identify extreme indicators for which the system will leave the equilibrium state, since the technical parameters of the server under test play an important role in this.
Load balancing in .NET 6
Load balancing in .NET 5
In terms of analysis, we see an interesting picture for the .NET 6 platform – with an increase in the number of clients per second, the graph of the average response time is kept at a sufficient distance relative to .NET 5. The graph of the updated version is smoother and has less spikes. A good indicator is that both lines of the graphs do not intersect throughout the entire test. This indirectly indicates increased performance, .NET 6 copes with the test a little easier than .NET 5.
Once again, we have seen that following the latest technological innovations from Microsoft brings a positive result. In addition to increasing productivity, we received an updated platform that will allow us to develop in a new direction for us. Of course, we are talking about a mobile application, the path to which we started back in version 4.40 by implementing the Web API for our platform, which literally covers all the functions that our platform provides. In order to increase performance, we have a slightly higher overhead for memory consumption, this should be remembered when choosing a hosting provider. But considering that in the medium term, the current version will certainly dominate our community among others, then switching to it seems to be the most pragmatic solution.
You can find out more about our project on the website nopcommerce.com or visiting our repository on GitHub.