How do you optimize a high-traffic .NET application for better scalability?
Loading
How do you optimize a high-traffic .NET application for better scalability?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vinay SinghPosted Jan 29, 2025, 1:45 AM
Here are some tips that may help you in terms of making your website more efficient:
HttpRuntime.Cache, especially intensive ones, and you should cache the output of individual pages using the OutputCache attribute.For detail you can refer the below link also.
https://www.c-sharpcorner.com/article/scaling-with-net-how-to-build-high-performance-applications/
https://www.linkedin.com/pulse/best-practices-building-scalable-net-applications-azure-diogo-ribeiro-eh9xf/
Thanks
Vinay
Matthew HessPosted Jan 28, 2025, 4:45 PM
A few thoughts for you...
First, remember that performance and scalability are not the same thing. Performance refers to how fast an app can service a single request. Scalability refers to how well an app can service multiple, simultaneous requests. Techniques that improve performance do not always improve scalability and vice versa. In fact, techniques like factoring a complex app into microservices will improve scalability at the expense of performance (each single request will slow down but overall you can handle many more requests with acceptable performance).
Second, remember that whether you are optimizing performance or scalability you have to measure before and after. Let's say, for example, that you think maybe your database queries are slow so you add some indexes to some of the hot tables or you implement a caching solution. You can't know if you made things better or worse or had no effect unless you measure before and after the change. Sometimes changes that seem logical actually have no effect or even make things worse. Don't trust your intuition. Measure and verify.
Third, a good profiling tool is, in my opinion, the only way to optimize scientifically. Visual Studio has profiling built in and there are many excellent third party and open source tools. Learn to use them. They can tell you objectively where your hot spots and delays are. That way you can spend time focusing on the real problems rather than your suspicions.
Good luck!
Matthew
Youtube: @CSharpArtisan
Mahesh ChandPosted Jan 28, 2025, 3:29 PM
When you think about performance, there are 3 common areas - 1. Database, 2, APIs/business layer and 3. Front end UI. All or one of them could be the reason of slow performance.
1. Database optimization, including storage and queries
2. API optimization and caching
3. Front end optimization
Here are top 10 tips in my this below article on the same topic:
Top 10 Tips For Building High Performance Websites
Tuhin PaulPosted Jan 28, 2025, 2:24 PM
Part - 1
Optimizing a high-traffic .NET application for better scalability is crucial, especially for real-time CRM applications that handle numerous concurrent users and transactions. Example for this as shown below, my CRM project diagram. code for caching is also shown below.