Some Performance Thoughts on ASP.NET 2.0

One of the lucky things on my Vista upgrade is IIS7, or better said the unlimited IIS. IIS 5.1 which is part of Windows XP limits the amount of sessions to 10. Now I can make performance tests with Visual Studio 2005 Test.

I have a scenario where client and server is same machine (yes i know, dont do that). I call a page which contains a gridview of customers.

First test should show how bad it is to have debug enabled.

First  Test

 

Indikator

Instanz

Kategorie

Computer

Farbe

Bereich

Min.

Max.

Durchschn.

User Load

_Total

LoadTest:Scenario

XP-PRE4


100

0

25

22

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

51,2

58,2

54,8

Avg. Response Time

_Total

LoadTest:Request

XP-PRE4


1

0,43

0,48

0,45

Available MBytes

-

Memory

XP-PRE4


1000

635

639

637

Exceptions

_Total

LoadTest:Errors

XP-PRE4


-

-

-

-

Http Errors

_Total

LoadTest:Errors

XP-PRE4


-

-

-

-

Result with debug=false

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

49,8

58,6

55,0

which is nearly the same, but the available RAM was a little bit more.

Datareader in SQLDatasource

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

55,0

63,8

60,9

Available MBytes

-

Memory

XP-PRE4


1000

654

703

691

The default setting is dataset, which is needed eg for paging. The difference is 10% faster and some more memory available.

DataCaching of SQLDatasource 5 seconds

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

44,2

78,2

74,5

Not much as i expected, but scenario is not realistic enough cause SQL Server is also on same machine.

Caching 1 second

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

28,2

78,2

71,1

What i expected

Disable Viewstate in Page

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


1000

97

101

99

Viewstate makes problems in traffic and processor use. Reducing size speeds up.

Use localized Page

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

96,4

99,8

98,2

Something i was always afraid of, using the new features like sitemap navigation, themes or resx files. Seems nearly have no influence in performance.

Output Cache 10 seconds

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


1000

64

250

231

What i know from beginning, output cache boost and winform developers doesn't have a feature like that. We have now near 4-5 time more request per second. 1 server instead of 4 !

Additonal set a label

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


1000

41

103

95

This test is a preparation for my next step. I added a label which is set in the Page Load with the current time. No Output Caching.

Substitution Control

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


1000

249

263

256

Now i have switched on Output Cache again with 10 seconds. I replaced the label with a substitution control and implemented the shared(static) method to replace the current time in the cached result. As you can see the result is approximately the same as 2 test before ( it is a little bit faster which make no sense).

But as i posted earlier in my blog substitution is not supported by iis 7 integrated mode. Which brings me to my next test.

Application Pool integrated, no Cache

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

66,0

75,8

70,7

Application Pool classic (ISAPI)

Requests/Sec

_Total

LoadTest:Request

XP-PRE4


100

62,8

71,2

69,6

As you see the difference is quite small but as expected integrated is faster.

 

I hope this gives a idea what you can do to increase the performance of your ASP.NET application.

My tip at the bottom line: dont trust anybody if talking about performance, measure it!

Published Thursday, December 07, 2006 8:30 PM by preishuber
Filed under:

Comments

# re: Some Performance Thoughts on ASP.NET 2.0

Thursday, December 07, 2006 7:45 PM by Chua Wen Ching

I have a scenario where client and server is same machine (yes i know, dont do that).

>> Well it is hard to identify the performance on this scenario (everything in 1 machine). Furthermore, when comes to performance it varies on hardware and network infrastructure too :P

Nice tips. Thanks.

# re: Some Performance Thoughts on ASP.NET 2.0

Friday, December 08, 2006 12:16 AM by vikram

Good test. But you should be more easy with the way you show the test results

# re: Some Performance Thoughts on ASP.NET 2.0

Friday, December 08, 2006 5:37 AM by Rick Strahl

Hannes, yes IIS 7 makes testing much easier, but be aware that there are still limitations on IIS 7 running on Vista. According to Microsoft there still is a 10 connection limit, but requests now queue rather than error out as they did on XP.

For fast requests you probably won't notice a difference because the queue of 10 connections probably never saturates even at full load. However, if you have some slow requests in your test run you'll likely see this throttling kick in.

In the end any true testing has to be done on server hardware, but the new IIS 7 on Vista lets you at least get a ballpark figure...

# re: Some Performance Thoughts on ASP.NET 2.0

Friday, December 08, 2006 7:05 AM by preishuber

Rick,

good point, as i rembered, i have heard this before and so i made a small test.

Empty page with Sleep in Page load 1 second. 25 Clients and 1 got 9.9 request per second. Means the limitation 10 simultanous connections is still there but as you write requests are queued.

For make comparison of code A to code B this doesnt matter. Vista IIS7 is a kind of "slow" server.

Leave a Comment

(required) 
(required) 
(optional)
(required)