473,288 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

High CPU Usage

Hi guys,

I'm looking for ideas for troubleshooting the following. We've tried
some random things to try to treat the symptoms, but none seem robust
enough to use when we go live, and we'd rather discover the root cause:

We've got an ASP.NET application, running on framework 1.1 on Windows
2003 (IIS 6). Under default settings, during testing by two users,
we're seeing the CPU usage on w3wp.exe rocket up and stay up (and thus
cause web pages to be served extremely slowly). Pages do continue to
work, so fairly sure we've not got an infinite loop in there somewhere.

The only two thing that seems to be new to this application compared to
previous applications is that it uses remoting in a few places and
makes use of datagrids on most pages. The remoting - in two places it
places a call which can be reasonably slow (blocks internally until the
operation is complete). In the other, a first remoting call is made to
kick off a long-running process and then polling (via meta-refresh or
AJAX, depending on whether JS is available) is used to determine when
the operation is complete. The remoting channel is configured in
Application_Start. This is just for information, and may be unrelated
to our problem. The high CPU usage does not seem to be directly
triggered by any of these calls, and the server end of the remoting is
in a separate service (and it's CPU usage doesn't change)

The datagrids use custom databinding, since the number and type of
controls on each page is determined at runtime from the database. So,
for instance, a grid can consist of three columns. Each column has a
textbox control, a radio-button list, a drop-down list, etc. During the
databinding, the unneeded controls are hidden, and the correct control
has any necessary validation attached to it.

I've not used IISState before, but tried using it when the CPU maxed
out. Which resulted, after a while (and well before the dump was
complete) in IIS deciding to recycle the process.

Restarting IIS every thirty minutes is allowing testing to proceed, but
obviously this isn't a long-term solution.

Running under IIS 5 isolation mode resulted in no difference in
behaviour.

Letting IIS run more worker processes (we've tried values of 1, 3, 5
and 1000) seems to work for some period of time but eventually one of
the processes will again go up to high usage.

So, ideas on how to diagnose this problem further? Like I say, it
doesn't appear to be triggered by any particular page, and all requests
still succeed. Thanks in advance for any help,

Damien

May 15 '06 #1
1 4824
Damien wrote:
Hi guys,

I'm looking for ideas for troubleshooting the following. We've tried
some random things to try to treat the symptoms, but none seem robust
enough to use when we go live, and we'd rather discover the root cause:

We've got an ASP.NET application, running on framework 1.1 on Windows
2003 (IIS 6). Under default settings, during testing by two users,
we're seeing the CPU usage on w3wp.exe rocket up and stay up (and thus
cause web pages to be served extremely slowly). Pages do continue to
work, so fairly sure we've not got an infinite loop in there somewhere.

The only two thing that seems to be new to this application compared to
previous applications is that it uses remoting in a few places and
makes use of datagrids on most pages. The remoting - in two places it
places a call which can be reasonably slow (blocks internally until the
operation is complete). In the other, a first remoting call is made to
kick off a long-running process and then polling (via meta-refresh or
AJAX, depending on whether JS is available) is used to determine when
the operation is complete. The remoting channel is configured in
Application_Start. This is just for information, and may be unrelated
to our problem. The high CPU usage does not seem to be directly
triggered by any of these calls, and the server end of the remoting is
in a separate service (and it's CPU usage doesn't change)

The datagrids use custom databinding, since the number and type of
controls on each page is determined at runtime from the database. So,
for instance, a grid can consist of three columns. Each column has a
textbox control, a radio-button list, a drop-down list, etc. During the
databinding, the unneeded controls are hidden, and the correct control
has any necessary validation attached to it.

I've not used IISState before, but tried using it when the CPU maxed
out. Which resulted, after a while (and well before the dump was
complete) in IIS deciding to recycle the process.

Restarting IIS every thirty minutes is allowing testing to proceed, but
obviously this isn't a long-term solution.

Running under IIS 5 isolation mode resulted in no difference in
behaviour.

Letting IIS run more worker processes (we've tried values of 1, 3, 5
and 1000) seems to work for some period of time but eventually one of
the processes will again go up to high usage.

So, ideas on how to diagnose this problem further? Like I say, it
doesn't appear to be triggered by any particular page, and all requests
still succeed. Thanks in advance for any help,

Damien


Well, we had someone come in and provide some assistance to us today.
We've now resolved our issues, mostly through the assistance of some
tools we had already. Using a memory profiler led us to finding three
memory leaks (essentially, places where objects hooked themselves up to
static event handlers, and never unhooked themselves). But that wasn't
the cause...

We also found some older database access code which was using the
"single connection, synclock it and pass it around" method of
connecting to the database, which some of the code was spending a fair
bit of time in (we thought we'd migrated all of that code, but the
single shared connection was still available, and some code was still
using it). We think this was the major cause...

Once we'd switched to "grab a connection, do your work, close the
connection", we started getting Connection Pool Timeouts. Turns out
that two pieces of code we're doing "grab a connection, do your work,
return", which was quickly swamping the connection pool. This may have
been a contributor to the problems we were experiencing.

We also found a few minor bugs, but I don't think any of them were
contributing.

Major thing I'm trying to fathom out is why we weren't seeing the
Connection Pool Timeouts in the past.

But we're now a lot happier that our code is "correct", and the speed
issues have gone away. Definitely a lot happier using a profiler now
(both for performance and for memory usage)

Sorry if anyone spent any time trying to fathom anything out.

Damien

May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dave [Hawk-Systems] | last post by:
Occasionally in checking one of the servers, I noticed that mysql shows 85% + of cpu usage essentially leaving the server at 0% idle. After monitoring it for a few hours, the status did not...
3
by: Ian Taite | last post by:
Hello, I'm exploring why one of my C# .NET apps has "high" memory usage, and whether I can reduce the memory usage. I have an app that wakes up and processes text files into a database...
7
by: Marco Martin | last post by:
Hi Group, I've been working on an application that reads data from a comm port and 1) writes the data to file, 2) displays this data in three different graphs in real time.The port is receiving...
7
by: LBT | last post by:
I have a window service written using VB.NET. This window service will scan folders for file and grab the file content to be inserted to SQL Server on file detection. There are altogether 18...
2
by: Mechul | last post by:
Hi people i need serious help here.. I have a forum and my hosting company suspended it cuz of the high usage of sql. We did everything to make lower the usage but its still high. it was ...
0
by: Learning.Net | last post by:
I have a window application that uses ActiveX browser component for testing web site automatically using mshtml. Though application is running fine but there is abnormally high page file usage....
1
by: santhescript01 | last post by:
I have a window application that uses ActiveX browser component for testing web site automatically using mshtml. Though application is running fine but there is abnormally high page file usage....
2
by: Sin Jeong-hun | last post by:
In short, is there any way to know the very code that is currently hogging the CPU? I've written an application which continously GETting web pages using HttpWebRequest's asynchronous methods...
8
by: Diggla | last post by:
I was asked to look into a performance problem on a newly migrated DB server. The db server was moved from a local-physical-nt4-sybase to remote (10 mb wan link), virtual, Windows 2003, SQL...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.