Skip navigation.

ASP .NET performance testing tips

performance testing | Visual Studio .NET
Just finished a performance testing in a pilot project completely based on a plain ASP .NET technology. I wanted to share two lessons learned during that project but doing more search on internet I learned a new lesson: you could and you actually should find on internet the technology-specific performance issues even before you start testing (especially given that you have a time for that: while code is not complete/functionally stable).

Details follow
I was occasionally (part-time in parallel to my current project functional tests) assigned to the pilot WEB application project (initiated/sponsored by some huge, well-known company that I’m not going to mention here, because it does not matter) as performance tester. That was the first project I tested that is completely based on a plain ASP .NET technology (+ MS SQL server). What I wanted to talk about – how the technology influence performance testing.
There was two major surprises for me:
1) Huge size (up to 10 000 characters) variable
Viewstate send from server and back to it on almost every call. The summary of this phenomena: server-side state is not saved on server, it is serialized and sent to client via this variable. When client submit the next request it send the state back, which is deserialized on server. This was a problem for Load Runner capture-playback tool as it’s capturing capabilities somehow unreliable recognized such a huge data correlations.
2) Some caching issues (not working cache). javascripts and dynamic objects that does not changes too frequently (for example image rendered that represent current org. structure) are not always cached in browser. There are differenc resons for that such as debug mode turned on or missing usage of cache control extentions
However what surprised me that those issues are already described for in ASP.NET 10 Tips for Writing High-Performance Web Applications . 3 out of 10 are about caching, one about viewstate variable and other 6 universal topics such as compression and suggestion not to do a single row select in a loop (rather return them all in one result-set).
To illustrate why those are generic issues - the last issue I mentioned was the major (but solved) issue in another project using JAVA + hibernate as a technology. There was another issue however in that project: limited capabilities for hibernate to optimize the SQL statement generation that was reason for dev. team to drop using this technology, but that’s completely another story about another technology.
So the bottom line - something depend on technology purely and you could learn it without even starting the developing, not to mention testing.

Antony, Rahul, thanks for feedback

Antony, in the particular project they used stored procedures (and DBA optimized their code during our perf. project). They did not abused viewstate, the only serious issue with that was for Load Runner, not for application performance. Experienced developers do not relay on a new technology – in our projects we start early with investigation technology and finish late with testing realistic load. The example with I hibernate mentioned was a pilot project aimed to investigate technologies for both functional and non-functional possibilities.
Nevertheless I have some ideas with regards generic performance progress (regress?) issues caused by current progress with tools, technology and hardware. I will blog it soon (It will be quite a long one).
Rahul,
Yes, I forget to mention about web_reg_save_param works. It for playback This really worked well during running the script (I was forced to set it to as large as 100 000). My issue was during capture however. I defined correlation rule so that viewstate (there are biuld-in rule for that actually) variables are created and substitutes in responses automatically during recording. There were multiple issues and given the short time I did not investigate them but did replacement manually, so I can’t describe the issue in details. Maybe this could be solved by configuring something... I don’t care – what I care – the time I wasted resolving this was not included in initial estimates.

Regarding ViewState capturing in LoadRunner

Thanks for sharing the information.

As for the huge size of ViewState and LoadRunner's data capturing issues, I would like to add something here. The parameter in web_reg_save_param(), has a default maximum length of 256 characters defined for it, so if the size of HTML string being captured exceeds this, LoadRunner throws an error. To overcome this, we can use the web_set_max_html_param_len() function to increase the size of the parameter (the length of the string that it can capture).

I guess that should be known to you already, so consider this just as appendix to your post, for readers' reference.

Please also share, if you have something more to say regarding this.

Rahul Verma
http://testingperspective.blogspot.com/

...

abuse of asp.net abstractions is often asking for performance issues. it's a little bit of truism that reliance on them, or, perhaps worse, relying on further abstrations (i.e asp.net caching technology) is a sign of something more fundamentally wrong (if you as a tester can, very easily, discover sign posts pertaining to potential non functional issues why did the dev team not consider these factors?)

not withstanding - most implementations of object spaces can actually be optimised by mapping instance associations via stored procedures - and again - this points to a bit of a lack of understanding as to what the object space is actually doing for you, in my humble opinion.

Comment viewing options

Select your preferred way to display the comments and click 'Save settings' to activate your changes.