Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to speed up an ASP/MS SQL web application

Posted on 2016-08-18
6
Medium Priority
?
94 Views
Last Modified: 2016-08-19
I have an ASP with MS SQL 2008 web application.
It runs fine on some installations but for one or two it runs very slow, the settings are identical. This two have more data in the database but nothing that should slow it down.

What kind of things can I do to speed it up ?
Index the DB ?  if so how ?  How would I 'run a trace' and then index based on that ?
Anything else that I could do to make the system faster ?  seems like only pages with connection to the database are slow.
0
Comment
Question by:Aleks
6 Comments
 
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 41761431
Can you post the code you are using?  How many rows in the dB?  In the recordset?

Well indexed dB, good queries and throw your data to an array instead of a recordset are the biggest without seeing what you are doing.
0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 2000 total points
ID: 41761442
Assuming the data is in the same database on the same server indexing should help indeed to return data faster from SQL however...if the slowness is NOT due SQL returning the record set but delivering/pasting data to client is different story.

In order to do that I would use SQL Profiler but please do NOT run the default trace against production servers as it may cause severe performance issues. You must customize the trace to select only events/columns that you're interested in and filter it by database name for instance to trace only queries hitting the DB(s) that's slow.

Here's what I usually do in profiler - start it from Tools menu in SSMS:
Click the Event Selection tab and un-select the two Audit
Check box "Show all columns" towards right bottom side and Un-check "BinaryData" then Check "DatabaseName", "Error", and "HostName"

Now you can Un-Check box "Show all columns"  and check "Column Filters" button below then add the DatabaseName you want to trace under the filter AND Duration > 1000 (milliseconds so only queries taking more than 1 second will be profiled)
Remember to check box to Exclude rows that contain no value on both filters then hit OK and Run.

IF all queries are fast - duration in max few seconds then I would look outside SQL for issues but if queries show long duration/timeouts(error 2 - Abort) then indexing definitely could help.
0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 2000 total points
ID: 41761444
Here's a query from SQL BOL to find missing indexes but please don't just add them all without further investigations.


--top 10 missing indexes from BOL
--https://technet.microsoft.com/en-us/library/ms345434(v=sql.110).aspx

use DbNameHere
go


SELECT top 100
  mig.index_group_handle, mid.index_handle,
  CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)
  ) AS improvement_measure,
  'CREATE INDEX missing_index_' + CONVERT (varchar, mig.index_group_handle) + '_' + CONVERT (varchar, mid.index_handle)
  + ' ON ' + mid.statement
  + ' (' + ISNULL (mid.equality_columns,'')
    + CASE WHEN mid.equality_columns IS NOT NULL AND mid.inequality_columns IS NOT NULL THEN ',' ELSE '' END
    + ISNULL (mid.inequality_columns, '')
  + ') '
  + ISNULL (' INCLUDE (' + mid.included_columns + ')', ' WITH (FILLFACTOR=80,MAXDOP=1);') AS create_index_statement,
  migs.*, mid.database_id, mid.[object_id]
FROM sys.dm_db_missing_index_groups mig with (nolock)
      INNER JOIN sys.dm_db_missing_index_group_stats migs with (nolock) ON migs.group_handle = mig.index_group_handle
      INNER JOIN sys.dm_db_missing_index_details mid with (nolock) ON mig.index_handle = mid.index_handle
WHERE CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)) > 10
      --and mid.statement like '%DBNameHere%'
ORDER BY migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans) DESC
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Accepted Solution

by:
lcohan earned 2000 total points
ID: 41761452
I also recommend to use SQL Own performance dashboard reports as they will unveil real time issue that can impact performance that you didn't even thought about like locking/blocking, DB file growth, parallelism, etc. I ran them since 2005 to date on all my prod servers with trust and no issues so far.

http://blogs.technet.com/b/rob/archive/2009/02/18/performance-dashboard-reports-for-sql-server-2008.aspx
http://blogs.msdn.com/b/sqlserverfaq/archive/2010/05/27/sql-server-performance-dashboard-reports-in-ssms-introduction-install-datediff-error-amp-modified-for-sql-2008.aspx
http://blogs.msdn.com/b/arvindsh/archive/2010/06/25/performance-dashboard-reports-in-sql-server-2008.aspx
0
 
LVL 52

Expert Comment

by:Vitor Montalvão
ID: 41762140
It runs fine on some installations but for one or two it runs very slow, the settings are identical.
Are those installations in the same network?
0
 

Author Comment

by:Aleks
ID: 41762452
Different networks. I will spread the points. My client's IT will run a trace and index the DB and see if that helps.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question