Solved

How to speed up an ASP/MS SQL web application

Posted on 2016-08-18
6
62 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:amucinobluedot
6 Comments
 
LVL 52

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 39

Assisted Solution

by:lcohan
lcohan earned 500 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 39

Assisted Solution

by:lcohan
lcohan earned 500 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 39

Accepted Solution

by:
lcohan earned 500 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 45

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:amucinobluedot
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
The viewer will learn how to count occurrences of each item in an array.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now