Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Important problem

Status
Not open for further replies.

Braderd

Programmer
Mar 2, 2008
20
TR
Hi,

I have a dedicated server but i have a important problem. My server cpu usage w3wp.exe always %100. My default.asp code:

<%@ LANGUAGE=VBScript CODEPAGE=1254 %>
<%
on error resume next%>



<% Response.Buffer = True %>


<!-- #include file="editmeSQL.asp" -->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="GENERATOR" content="Microsoft FrontPage 12.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>-</title>
<meta name="keywords" content="download,free,freeware,software,downloadcbcb,download cbcb,program,archive,download site,shareware,demo,trial,games,winamp,winzip">
<link rel="stylesheet" type="text/css" href="link2.css">
<link rel="stylesheet" type="text/css" href="link.css">
<style type="text/css">
<!--
.style1 {
color: #FF0000;
font-style: italic;
font-size: 16px;
}
.style2 {
font-size: x-small;
}
.style3 {
border-collapse: collapse;
}
-->
</style>
</head>
<!-- #include file="index2.asp" -->


<body>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" bgcolor="#387CA6"><b>
<font face="Arial" size="2" color="#FFFFFF">Dcbcb</font></b></td>
</tr>
</table>
<div align="center">
<center>
<br>
<table border="0" width="100%" id="table3">
<tr>
<td>
<p align="center"></td>
</tr>
</table>
<table border="0" width="90%" id="table5" height="91" bgcolor="#FFFFFF">
<tr>
<td>
<p align="center">
</td>
</tr>
</table>
<table border="0" width="100%" id="table34">
<tr>
<td>
<p align="center"><b><i><font face="Arial" size="2" color="#FF0000">
CATEGORIES</font></i></b></td>
</tr>
</table>
</center>
</div>
<table width="169" border="0" align="right" height="414" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">
<tr>
<td height="410" width="161" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="101%" id="AutoNumber11" height="197">
<tr>
<td width="100%" height="197" valign="top" style="border-bottom-style: none; border-bottom-width: medium">
<table cellSpacing="0" cellPadding="5" width="100%" bgColor="#ffffff" border="0" style="border-collapse: collapse" bordercolor="#111111" height="1">
<tr>
<td width="260" bgColor="#f5f5f5" height="35" style="border-style:solid; border-width:1; ">
<table cellSpacing="5" cellPadding="0" width="100%" border="0" height="358" bgcolor="#F5F5F5" bordercolor="#111111" align="right" class="style3">
<tr>
<td align="middle" width="220" bgColor="#387CA6" height="19" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
<a href=" <font color="#FFFFFF">New Downloads</font></a></td>
</tr>
<tr>
<td width="100%" height="76">
<font face="Arial" color="#124A82" size="2"><font class="pn2">
<span style="color: #36515F">
<%
kategori = ""
altKategori = ""
altKategorib = ""
Set Conn = Server.CreateObject("Adodb.Connection")
Conn.Open strDb

Set Rs = Server.CreateObject("Adodb.REcordset")
if altKategori = "" and altKategorib = "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' order by active mydate desc"
elseif altKategori <> "" and altKategorib = "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' and altKategori = '"& altkategori &"' order by active mydate desc"
elseif altKategori <> "" and altKategorib <> "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' and altKategori = '"& altkategori &"' and altKategorib = '"& altKategorib &"' order by active mydate desc"
end if
rSQL = "Select * from all_pages Where active=1 order by mydate desc"
Rs.Open rSQL, Conn, 1, 3

i = 1
%> <font face="Arial" size="1"><%
Do while i < 11 and Not Rs.Eof
%> </font></span></font><b><font face="Arial" color="#003366" size="2">»</font><font face="Arial" color="#387CA6" size="2"><span style="color: #36515F">&nbsp;</span></font></b><font face="Arial" color="#36515f" size="2"><span style="color: #36515F">
<font face="Arial" size="1">
<a href="../program.asp?id=<%=rs("id")%>"><%=rs("title")%>&nbsp;<%=rs("version")%></a>
<br>
<%
i = i + 1
Rs.MoveNExt
Loop
%> <%
conn.Close
Set conn = Nothing
Set rs = Nothing%> </font></span></font></font>
<font face="Times New Roman" color="#FF0000" size="2">
<p><b>
<a href=" <font color="#FF0000">Last 300 Added Downloads</font></a></b></font><br>
<font face="Arial" color="#36515f" size="2">
&nbsp;</font></p>
<table border="0" width="100%" id="table35">
<tr>
<td>
<p align="center">
</td>
</tr>
</table>
<p><font face="Arial" color="#36515f" size="2">
&nbsp;</p>
</font></td>
</tr>
<tr>
<td align="middle" width="100%" bgColor="#387ca6" height="19">
<font face="Times New Roman" color="#FFFFFF">Download cbcb Menu</font></td>
</tr>
<tr>
<td width="100%" bgColor="#f5f5f5" height="134">
<font face="Arial" color="#124A82" size="2"><font class="pn2">
<br>
»<b><i> <a href="contactus.asp">Contact Us</a></i></b></font></font><font color="#124A82"><br>
</font><font face="Arial" color="#36515f" size="2">
<a style="color: #124A82" class="pn2" href=" <br>
</a></font>
<font face="Arial" color="#124A82" size="2"><font class="pn2">
» </font></font><font face="Arial" size="2">
<font class="pn2" color="#124A82">
<b><i><a href="bugreport.asp">Bug Report</a></i></b></font></font><font color="#124A82"><br>
</font><font face="Arial" color="#36515f" size="2">
<a class="pn2" style="COLOR: #124A82" href=" <br>
</a></font>
<font face="Arial" color="#124A82" size="2"><font class="pn2">
» </font></font><b><i><font face="Arial" size="2">
<a href=" List</a></font></i></b><font color="#124A82"><br>
</font><font face="Arial" color="#36515f" size="2">
<a class="pn2" style="COLOR: #124A82" href=" <br>
</a></font>
<font face="Arial" color="#124A82" size="2"><font class="pn2">
» </font></font><font face="Arial" size="2">
<font class="pn2" color="#124A82">
<b><i><a href=" Programs to Your Site</a></i></b></font></font><br>
&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<p align="center"><br>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="182" border="1" align="left" height="182" style="border-collapse: collapse" bordercolor="#111111" cellpadding="4" cellspacing="0">
<tr>
<td width="172" bgColor="#f5f5f5" height="140" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<table cellSpacing="5" cellPadding="0" width="100%" border="0" height="40" bgcolor="#F5F5F5" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td align="middle" width="320" bgColor="#387CA6" height="17" style="border-left-style: solid; border-left-width: 1; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium">
<font color="#FFFFFF">From Editor</font></td>
</tr>
<tr>
<td width="100%" height="17"><span style="color: #36515F">
<font class="pn2"><b><font face="Verdana">-</font><font face="Verdana" size="1">
300</font><font face="Verdana" color="#36515f" size="1"> new program
every week. <a href="newreleases.asp">Click</a> in order to reach the
newest programs.</font></b><font face="Verdana" color="#36515f" size="1"><br>
<strong><span class="style2">


</span></strong>
&nbsp;</font></font></span></td>
</tr>
<tr>
<td align="middle" width="100%" bgColor="#387ca6" style="border-bottom-style: none; border-bottom-width: medium">
<font face="Arial" size="2" color="#FFFFFF">TOP Downloads</font></td>
</tr>
<tr>
<td width="100%" bgColor="#f5f5f5" style="border-style: none; border-width: medium">
<table cellSpacing="5" cellPadding="0" width="100%" border="1" height="1" bgcolor="#F5F5F5" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="1">
<font face="Arial" color="#36515f" size="2"><font class="pn2">
<font face="Arial" color="#124A82" size="1">
<%
kategori = ""
altKategori = ""
altKategorib = ""
Set Conn = Server.CreateObject("Adodb.Connection")
Conn.Open strDb

Set Rs = Server.CreateObject("Adodb.REcordset")
if altKategori = "" and altKategorib = "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' order by hit desc"
elseif altKategori <> "" and altKategorib = "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' and altKategori = '"& altkategori &"' order by hit desc"
elseif altKategori <> "" and altKategorib <> "" then
rSQL = "Select * from all_pages where active<>0 and kategori = '"& kategori &"' and altKategori = '"& altkategori &"' and altKategorib = '"& altKategorib &"' order by hit desc"
end if
rSQL = "Select * from all_pages order by hit desc"
Rs.Open rSQL, Conn, 1, 3

i = 1
%> <%
Do while i < 21 and Not Rs.Eof
%> <%=i%>-&nbsp;<a href="../program.asp?id=<%=rs("id")%>"> <%=rs("title")%>&nbsp;<%=rs("version")%></a><br>
<%
i = i + 1
Rs.MoveNExt
Loop
%> <%
conn.Close
Set conn = Nothing
Set rs = Nothing
%> </font><br>
<font face="Arial" color="#36515f" size="2">
<a class="pn2" style="COLOR: #36515f" href=" <br>
</a></font></font></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="17" style="border-top-style: none; border-top-width: medium">&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="595" border="0" align="center" height="327" style="border-width: 0">
<%
Set conn = CreateObject("ADODB.Connection")
conn.Open strDB
Dim rs
dim bir,iki
Set rs = CreateObject("ADODB.Recordset")
rSQL = "SELECT * FROM category WHERE m_id = 0 order by name asc"
Rs.Open rSQL, Conn, 1, 3
%>
<%
While (rs.EOF=false)
%>
<tr>
<td width="50%" align="center" valign="top">
<img src="images/index_html_smartbutton1.gif" namo_npi=":EmbededNPI3" border="0" align="center" width="19" height="16">
<b><a href=" color="#124A82"><%=rs("name")%></font></a></b>
<% bir=rs("id") %>
</td>
<% rs.movenext %>
<% if rs.EOF=false then %>
<td width="50%" align="center" valign="top">
<img src="images/index_html_smartbutton1.gif" namo_npi=":EmbededNPI3" border="0" align="center" width="16" height="16">
<b><a href=" color="#124A82"><%=rs("name")%></font></a></b>
<% iki=rs("id") %>
<% end if %>
</td>
</tr>

<tr>
<td width="50%" valign="top" >
<% if bir <> "" then %>
<% Dim rs1
Set rs1 = CreateObject("ADODB.Recordset")
rSQL = "SELECT * FROM category WHERE m_id = " & cstr(bir) & " order by name"
Rs1.Open rSQL, Conn, 1, 3
%> <% While (rs1.EOF=false)
rs1_sayac =rs1_sayac+1%>

<font face="arial, helvetica" color="#cc0000" size="2">
<a href="<% if rs1_sayac<rs1.recordcount then%>
<font face="arial, helvetica" size="2">,</font>
<% end if %>
<%
rs1.movenext
wend %>
<%
rs1_sayac=0
bir = ""
%>
<% end if %>
</td>
<td width="50%" valign="top" >
<% if iki <> "" then %>
<% Dim rs2
Set rs2 = CreateObject("ADODB.Recordset")
rSQL = "SELECT * FROM category WHERE m_id = " & cstr(iki) & " order by name"
Rs2.Open rSQL, Conn, 1, 3
%>
<% While (rs2.EOF=false)
rs2_sayac =rs2_sayac+1%>
<font face="arial, helvetica" color="#cc0000" size="2">
<a href="<% if rs2_sayac<rs2.recordcount then%>
</font><font face="arial, helvetica" size="2">,</font>
<% end if %>
<%
rs2.movenext
wend %>
<%
rs2_sayac=0
iki = ""
%>
<% end if %>
</td>
</tr>
<tr>
<td valign="top">&nbsp;</td>
<td valign="top">&nbsp;</td>
</tr>
<% rs.MoveNext
wend %>
</table>

<table border="0" cellpadding="0" bordercolor="#111111" width="55%" id="AutoNumber12" height="398" align="center" class="style3">
<caption><br>
</caption>
<td width="52%" height="186"><b><span class="style1"><strong><br>
<br>
Editor's Choice</strong></span></b><font size="2"><b><a href=" <br>
</a><a href=" 8
Ultra Edition Enhanced</a></b></font><br>
<font size="2">Nero 8 Ultra Edition Enhanced provides you with over 20
applications in one solution to complete all your digital media tasks on
your PC and on your TV. The Enhanced version now includes exciting new
features to access your media files throughout your connected digital
home, share files with family and friends, or take them with you on the
go.</font><br>
<br>
&nbsp;<p><font face="Arial" size="2"><br>
&nbsp;</font></td>
<td width="48%" height="186">
<p align="center"><br>
<img border="0" src=" width="202" height="164"></td>
</tr>
<caption><br>
</caption>
<tr>
<td width="250%" valign="top" colspan="2" height="70">
<table border="0" width="100%" id="table2" height="21">
<tr>
<td>
<p align="center"></td>
</tr>
</table>
<p align="center"><br>
<font face="Arial" color="#36515f" size="2"><a style="color: #36515f">
<img src="images/index_html_smartbutton1.gif" namo_npi=":EmbededNPI12" border="0" align="top"></a></font><font face="Arial" color="#CC3399" size="2"><a style="color: #36515f">&nbsp;</a></font><a href=" face="Arial" color="#0000FF" size="2">New
Releases</font></a><br>
<br>
</p>
</td>
</tr>
</table>
<p align="center"></p>
<p></p>
<div align="center">
</div>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber9">
<tr>
<td width="100%">
<p align="center">
<font face="Arial" size="1">© 2007-2008 downloadcbcb.com. All rights reserved.</font></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber8">
<tr>
<td width="100%">
<p align="center">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</table>
<table border="0" width="100%" id="table6">
<tr>
<td>
<p align="center"></td>
</tr>
</table>
<table border="0" width="100%" id="table7">
<tr>
<td>
<p align="center">

</td>
</tr>
</table>

</body>
<!--#include file="stats.asp"-->
</html>

Is there a problem in this code?
Thank you very much.
 
Is there a problem in this code?

You mean other than it is 13 screens long and made in Front Page?

Some explanation and a little bit of a walkthrough might help you get some answers.

Does the page actually render in a browser? I would guess 100% server usage to be indicative of an endless loop somewhere.
 
Yes , I create that site with frontpage. This is my entry page. When the visitor load this page cpu usage is 100. I just ask do you see any endless loop in these codes ?
 
I think BigRed1212 is on the right track. For testing you might add some temporary [tt]Exit While[/tt] at the bottom of each loop so the page runs through every loop only once. If that works, and it probably will, go back and remove one [tt]Exit While[/tt] and re-run it. Repeat until it breaks again and you'll have identified the culprit.
 
i added exit while code bottom of he page
<%Exit While%>
but i m receiving this error:

Microsoft VBScript compilation error '800a040f'

Invalid 'exit' statement

/Default.asp, line 566
Exit While
-----^
 
You need to put it inside each of your WHILE loops

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
please can you give me example?

<% While (rs2.EOF=false)
rs2_sayac =rs2_sayac+1%>
<font face="arial, helvetica" color="#cc0000" size="2">
<a href="<% if rs2_sayac<rs2.recordcount then%>
</font><font face="arial, helvetica" size="2">,</font>
<% end if %>
<%
rs2.movenext
wend %>
<%

example, where can i put here?
thank you.
 
Before 'wend'

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
From a Web page I see:
Exit While Immediately exits a While...Wend construct. It can only be used inside a While...Wend, and passes control to the statement following the Wend keyword.

If you just put it at the bottom of the page, I don't think you can do that. Like Sheco suggested, I would think you would want to put it in each possible loop to see if one of them is the problem.

Maybe something like:
Code:
<%  While (rs2.EOF=false)rs2_sayac =rs2_sayac+1%>
<font face="arial, helvetica" color="#cc0000" size="2">
<a href="[URL unfurl="true"]http://www.downloadcbcb.com/kategori.asp?lr=<%=rs2("id")%>"><%=rs2("name")%></a>[/URL]
<% if rs2_sayac<rs2.recordcount then%>
</font><font face="arial, helvetica" size="2">,</font>
<% end if %>
<%rs2.movenext 
[COLOR=red]exit while[/color] 
wend %>
 
Well, short of reading the code (ugh), you might want to turn off "On Error Resume Next"

First thing I do if I have buggy code.... in fact, I rarely, if ever, use On error Resume Next.



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
</font><font face="arial, helvetica" size="2">,</font>
<% end if %>
<%rs2.movenext
exit while
wend %>

i wrote but it is writing;

Microsoft VBScript compilation error '800a040f'

Invalid 'exit' statement

/default2.asp, line 475
exit while
-----^
 
Dude, you have loops within loops and pages of them all buried in a bunch of Front Page garbage.

I doubt you are going to find anybody willing to sort through it all for you.

I would simplify the thing. Get it down to one thing that runs. Then add the next thing. Then the next. Until it breaks.

BTW: I think "Do While" is different and you may need an "Exit Do" for those.
 
I agree it is better to be consistant and use all of one style or the other:
[tt]Do While / Loop [/tt] or [tt]While / Wend[/tt]

I prefer the Do loop myself, but it doesnt really matter... If for no other reason the consistancy is good because it helps avoid errors like this Exit Do vs Exit While.
 
i removed "on error resume next" code, it is working fine.
thank you all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top