There are many similar posts over the internet. You should be able to find the right debugging tools or techniques using a Google search on "w3wp.exe high cpu".
Typically this indicates bad code in a web page. w3wp.exe is the ASP.Net process. However, this does not necessarily mean there is a problem with your ASP.Net application. Did you mean asp script or asp.net application?
The possible causes:
1. It could be that a page was running terrible queries or stored procedures.
Here is the example I found from the internet for your reference:
"I think the problem has been resolved. I noticed that when a user logged in, cpu increased about 10/15 %, than I tried with some iis debugging utilities, and I suspected that there was something wrong in the login verify procedure. No loop, only a stored procedure that was not working, because it tried to insert data on a Sql server Database that was not on that server. I corrected this Stored procedure".
2. A service was serving many clients.
I think the problem is in your own code.
First thing you need to do is to isolate your development environment from the production environment. Test your code running as a local web site first before you upload to the web server. This should help to identify any problems.
Then find out the problem page using the following debugging tools and techniques:
1. IISPeek to locate the page which caused the high CPU usage
2. Running a few logs to capture the problem. IIS (Web Service) performance counters can tell you how much traffic is coming to the site.
3. Logparser to analyse log files and find which page has long time execution
4. Attaching WinDbg + sos and run !runaway. That will show you which thread is taking the most CPU time. Do a !clrstack on the thread to find out what it is doing. For more information, visit
http://www.codeproject.com/debug/windbg_part1.asp