<p>I am stress testing a .NET web application.  I did this for 2 reasons: I wanted to see what performance was like under real world conditions and also to make sure we hadn't missed any problems during testing. We had 30 concurrent users in the application using it as they would during the normal course of their jobs. Most users had multiple windows of the application open.</p>

<ul>
<li>10 Users: Not bad</li>
<li>20 Users: Slowing down </li>
<li>30 Users: Very, very slow but no timeouts</li>
</ul>

<p>It was loaded on the production server. It is a virtual server with a 2.66G Hz Xeon processor and 2 GB of RAM. We are using Win2K3 SP2. We have .NET 1.1 and 2.0 loaded and are using SQLExpress SP1.</p>

<p>We rechecked the indexes on all of the tables afterword and they were all as they should be.</p>

<p>How can we improve our application's performance?</p>

[{'answer_id': 59092, 'author': 'Thunder3', 'author_id': 2832, 'author_profile': 'https://Stackoverflow.com/users/2832', 'pm_score': 2, 'selected': False, 'text': '<ol>\n<li><p>You may be running into concurrency issues, depending on how your application runs. Try performing your reads with the "nolock" keyword. </p></li>\n<li><p>Try adding in table aliases for your columns (and avoid the use of SELECT *), this helps out MSSQL, as it doesn\'t have to "guess" which table the columns come from. </p></li>\n<li><p>If you aren\'t already, move to SPROCs, this allows MSSQL to index your data better for a given query\'s normal result set.</p></li>\n<li><p>Try following the execution plan of your SPROCS to ensure they are using the indexes you think they are.</p></li>\n<li><p>Run a trace against your database to see what the incoming requests look like. You may notice a particular SPROC is being run over and over: generally a good sign to cache the responses on the client if possible. (lookup lists, etc.)</p></li>\n</ol>\n'}, {'answer_id': 59097, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 0, 'selected': False, 'text': '<p>Update: Looks like SQL Server express is not the problem as they were using the same product in previous version of the application. I think your next step is in identifying the bottlenecks. If you are sure it is in the database layer, I would recommend taking a profiler trace and bringing down the execution time of the most expensive queries.</p>\n\n<p>This is another link I use for collecting statistics from SQL Server Dynamic Management Views (DMVs) and related Dynamic Management Functions (DMFs). Not sure if we can use in the Express edition.\n<a href="http://msdn.microsoft.com/en-us/magazine/cc135978.aspx" rel="nofollow noreferrer">Uncover Hidden Data to Optimize Application Performance</a>.</p>\n\n<hr>\n\n<p>Are you using SQL Server Express for a web app? As far as I know, it has some limitations for production deployment.</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/ms144275.aspx" rel="nofollow noreferrer">SQL Server Express</a> is free and can be redistributed by ISV\'s (subject to agreement). <strong>SQL Server Express is</strong> <strong>ideal for learning and building desktop and small server applications</strong>. This edition is the best choice for independent software vendors, non-professional developers, and hobbyists building client applications. If you need more advanced database features, SQL Server Express can be seamlessly upgraded to more sophisticated versions of SQL Server.</p>\n'}, {'answer_id': 59109, 'author': 'rjzii', 'author_id': 1185, 'author_profile': 'https://Stackoverflow.com/users/1185', 'pm_score': 3, 'selected': True, 'text': '<p>This is just something that I thought of, but check to see how much memory SQL Server is using when you have 20+ users - one of the limitations of the Express version is that it is <a href="http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx" rel="nofollow noreferrer">limited to 1GB of RAM</a>. So it might just be a simple matter of there not being enough memory available to to server due to the limitations of Express.</p>\n'}, {'answer_id': 84041, 'author': 'jinsungy', 'author_id': 1316, 'author_profile': 'https://Stackoverflow.com/users/1316', 'pm_score': 0, 'selected': False, 'text': "<p>I would check disk performance on the virtual server.  If that's one of the issues, I would recommend putting the database on a separate spindle.  </p>\n\n<p>Update: Move to separate spindle or Upgrade SQL Server version as Gulzar aptly suggests.</p>\n"}, {'answer_id': 84105, 'author': 'Alex L', 'author_id': 16127, 'author_profile': 'https://Stackoverflow.com/users/16127', 'pm_score': 0, 'selected': False, 'text': '<p>make sure you close connections after retrieving data.</p>\n'}, {'answer_id': 136744, 'author': 'Ben Scheirman', 'author_id': 3381, 'author_profile': 'https://Stackoverflow.com/users/3381', 'pm_score': 0, 'selected': False, 'text': '<p>Run SQL Profiler to see the queries sent to the database.  Look for queries that are:</p>\n\n<ul>\n<li>returning too much data</li>\n<li>constructed poorly</li>\n<li>are being executed too many times</li>\n</ul>\n'}]
['https://Stackoverflow.com/questions/59080', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5633/']