Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have made an Asp.net MVC website and hosted it on a shared hosting provider. Since my website surrounds a very generic idea, it might have number of concurrent users sometime in future.

So, I was thinking of a way to test my website for on-load performance. Like how will the site perform when 100 or 1000 users are online at the same time and surfing the website. This will also make me understand whether my LINQ queries are well written or not.

share|improve this question
add comment

6 Answers 6

up vote 12 down vote accepted

First of all, the proper term is stress test. There are quite a few solutions for website stress tests, one hosted solution I'd recommend is loadimpact. What they do is bombard your site with requests from various servers worldwide and give you an analytic report of how your site handled the stress. They have a free test, where you can get a general idea, but for more you'll have to pay a subscription fee.

These kinds of tests only test the website from the visitors point of view, for more specific information you should profile your application locally, and I don't really have anything more to add to the previous answers, I'm using Apache JMeter as well.

And, lastly, as any performance conscious web developer, you should take a look at YSlow:

YSlow analyzes web page performance by examining all the components on the page, including components dynamically created by using JavaScript. It measures the page's performance and offers suggestions for improvement.

YSlow for Firefox is integrated into the Firebug web development tool for Firefox.

More often than not, I find Javascript to be the actual bottleneck and not back end code or the database. Of course badly written queries can be a major performance penalty, but after you dealt with those, always run YSlow and follow its suggestions, it's a life saver.

Further reading:

on StackOverflow, of course!

share|improve this answer
1  
+1 for loadimpact and YSlow.....great links ...thanks –  Pankaj Upadhyay Jan 4 '12 at 13:30
    
Explore other solutions before you pay loadimpact's subscription fee, of course. There are quite a few similar solutions. I love it, but work payed the fee not me :) –  Yannis Rizos Jan 4 '12 at 13:32
    
I will be using the free test....don't want rigorous testing for now, as it doesn't make any sense for the time being....just want to get the idea :-) –  Pankaj Upadhyay Jan 4 '12 at 13:42
add comment

You can look into tools like JMeter or The Grinder.

I've only used JMeter so far, it is a graphical tool that lets you build test plans quite easily. You can simulate multiple users with multiple threads. You can also record typical usages of your site by linking your browser with a JMeter proxy and doing the actual work, so you don't need to write the requests from scratch yourself. The Grinder is script-based if I recall correctly, might be a good fit as well.

share|improve this answer
add comment

You're on shared hosting so it's unlikely you'll be able to run any tests that are properly indicative of performance, since there's no guarantee of the level of resources your application will have access to at any one time.

However, what I would do in that situation is to start by running a test in isolation on a dedicated box (this can be you own laptop); use a tool like the Visual Studio Load Test suite or JMeter (which I personally can't stand), and build a set of tests that represent a typical path through your application (you should be able to get information about a typical path through use of Google Analytics. If this is not available, you can just use one you think is likely, but remember that this will not give as accurate a baseline). Then do a ramp-up test, start at 1 user, then slowly add users until you hit your estimated peak load. That should show you how well your system holds up as a whole (I personally like to take it a bit further to make sure I've got some headroom).

The final thing you'll want to do is run a profiling tool like ANTS performance profiler while running the test (be aware that this adds some overhead). This will allow you to identify long-running queries and methods, giving you pointers as to where your application is really slow (one tip: it's almost never actually where you think it will be).

The main issue you will have is, as I said first, that you are on shared hosting, so it will be nigh-on impossible to get do any realistic live-environment emulation. However, if your application has a decent amount of headroom on a similar environment to your promised resources you should have some confidence that the code can hold up in your hosting, even if you hit the limits of your environment before you expect to.

share|improve this answer
    
thanks for throwing light on the difference between shared hosting testing and one's own server. –  Pankaj Upadhyay Jan 4 '12 at 13:32
add comment

I also like Loadimpact for stress testing. One thing I tend to use for quick checks on my site is Apache Bench. When I want to run some final tests, I will look toward a pay service.

My work also invested in WebLoads, which is very pricey but allows us to test all of our sites internally. I don't recommend it though.

share|improve this answer
add comment

I don't think load testing can be done manually as it will consume more time than expected and will be a tedious task. You can probably go for Load Runner which can go for many users.

share|improve this answer
add comment

An Autohotkey (AHK) script can simulate a human user. Let it run all day long.

You can let it run on several boxes to simulate a few users. The nice thing is the testing style is completely under your control. You can have 1 AHK script spamming a report feature, and see if it affects the users of other features.

Although I'm not familiar with AHK's threading abilities so simulating thousands of users could be difficult. You may be bound by the number of computers you have.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.