An asp page caused cpu rising to 100% --> dllhost.exe

An asp page caused cpu rising to 100% --> dllhost.exe

am 02.02.2007 21:26:01 von bettys

Hi all,
Today, an interesting thing happened to me. When I am doing the test of an
asp program, one of the pages(which I submitted several ten times before, no
problem at all) caused our server cpu rising to 100% and I reset IIS and
submit that page again and same thing happened again, and then reset IIS
again and it happened again, the process caused this is dllhost.exe.
Thinking about what's the difference this time from what I submitted before.
The only thing I can think of is I entered some name fields data with
apostrophe.

I am wondering what is the issue?
--
Betty

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 02.02.2007 21:50:40 von Mike Brind

"c676228" wrote in message
news:FA5C124C-10D5-4671-9832-9DE680D23E42@microsoft.com...
> Hi all,
> Today, an interesting thing happened to me. When I am doing the test of an
> asp program, one of the pages(which I submitted several ten times before,
> no
> problem at all) caused our server cpu rising to 100% and I reset IIS and
> submit that page again and same thing happened again, and then reset IIS
> again and it happened again, the process caused this is dllhost.exe.
> Thinking about what's the difference this time from what I submitted
> before.
> The only thing I can think of is I entered some name fields data with
> apostrophe.
>
> I am wondering what is the issue?

Why do you think the apostrophe is relevant?

--
Mike Brind

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 02.02.2007 22:08:01 von bettys

Hi Mike,
I don't think it is relevant. I just cannot figure out why the page cause
the problem today. Out site has this kind of issue very often. I am haunted
by the problem these days.
--
Betty


"Mike Brind" wrote:

>
> "c676228" wrote in message
> news:FA5C124C-10D5-4671-9832-9DE680D23E42@microsoft.com...
> > Hi all,
> > Today, an interesting thing happened to me. When I am doing the test of an
> > asp program, one of the pages(which I submitted several ten times before,
> > no
> > problem at all) caused our server cpu rising to 100% and I reset IIS and
> > submit that page again and same thing happened again, and then reset IIS
> > again and it happened again, the process caused this is dllhost.exe.
> > Thinking about what's the difference this time from what I submitted
> > before.
> > The only thing I can think of is I entered some name fields data with
> > apostrophe.
> >
> > I am wondering what is the issue?
>
> Why do you think the apostrophe is relevant?
>
> --
> Mike Brind
>
>
>

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 05.02.2007 10:34:36 von stcheng

Hello Betty,

It seems that an ASP page used to work well currently raise high CPU
problem on your production environment,correct?

Based on my experience, for classic ASP, high CPU issue is mostly caused by
the Page that call some COM components and run into some issue with the COM
object's function call. Elsewise, the page's code logic is also worth
checking since you mentioned that you've changed the input data of the
page, you can change the page back to the original input data to see
whether the problem remains.

I'm not sure whether you've some other ASP or IIS applications host on that
site and shared the same worker process with your classic ASP application.
If so, you can consider set your problem ASP application's IIS virtual
directory's "application Protection" level to high(for IIS 5) or make it
use a separate application pool from other applications(for IIS6). Thus,
your ASP application will own a IIS worker process itself and won't be
affected by other applications.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx .

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 05.02.2007 20:30:01 von bettys

Hi Steven,
I believe you probably can give me a hint. I am pretty sure that my code has
some problems when the name fieldd have some apostrophe. And I duplicate the
problem case again, but I cannot figure out what is the problem. Here is the
code.


Function PrepCustomerDatatoArray(iTotNumCustomer)
dim CustInfoArr(50, 5)
....
for i=1 to iTotNumCustomer

If InStr(FName, "'") <> 0 Then
CustInfoArr(i-1, 0)=EscStrApostrophe(FName) ' B'etty will become B''etty
Else
CustInfoArr(i-1, 0)=FName
End If
Response.Write CustInfoArr(i-1, 0) & "
" ' It can display B''etty in the
next page
If MInit<> "" Then
CustInfoArr(i-1, 1)=MInit
End If
If InStr(LName, "'") <> 0 Then
CustInfoArr(i-1, 2)=EscStrApostrophe(LName)
Else
CustInfoArr(i-1, 2)=LName
End If
Response.Write CustInfoArr(i-1, 2) & "
" ' It can displayed O''neal if
customer enter O'neal as last name in the next page
CustInfoArr(i-1, 3)=BDate

Next
'but here it what the problem occurs I believe
'if iTotNumInsured =1, the fname and lname in array with apostrophe will
become empty here
'but it display MInit and BirthDate OK
'if fields don't have apostrophe, it will be displayed fine
'if iTotNumInsured >1, the server cpu becomes 100%,
'what is going on the array is in the scope since mInit and bDate are fine
and if
'no apostrophe, everything is fine?
For i=1 to iTotNumInsured
Response.Write CustInfoArr(i-1, 0) & " " & CustInfoArr(i-1, 1) & " " &
CustInfoArr(i-1, 2) & " " & CustInfoArr(i-1, 3)
Next
End Function

Function EscStrApostrophe(ByVal Str)
dim NameArr
dim NameStr
NameStr=""
NameArr=Split(Str, "'", -1)
For i=0 to UBound(NameArr)
NameStr=NameStr & NameArr(i) & "''"
Next
EscStrApostrophe=Left(NameStr, Len(NameStr)-2)
End Function
--
Betty


"Steven Cheng[MSFT]" wrote:

> Hello Betty,
>
> It seems that an ASP page used to work well currently raise high CPU
> problem on your production environment,correct?
>
> Based on my experience, for classic ASP, high CPU issue is mostly caused by
> the Page that call some COM components and run into some issue with the COM
> object's function call. Elsewise, the page's code logic is also worth
> checking since you mentioned that you've changed the input data of the
> page, you can change the page back to the original input data to see
> whether the problem remains.
>
> I'm not sure whether you've some other ASP or IIS applications host on that
> site and shared the same worker process with your classic ASP application.
> If so, you can consider set your problem ASP application's IIS virtual
> directory's "application Protection" level to high(for IIS 5) or make it
> use a separate application pool from other applications(for IIS6). Thus,
> your ASP application will own a IIS worker process itself and won't be
> affected by other applications.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
> ications.
>
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx .
>
> ==================================================
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 05.02.2007 20:47:25 von reb01501

c676228 wrote:
> Function EscStrApostrophe(ByVal Str)
> dim NameArr
> dim NameStr
> NameStr=""
> NameArr=Split(Str, "'", -1)
> For i=0 to UBound(NameArr)
> NameStr=NameStr & NameArr(i) & "''"
> Next
> EscStrApostrophe=Left(NameStr, Len(NameStr)-2)
> End Function
> --
> Betty
>

Ummm, it appears that you are not aware there is a builtin vbscript
function called Replace that does exactly what your function is doing,
correct? You should use it in your function:

Function EscStrApostrophe(ByVal Str)
If len(Sr) > 0 then
EscStrApostrophe=Replace(Str,"'","''")
Else
EscStrApostrophe=Str
End If
End Function

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 05.02.2007 21:26:00 von bettys

Hi Bob,
Thanks for showing me that, I know the replace function but I don't know why
I created that similar funciton myself, funny. It's the problem from that
function for sure, after I replace the function with your code, it's
perfectly fine. it won't cause cpu problem or not responding issue any more.
but I still don't know what's wrong with my original code. I need to figure
out any way in order to avoid similar problem in my code.

Thank you so much. :=))

--
Betty


"Bob Barrows [MVP]" wrote:

> c676228 wrote:
> > Function EscStrApostrophe(ByVal Str)
> > dim NameArr
> > dim NameStr
> > NameStr=""
> > NameArr=Split(Str, "'", -1)
> > For i=0 to UBound(NameArr)
> > NameStr=NameStr & NameArr(i) & "''"
> > Next
> > EscStrApostrophe=Left(NameStr, Len(NameStr)-2)
> > End Function
> > --
> > Betty
> >
>
> Ummm, it appears that you are not aware there is a builtin vbscript
> function called Replace that does exactly what your function is doing,
> correct? You should use it in your function:
>
> Function EscStrApostrophe(ByVal Str)
> If len(Sr) > 0 then
> EscStrApostrophe=Replace(Str,"'","''")
> Else
> EscStrApostrophe=Str
> End If
> End Function
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 06.02.2007 03:37:10 von stcheng

Thanks for Bob's good idea,

That does save a lot of code and time :)

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 06.02.2007 04:09:01 von bettys

Steven,
You made good point too. I use IIS 5.0, if set up too many applications to
"High" application, I believe I probably will use more memory, but I guess
it will help to nail down the culprit application.
--
Betty


"Steven Cheng[MSFT]" wrote:

> Hello Betty,
>
> It seems that an ASP page used to work well currently raise high CPU
> problem on your production environment,correct?
>
> Based on my experience, for classic ASP, high CPU issue is mostly caused by
> the Page that call some COM components and run into some issue with the COM
> object's function call. Elsewise, the page's code logic is also worth
> checking since you mentioned that you've changed the input data of the
> page, you can change the page back to the original input data to see
> whether the problem remains.
>
> I'm not sure whether you've some other ASP or IIS applications host on that
> site and shared the same worker process with your classic ASP application.
> If so, you can consider set your problem ASP application's IIS virtual
> directory's "application Protection" level to high(for IIS 5) or make it
> use a separate application pool from other applications(for IIS6). Thus,
> your ASP application will own a IIS worker process itself and won't be
> affected by other applications.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
>
> ==================================================
>
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/de fault.aspx#notif
> ications.
>
>
>
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx .
>
> ==================================================
>
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>

Re: An asp page caused cpu rising to 100% --> dllhost.exe

am 06.02.2007 09:07:34 von mmcginty

"c676228" wrote in message
news:53177B9F-F3FE-4AAE-AD76-30F76A689069@microsoft.com...
> Hi Bob,
> Thanks for showing me that, I know the replace function but I don't know
> why
> I created that similar funciton myself, funny. It's the problem from that
> function for sure, after I replace the function with your code, it's
> perfectly fine. it won't cause cpu problem or not responding issue any
> more.
> but I still don't know what's wrong with my original code. I need to
> figure
> out any way in order to avoid similar problem in my code.

I suspect your code was ending-up in a forever loop. If you turn errors
off, and an error occurs in the evaluation of a boolean expression, such as:

On Error Resume Next
For i = 1 to UBound(NameArr)
[...]
Next

If an error occurs testing that expression, like say NameArr is not an
array, control flows to the next statement; effectively the code runs as if
the condition were true.


-Mark



> Thank you so much. :=))
>
> --
> Betty
>
>
> "Bob Barrows [MVP]" wrote:
>
>> c676228 wrote:
>> > Function EscStrApostrophe(ByVal Str)
>> > dim NameArr
>> > dim NameStr
>> > NameStr=""
>> > NameArr=Split(Str, "'", -1)
>> > For i=0 to UBound(NameArr)
>> > NameStr=NameStr & NameArr(i) & "''"
>> > Next
>> > EscStrApostrophe=Left(NameStr, Len(NameStr)-2)
>> > End Function
>> > --
>> > Betty
>> >
>>
>> Ummm, it appears that you are not aware there is a builtin vbscript
>> function called Replace that does exactly what your function is doing,
>> correct? You should use it in your function:
>>
>> Function EscStrApostrophe(ByVal Str)
>> If len(Sr) > 0 then
>> EscStrApostrophe=Replace(Str,"'","''")
>> Else
>> EscStrApostrophe=Str
>> End If
>> End Function
>>
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get a
>> quicker response by posting to the newsgroup.
>>
>>
>>