Solved

How to speed up an ASP/MS SQL web application

Posted on 2016-08-18
6
82 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 53

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 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 40

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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 40

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 50

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

739 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