Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 2nd, 2006, 06:58 AM
Registered User
 
Join Date: Jan 2006
Location: , , India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default w3wp.exe shows 100%

Dear All,

Our ASP pages are running on Windows 2003 Server Standard Edition (Without any Service Pack) and IIS 6.0.
When some specific ASP pages are called, CPU utilization is becoming 100%, with highest utilization (95 %) by W3WP.EXE process .

Can any body help me? Urgent....

Thanks


Kausik Nag Majumdar
Reply With Quote
  #2 (permalink)  
Old January 10th, 2006, 03:37 PM
Registered User
 
Join Date: Jul 2005
Location: frankfort, Ill, .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you step through the pages in dev?
You might be making a refence that is not obtainable on the server but is on the dev machine

Reply With Quote
  #3 (permalink)  
Old March 18th, 2011, 12:33 AM
tdh tdh is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Cool Stop the W3WP.exe worker process using VB.Net code

Finding the reason for the high CPU utilization can take some time since you will have to locate the code that is causing the problem. I am working through this right now on a vb.net app that I recently developed. In the meantime, I have developed a page that has a button which an Administrative user can click to stop the W3WP.exe process. It is a great stop gap measure until the problem code can be identified and updated. Here is the code I used. Just create a .aspx page with a button that call the following code on the corresponding .aspx.vb page. The code uses the command prompt to get the Tasklist and writes this to a file. I then parse the text file for the PID of the W3WP.exe worker process. Then, I access the command prompt programmatically again to terminate the W3WP.exe process using the PID.

Imports System.Web

Partial Class TAP
Inherits System.Web.UI.Page

Protected Sub btnStop_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnStop.Click
Call thStop_IIS()
End Sub

Function thStop_IIS()

Dim varRetval As String
Dim varPID As String
dim x as long
Dim savePath As String = Request.PhysicalApplicationPath + "exports\"
If Dir(savePath + "filename.txt") = "filename.txt" Then
Kill(savePath + "filename.txt")
End If

varRetval = Shell("cmd /c tasklist > " + savePath + "filename.txt")

For x = 1 To 90000000

Next x

varPID = thParse_File_Return_PID(savePath + "filename.txt")
varRetval = Shell("cmd /c taskkill /pid " & varPID & " /F")
Return True
End Function

Function thParse_File_Return_PID(ByVal varFileToParse As String) As Integer

On Error GoTo handler_err

Dim FILE_NAME As String = varFileToParse
Dim TextLine As String
Dim varPID As Integer
Dim x As Long

If System.IO.File.Exists(FILE_NAME) = True Then

Dim objReader As New System.IO.StreamReader(FILE_NAME)

Do While objReader.Peek() <> -1
'TextLine = TextLine & objReader.ReadLine() & vbNewLine
TextLine = objReader.ReadLine() & vbNewLine
If InStr(TextLine, "w3wp.exe") Then
varPID = Mid(TextLine, 31, 4)
End If
Loop

thParse_File_Return_PID = varPID

Else
thParse_File_Return_PID = 0
End If



handler_exit:
Exit Function

handler_err:
'MsgBox(Err.Number & " " & Err.Description & ":" & thParse_File_Return_PID
Resume

End Function

End Class
Reply With Quote
  #4 (permalink)  
Old March 18th, 2011, 12:50 AM
tdh tdh is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just thought others might find this code helpful as a stop gap while trying to find the root cause of the high CPU utilization.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Membership: aspnet_sql.exe -> aspnet_regsql.exe ricpue BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 August 9th, 2006 11:40 PM
problem creating .exe from MFC AppWizard(exe) c++ method Visual C++ 0 July 7th, 2006 03:28 AM
100% but still too wide? stay_asleep Dreamweaver (all versions) 1 December 16th, 2005 08:40 AM
error 500.100 hastikeyvan Dreamweaver (all versions) 2 November 21st, 2005 11:19 PM
PHP5 and php.exe php-cgi.exe php-win.exe freddo Beginning PHP 1 August 16th, 2004 09:28 AM



All times are GMT -4. The time now is 07:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.