Solved

ASPX causes high IIS CPU

Posted on 2009-04-06
6
501 Views
Last Modified: 2012-05-06
Hello,

I'm a network/systems guy so I appologize in advance if I left something out.  Here's some attachements for code from a custom web page that we use internally.  This section is for medical records.  There is a page that you click a find button, that passes the ID=Central to records.aspx which is tagged to use the centralworklist.ascx with the central id.  Every time it is called it will cause high cpu on the IIS server.  There are quite a few users of this app so it brings down the speed for everyone else to a crawl.  It is IIS 6 on the front and ms sql 2008 for the back.  

Is there anything that pops out to anyone that could cause this and what we can do to fix?

Thanks alot for the help, just let me know if I left anything important out (I'm sure I did :)
Records.aspx.txt
Records.aspx.cs.txt
Records.aspx.resx.txt
CentralWorklist.ascx.txt
0
Comment
Question by:FHCSD_IT
  • 2
  • 2
  • 2
6 Comments
 
LVL 21

Expert Comment

by:MogalManic
ID: 24087741
CentralWorkList.ascx contains a gridview.

My guess is that the code that populates the gridview is in the CentralWorkList.ascx.cs.  This is where the bottleneck probably is.  Can you send that code?  If not, look in that CS file for code is executed inside loops (for, foreach, while,...).

All of the code you sent does not show anything that would be slower than any other pages.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24087814
you said that when you click on find the CPU usage increases
first question is the IIS server also hosting the database server
second when you run the query or stored procedure how much time does it take to bring the result set back
third how many results are being returned - number or rows returned
0
 
LVL 1

Author Comment

by:FHCSD_IT
ID: 24088131
Sorry about that, I'm including the CentralWorklist.ascx.cs, and the stored procedure that is called from this.

The Sql is hosted on a separate server, looks like it is getting the top 2000 records in the sp.

I ran the sp directly on the sql server and it completes in 1 -2 seconds with no cpu problems, if run through IIS it takes 20 - 40 seconds and has the high cpu the whole time.

Thanks alot for the help, it's appreciated.
CentralWorklist.ascx.cs.txt
usp-GetWorkListValues.sql.txt
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 21

Accepted Solution

by:
MogalManic earned 400 total points
ID: 24090084
The only thing I see is that the call of CreateJavaScriptArrayForPrintingRoutingSlips() creates a Javascript array of all 2000 rows.  Which might create extra processing and increase the size of the HTML being downloaded.

You could enhance the function to only generate the routing scripts for the current page being displayed.
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 100 total points
ID: 24093881
shoudnt it be better if you create the routing slip only when its required to be printed instead of creating it always
it wil save a lot of processing as you are not going to print the slip always
0
 
LVL 1

Author Closing Comment

by:FHCSD_IT
ID: 31567308
Thanks alot for the help
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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