Solved

How to speed up an ASP/MS SQL web application

Posted on 2016-08-18
6
85 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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 51

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

626 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