fleshlight
asked on
CF 5 - Slow Page - Session errors?
I'm having too many slow page entries in the server log. I've tuned the db's, using stored procedures and cached queries. Pages process under 50ms. I've done all the performance monitoring, and can not find a reason that I'm getting so many slow page entries. I suspect that there has to be a problem with our session managment. Could there be a problem with my application file?
<cfapplication name="appname" clientmanagement="yes" sessionmanagement="Yes" setclientcookies="yes" sessiontimeout="#CreateTim eSpan(0, 2, 0, 1)#" applicationtimeout="#Creat eTimeSpan( 2, 0, 0, 1)#">
<cflock name="#Session.CFID#" timeout="5">
<cfparam name="Session.Cart" default="">
<cfparam name="Session.LastPg" default="index.cfm">
<cfparam name="Session.CustID" default="0">
<cfparam name="Session.OrderNo" default="0">
<cfparam name="Session.SaveToCookie " default="0">
</cflock>
<cfif not isDefined('Session.CustInf o')>
<cflock name="Session.CFID" timeout="5">
<cfset Session.CustInfo=querynew( "FName,LNa me,Company ,Address1, Address2,C ity,State, Zip,Countr y,Phone,Em ail,Commen ts,ShipTo, inCookie,M aillist")>
</cflock>
</cfif>
<cfif not isDefined('Session.ShipTo' )>
<cflock name="Session.CFID" timeout="5">
<cfset Session.ShipTo=querynew("F Name,LName ,Address1, Address2,C ity,State, Zip,Countr y")>
</cflock>
</cfif>
<cfif not isDefined('Session.CardDat a')>
<cflock name="Session.CFID" timeout="5">
<cfset Session.CardData=querynew( "CardType, NameonCard ,CardNumbe r,CVV2,Exp iry")>
</cflock>
</cfif>
<cfset curPath = ReplaceNocase(CGI.SCRIPT_N AME,"#GetF ileFromPat h(CGI.SCRI PT_NAME)#" ,"")>
<cfif #LCase(GetFileFromPath(CGI .SCRIPT_NA ME))# eq 'order.cfm' or #LCase(GetFileFromPath(CGI .SCRIPT_NA ME))# eq 'cart.cfm'>
<cfset regLnk="http://#CGI.SERVER_NAME##curPath#">
<cfelse>
<cfset regLnk="">
</cfif>
<cfset cfQTrailer="CFID=#CFID#&CF TOKEN=#CFT OKEN#">
<cfparam name="ContQuery" default="0">
<cfapplication name="appname" clientmanagement="yes" sessionmanagement="Yes" setclientcookies="yes" sessiontimeout="#CreateTim
<cflock name="#Session.CFID#" timeout="5">
<cfparam name="Session.Cart" default="">
<cfparam name="Session.LastPg" default="index.cfm">
<cfparam name="Session.CustID" default="0">
<cfparam name="Session.OrderNo" default="0">
<cfparam name="Session.SaveToCookie
</cflock>
<cfif not isDefined('Session.CustInf
<cflock name="Session.CFID" timeout="5">
<cfset Session.CustInfo=querynew(
</cflock>
</cfif>
<cfif not isDefined('Session.ShipTo'
<cflock name="Session.CFID" timeout="5">
<cfset Session.ShipTo=querynew("F
</cflock>
</cfif>
<cfif not isDefined('Session.CardDat
<cflock name="Session.CFID" timeout="5">
<cfset Session.CardData=querynew(
</cflock>
</cfif>
<cfset curPath = ReplaceNocase(CGI.SCRIPT_N
<cfif #LCase(GetFileFromPath(CGI
<cfset regLnk="http://#CGI.SERVER_NAME##curPath#">
<cfelse>
<cfset regLnk="">
</cfif>
<cfset cfQTrailer="CFID=#CFID#&CF
<cfparam name="ContQuery" default="0">
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i've always gone with the scope attribute but whatever works for you.
ASKER
is there another way to do this? so that it won't put too much load on the cpu.
<cfif isDefined('id')>
<cfset newID=''>
<cfloop from="1" to="#len(id)#" index="x">
<cfif isNumeric(Mid(id,x,1))>
<cfset newID='#newID##Mid(id,x,1) #'>
</cfif>
</cfloop>
<cfset id=#newID#>
</cfif>
<cfif isDefined('id')>
<cfset newID=''>
<cfloop from="1" to="#len(id)#" index="x">
<cfif isNumeric(Mid(id,x,1))>
<cfset newID='#newID##Mid(id,x,1)
</cfif>
</cfloop>
<cfset id=#newID#>
</cfif>
You say pages process under 50 ms, that is excellent isn't it?
Where exactly do you think things are slow?
Where exactly do you think things are slow?
ASKER
yes, the tracker says that the total execution time is 32 ms per page. but the server.log reports that there are some connections that runs for more than 10 secs. on the same page.
i'm not sure where this is coming from, and we've tried to reproduce the said report by running at different types of connections, but we're still weren't able to reproduce it.
i'm not sure where this is coming from, and we've tried to reproduce the said report by running at different types of connections, but we're still weren't able to reproduce it.
Can you show me some of those entries, I assume you are talking about the CF server.log? I haven't seen any entries in there recording execution time, but it could just be something that I just don't experience ???
this is faster but we're talking in the range of < 0.1 ms, nothing to get excited over
<cfscript>
if(isDefined('id')) id=REReplace(id,'[^[:digit :]]','','A LL');
</cfscript>
<cfscript>
if(isDefined('id')) id=REReplace(id,'[^[:digit
</cfscript>
ASKER
i often have this report from server.log
"Warning","2532","02/09/04 ","19:41:4 6",,"Templ ate: D:\Inetpub\wwwroot\main\pr oducts.cfm , Ran: 10 seconds."
"Warning","2516","02/09/04 ","19:41:4 8",,"Templ ate: D:\Inetpub\wwwroot\main\pr oducts.cfm , Ran: 10 seconds."
"Warning","2584","02/09/04 ","19:41:4 9",,"Templ ate: D:\Inetpub\wwwroot\main\pr oducts.cfm , Ran: 11 seconds."
"Warning","2524","02/09/04 ","19:41:5 3",,"Templ ate: D:\Inetpub\wwwroot\main\pr oducts.cfm , Ran: 11 seconds."
although i've already cutdown several codes to make it run faster, but still it didn't work.
"Warning","2532","02/09/04
"Warning","2516","02/09/04
"Warning","2584","02/09/04
"Warning","2524","02/09/04
although i've already cutdown several codes to make it run faster, but still it didn't work.
what the code on products.cfm look like?
ASKER
<cfsilent>
<cfinclude template="includes/dbase.c fm">
<cfif isDefined('id')>
<cfquery name="qryChkCat" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
SELECT * FROM tbl_categories WHERE catz_id=#id#
</cfquery>
<cfif #qryChkCat.recordcount# is 0><cflocation url="index.cfm"></cfif>
<cfelse>
<cflocation url="index.cfm">
</cfif>
<cfquery name="qryProducts" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProducts @CatzID = #id#
</cfquery>
<cfset tdCount=0>
<cfparam name="prodCounter" default="0">
</cfsilent>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<cfinclude template="scripts/css01.cf m">
<title>Products Page :: Fleshlight.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#999999" link="#999999" vlink="#999999" alink="#999999" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="dbdbdb"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="180" height="30" align="left" valign="middle" background="images/sub_up_ bg.jpg" bgcolor="#FFFFFF"><cfinclu de template="includes/support Lnk.cfm">< /td>
<td colspan="2" align="left" valign="middle" background="images/sub_up_ bg.jpg" bgcolor="#FFFFFF"> <cfinclude template="includes/phne.cf m"></td>
</tr>
<tr>
<td colspan="3" background="images/blue_fl 10.gif"><a href="<cfoutput>#regLnk#in dex.cfm?#c fQTrailer# </cfoutput >"><img src="images/blue_fl10.jpg" alt="Welcome to Fleshlight.Com" width="177" height="60" border="0"></a></td>
</tr>
<tr align="right">
<td height="25" colspan="3" bgcolor="fafafa"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td align="center" background="images/sub_bg. jpg"><cfin clude template="includes/infoLnk s.cfm"></t d>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="fefefe"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/flTbl_s hadow02.gi f"><img src="images/flTbl_shadow02 .gif" width="1" height="24"></td>
</tr>
</table>
<cfinclude template="includes/prodLnk s.cfm"></t d>
<td align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" background="images/flTbl_s hadow02.gi f"><img src="images/flTbl_shadow02 .gif" width="1" height="24"><img src="images/flTbl_shadow02 .gif" width="150" height="24"></td>
</tr>
</table>
<table width="93%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td height="25" align="left" valign="middle"><div align="justify"><strong><f ont color="183958" size="3"><cfoutput>#qryChk Cat.catz_n ame#</cfou tput></fon t></strong ><br>
</div></td>
</tr>
<tr>
<td align="left" valign="top"><div align="justify"><font color="404040" size="2"><cfoutput>#qryChk Cat.catz_l ongdesc#</ cfoutput>< /font><br>
</div></td>
</tr>
</table>
<BR> <BR>
<table width="93%" border="0" cellspacing="3" cellpadding="2">
<tr align="center" valign="middle">
<cfoutput query="qryProducts">
<cfsilent>
<cfset refMoreInfo = "prodinfo.cfm?id=#prod_id# ">
<cfif #LTrim(prod_moreinfo)# gt "">
<cfset refMoreInfo = "#prod_moreinfo#">
<cfelse>
<cfset refMoreInfo = "prodinfo.cfm?id=#prod_id# ">
</cfif>
</cfsilent>
<FORM action="cartpro.cfm?#cfQTr ailer#" method=post name="frmItem#prodCounter# " id="frmItem#prodCounter#" onSubmit="javascript:retur n chkSelect#prodCounter#();" >
<td width="50%"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" bgcolor="f5f5f5"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="6">
<tr bgcolor="##FFFFFF">
<td colspan="2"><font color="BB0009"><strong><fo nt color="183958">#qryProduct s.prod_nam e#</font>< /strong><f ont color="183958">
<font color="BB0009"><!---(best seller)---></font></font>< /font></td >
</tr>
<tr>
<td width="30%" align="center" valign="top" bgcolor="##FFFFFF"><table width="80" border="0" cellspacing="5" cellpadding="0">
<tr>
<td align="center" valign="middle"><a href="#refMoreInfo#"><img src="images/products/#qryP roducts.im age_sm#" alt="#qryProducts.prod_nam e#" border="0"></a></td>
</tr>
<tr>
<td align="right" valign="middle"> <a href="#refMoreInfo#"><font size="1">view
larger</font> <img src="images/zoom.jpg" width="13" height="12" border="0"></a></td>
</tr>
</table></td>
<td align="center" valign="top" bgcolor="##FFFFFF"><table width="98%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td><strong>
<INPUT type=hidden value="#qryProducts.prod_i d#" name="Product_ID">
<input name=hTrigs type=hidden id="hTrigs" value=1>
</strong></td>
</tr>
<tr>
<td>#qryProducts.prod_desc #</td>
</tr>
<tr>
<td><table width="101%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/post.gif" width="15" height="16">
<a href="#refMoreInfo#"><font color="BB0009" size="1">More
Info</font></a> <strong><font color="##CCCCCC"><img src="images/spacer.gif" width="8" height="8"></font></strong ><strong>< /strong><s trong></st rong></td>
</tr>
<tr>
<td><img src="images/jack.gif" width="13" height="20">
<a href="##" onClick='javascript:window .open("How ToUse/howt o.html", "HowToUse", "toolbar=no,status=no,menu bar=no,scr ollbars=no ,width=700 ,height=50 0");'><fon t color="##BB0009" size="1">How
to use</font></a></td>
</tr>
</table></td>
</tr>
<tr>
<td> <strong>Price: <font color="183958">$#Decimalfo rmat(prod_ retailpric e)#</font> </strong>< /td>
</tr>
<tr>
<td><FONT face="microsoft sans serif, ms sans serif, arial, tahoma" size=-2>
<INPUT maxLength="5" size="3" value="1" name=Quantity>
</FONT> <font color="##003366" size="1">Quantity</font>
</td>
</tr>
<cfif (#LTrim(qryProducts.prod_o pts)# eq '' or #qryProducts.prod_opts# eq 0) OR (#qryProducts.prod_id# eq "53")>
<input name="sOption" type="hidden" id="sOption" value="0">
<cfelse>
<tr>
<td>
<select name="sOption">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op ts#" index="opts">
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_ id#">#qryS elections. opt_name#< cfif #qrySelections.opt_price# gt 0> : +$#decimalformat(qrySelect ions.opt_p rice)#</cf if></optio n>
</cfloop>
</select>
</td>
</tr>
</cfif>
<cfif #qryProducts.prod_id# eq "53">
<tr>
<td colspan="3" valign="top"><strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Wonder
Wave Insert:<br>
<select name="sOption1">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op ts#" index="opts">
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_ id#">#qryS elections. opt_name#
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect ions.opt_p rice)#
</cfif>
</option>
</cfloop>
</select>
</font></strong><br>
<strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Super
Tight Insert:<br>
<select name="sOption2">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op ts#" index="opts">
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_ id#">#qryS elections. opt_name#
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect ions.opt_p rice)#
</cfif>
</option>
</cfloop>
</select>
<br>
Super Ribbed Insert:<br>
<select name="sOption3">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op ts#" index="opts">
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_ id#">#qryS elections. opt_name#
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect ions.opt_p rice)#
</cfif>
</option>
</cfloop>
</select>
<br>
<br>
</font></strong> </td>
</tr>
</cfif>
<tr>
<td align="center" valign="middle">
<script language="JavaScript" type="text/JavaScript">
function chkSelect#prodCounter#() {
<cfif not (#LTrim(qryProducts.prod_o pts)# eq '' or #qryProducts.prod_opts# eq 0)>
<cfif #qryProducts.prod_id# eq "53">
if(document.frmItem#prodCo unter#.sOp tion1.valu e=="-") {
alert('An option selection/entry is required!');
document.frmItem#prodCount er#.sOptio n1.focus() ;
return false;
}
if(document.frmItem#prodCo unter#.sOp tion2.valu e=="-") {
alert('An option selection/entry is required!');
document.frmItem#prodCount er#.sOptio n2.focus() ;
return false;
}
if(document.frmItem#prodCo unter#.sOp tion3.valu e=="-") {
alert('An option selection/entry is required!');
document.frmItem#prodCount er#.sOptio n3.focus() ;
return false;
}
document.frmItem#prodCount er#.sOptio n.value = "";
document.frmItem#prodCount er#.sOptio n.value = document.frmItem#prodCount er#.sOptio n1.value + "," + document.frmItem#prodCount er#.sOptio n2.value + "," + document.frmItem#prodCount er#.sOptio n3.value;
<cfelse>
if(document.frmItem#prodCo unter#.sOp tion.value =="-") {
alert('An option selection/entry is required!');
document.frmItem#prodCount er#.sOptio n.focus();
return false;
}
</cfif>
</cfif>
if(document.frmItem#prodCo unter#.Qua ntity.valu e.match(/^ [0-9]{1,32 }$/)) {
return true;
} else {
alert('Please enter a Numeric Value');
document.frmItem#prodCount er#.Quanti ty.value = document.frmItem#prodCount er#.Quanti ty.value.r eplace(/[^ 0-9]/g, '');
return false;
}
}
</script>
<cfif #qryProducts.letBuy#>
<input name="bn_grab" type="image" id="bn_grab" src="images/grabit.jpg" border="0">
</cfif>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</FORM>
<cfset tdCount=#tdCount#+1><cfset prodCounter=prodCounter+1>
</cfoutput>
</tr>
</table>
<BR> </td>
<td width="119" align="center" valign="top" bgcolor="fefefe"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/flTbl_s hadow02.gi f"><img src="images/flTbl_shadow02 .gif" width="1" height="24"></td>
</tr>
</table>
<cfif #id# eq 1002>
<cfinclude template="includes/cCatzLn k02.cfm">
<cfelse>
<cfinclude template="includes/cCatzLn k.cfm">
</cfif>
</td>
</tr>
<tr valign="middle" >
<td height="43" colspan="3" align="center" background="images/header_ bg.gif"><c finclude template="includes/footer. cfm"></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<cfinclude template="includes/dbase.c
<cfif isDefined('id')>
<cfquery name="qryChkCat" datasource="#DSN#" CachedWithin="#CreateTimeS
SELECT * FROM tbl_categories WHERE catz_id=#id#
</cfquery>
<cfif #qryChkCat.recordcount# is 0><cflocation url="index.cfm"></cfif>
<cfelse>
<cflocation url="index.cfm">
</cfif>
<cfquery name="qryProducts" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProducts @CatzID = #id#
</cfquery>
<cfset tdCount=0>
<cfparam name="prodCounter" default="0">
</cfsilent>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<cfinclude template="scripts/css01.cf
<title>Products Page :: Fleshlight.Com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body text="#999999" link="#999999" vlink="#999999" alink="#999999" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="dbdbdb"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td width="180" height="30" align="left" valign="middle" background="images/sub_up_
<td colspan="2" align="left" valign="middle" background="images/sub_up_
</tr>
<tr>
<td colspan="3" background="images/blue_fl
</tr>
<tr align="right">
<td height="25" colspan="3" bgcolor="fafafa"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td align="center" background="images/sub_bg.
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="fefefe"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/flTbl_s
</tr>
</table>
<cfinclude template="includes/prodLnk
<td align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" background="images/flTbl_s
</tr>
</table>
<table width="93%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td height="25" align="left" valign="middle"><div align="justify"><strong><f
</div></td>
</tr>
<tr>
<td align="left" valign="top"><div align="justify"><font color="404040" size="2"><cfoutput>#qryChk
</div></td>
</tr>
</table>
<BR> <BR>
<table width="93%" border="0" cellspacing="3" cellpadding="2">
<tr align="center" valign="middle">
<cfoutput query="qryProducts">
<cfsilent>
<cfset refMoreInfo = "prodinfo.cfm?id=#prod_id#
<cfif #LTrim(prod_moreinfo)# gt "">
<cfset refMoreInfo = "#prod_moreinfo#">
<cfelse>
<cfset refMoreInfo = "prodinfo.cfm?id=#prod_id#
</cfif>
</cfsilent>
<FORM action="cartpro.cfm?#cfQTr
<td width="50%"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" bgcolor="f5f5f5"><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="6">
<tr bgcolor="##FFFFFF">
<td colspan="2"><font color="BB0009"><strong><fo
<font color="BB0009"><!---(best seller)---></font></font><
</tr>
<tr>
<td width="30%" align="center" valign="top" bgcolor="##FFFFFF"><table width="80" border="0" cellspacing="5" cellpadding="0">
<tr>
<td align="center" valign="middle"><a href="#refMoreInfo#"><img src="images/products/#qryP
</tr>
<tr>
<td align="right" valign="middle"> <a href="#refMoreInfo#"><font
larger</font> <img src="images/zoom.jpg" width="13" height="12" border="0"></a></td>
</tr>
</table></td>
<td align="center" valign="top" bgcolor="##FFFFFF"><table width="98%" border="0" cellspacing="2" cellpadding="0">
<tr>
<td><strong>
<INPUT type=hidden value="#qryProducts.prod_i
<input name=hTrigs type=hidden id="hTrigs" value=1>
</strong></td>
</tr>
<tr>
<td>#qryProducts.prod_desc
</tr>
<tr>
<td><table width="101%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/post.gif" width="15" height="16">
<a href="#refMoreInfo#"><font
Info</font></a> <strong><font color="##CCCCCC"><img src="images/spacer.gif" width="8" height="8"></font></strong
</tr>
<tr>
<td><img src="images/jack.gif" width="13" height="20">
<a href="##" onClick='javascript:window
to use</font></a></td>
</tr>
</table></td>
</tr>
<tr>
<td> <strong>Price: <font color="183958">$#Decimalfo
</tr>
<tr>
<td><FONT face="microsoft sans serif, ms sans serif, arial, tahoma" size=-2>
<INPUT maxLength="5" size="3" value="1" name=Quantity>
</FONT> <font color="##003366" size="1">Quantity</font>
</td>
</tr>
<cfif (#LTrim(qryProducts.prod_o
<input name="sOption" type="hidden" id="sOption" value="0">
<cfelse>
<tr>
<td>
<select name="sOption">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_
</cfloop>
</select>
</td>
</tr>
</cfif>
<cfif #qryProducts.prod_id# eq "53">
<tr>
<td colspan="3" valign="top"><strong><font
Wave Insert:<br>
<select name="sOption1">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect
</cfif>
</option>
</cfloop>
</select>
</font></strong><br>
<strong><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Super
Tight Insert:<br>
<select name="sOption2">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect
</cfif>
</option>
</cfloop>
</select>
<br>
Super Ribbed Insert:<br>
<select name="sOption3">
<option value="-">Choose selection:</option>
<cfloop list="#qryProducts.prod_op
<cfsilent>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
</cfsilent>
<option value="#qrySelections.opt_
<cfif #qrySelections.opt_price# gt 0>
: +$#decimalformat(qrySelect
</cfif>
</option>
</cfloop>
</select>
<br>
<br>
</font></strong> </td>
</tr>
</cfif>
<tr>
<td align="center" valign="middle">
<script language="JavaScript" type="text/JavaScript">
function chkSelect#prodCounter#() {
<cfif not (#LTrim(qryProducts.prod_o
<cfif #qryProducts.prod_id# eq "53">
if(document.frmItem#prodCo
alert('An option selection/entry is required!');
document.frmItem#prodCount
return false;
}
if(document.frmItem#prodCo
alert('An option selection/entry is required!');
document.frmItem#prodCount
return false;
}
if(document.frmItem#prodCo
alert('An option selection/entry is required!');
document.frmItem#prodCount
return false;
}
document.frmItem#prodCount
document.frmItem#prodCount
<cfelse>
if(document.frmItem#prodCo
alert('An option selection/entry is required!');
document.frmItem#prodCount
return false;
}
</cfif>
</cfif>
if(document.frmItem#prodCo
return true;
} else {
alert('Please enter a Numeric Value');
document.frmItem#prodCount
return false;
}
}
</script>
<cfif #qryProducts.letBuy#>
<input name="bn_grab" type="image" id="bn_grab" src="images/grabit.jpg" border="0">
</cfif>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</FORM>
<cfset tdCount=#tdCount#+1><cfset
</cfoutput>
</tr>
</table>
<BR> </td>
<td width="119" align="center" valign="top" bgcolor="fefefe"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/flTbl_s
</tr>
</table>
<cfif #id# eq 1002>
<cfinclude template="includes/cCatzLn
<cfelse>
<cfinclude template="includes/cCatzLn
</cfif>
</td>
</tr>
<tr valign="middle" >
<td height="43" colspan="3" align="center" background="images/header_
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
could you change this procedure to accept a list as the parameter instead of an individual ID? I don't imagine your getting a lot of benefit from the caching. CF only caches a specific # of queries (set in CF Admin)... each time you pass in a new #opt#, your caching a new query.
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS pan(0,1,0, 0)#">
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
<cfquery name="qrySelections" datasource="#DSN#" CachedWithin="#CreateTimeS
EXEC sp_qryProdOpts @Opt_id = #opts#
</cfquery>
ASKER
9999 queries.. we've been tuning it for weeks. our average req time is has been reduced greatly.
Are you running the CF server on the same machine as the SQL Server? If so this is gonna cuase everything to run slower under heavy load. Watch your SQL performace my guess is it is performing slower under heavy load and this is holding up the product page. Additionally make sure your Stored Proceudres are compiled and stay compiled certain tasks in stored procedure force the SP to get destroyed and recompiled each time. I would look specifially at the one that is getting called each iteration of the loop.
jyokum:
>> I haven't seen any entries in there recording execution time, but it could just be something that I just don't experience ???
In the CF admin under Logging Settings there is a checkbox to check that reads "Log slow pages taking longer than <inputbox> seconds." thats how he is getting this info in the server log :)
jyokum:
>> I haven't seen any entries in there recording execution time, but it could just be something that I just don't experience ???
In the CF admin under Logging Settings there is a checkbox to check that reads "Log slow pages taking longer than <inputbox> seconds." thats how he is getting this info in the server log :)
ASKER
The perfmon stats on the db look excellent. the only cf requests that take 60+ ms are from our admin section (searching orders, etc..) and our forum. neither the admin or forum queries are causing the problem, because we've still get entries at night (when nobody is using the admin section) and we've disabled the forum at the same time. Average DB time is 7 ms.
ASKER
Our slow page errors continue, but the application.cfm has improved.
ASKER