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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CF server seems to get bogged down after a while

Status
Not open for further replies.

lucidtech

IS-IT--Management
Jan 17, 2005
267
US
My Coldfusion server seems to get bogged down the longer it runs.. I'm guessing it has to do with my application.cfm file. Can anyone tell me what the issue may be? Am I storing too many variables?

Below is the code (altered) from my Application.cfm file.

<cfapplication name="myapp" clientmanagement="Yes"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
applicationtimeout="#CreateTimeSpan(0,0,6,0)#" setdomaincookies="true" Clientstorage="Cookie">
<cfparam name="request.default_title" default="title">
<cfparam name="request.default_header" default="header">
<cfparam name="request.under_construction" default="ye">
<cfparam name="request.database" default="db_name">

<cfparam name="request.zips_database" default="db_name">

<cfparam name="request.server_url" default="<cfparam name="request.email_server" default="mail.websiteurl.com">
<cfparam name="request.email_password" default="mailpass">
<cfparam name="request.email_user" default="support@websiteurl.com">
<cfparam name="request.pass_key" default="removed for security">
<cfparam name="request.post_key" default="removed for security">
<cfparam name="request.default_keywords" default="keywords here">

<!--- session varaibles --->
<cfparam name="session.loggedIn" default="false">
<cfparam name="session.user_id" default="0">
<cfparam name="session.user_display_name" default="Guest">
<cfparam name="session.user_last_call" default="">
<cfparam name="session.user_account_type" default="0">
<cfparam name="session.user_postal_code" default="">
<cfparam name="session.user_browse_zip" default="">
<cfparam name="session.user_browse_radius" default="1">
<cfparam name="session.user_browse_country" default="ANY">
<cfparam name="session.user_browse_gender" default="2">
<cfparam name="session.user_browse_blogs_order" default="3">
<cfparam name="session.user_time_zone" default="-4">
<cfparam name="session.page_style" default="">
<cfparam name="session.user_points" default="">
<cfparam name="session.user_session_count" default="0">
<cfparam name="session.im_chat_open" default="0">
<cfparam name="session.im_chat_count" default="0">
<cfparam name="session.im_chat_on" default="1">
<cfparam name="session.im_open_windows" default="">
<cfparam name="session.im_open_windows_count" default="0">


<cfparam name="request.thisServer" default="<cfparam name="request.thisRoot" default="D:\home\websiteurl.com\<cfparam name="request.db_username" default="db_username">
<cfparam name="request.db_password" default="db_pass">
<cfparam name="request.zips_username" default="db_username">
<cfparam name="request.zips_password" default="db_pass">

<cfif request.under_construction eq "yes">
<cfif session.user_id eq 1>
<cfelseif find('admin_login', cgi.script_name) neq 0>
<cfelse>
<cfif cgi.script_name neq "/under_construction.cfm" and cgi.script_name neq "/m7s/under_construction.cfm">
<script>
parent.location = "under_construction.cfm"
</script>
</cfif>
</cfif>
<cfelse>
<cfif cgi.script_name eq "/under_construction.cfm">
<script>
parent.location = "index.cfm"
</script>
</cfif>

<cfif session.loggedIn NEQ "true">
<cfif cgi.script_name EQ "/HalosAndHornsTransactions.cfc" OR cgi.script_name EQ "/m7s/HalosAndHornsTransactions.cfc">
<cfelseif cgi.script_name EQ "/mySevenSinsAdminTransactions.cfc" OR cgi.script_name EQ "/m7s/mySevenSinsAdminTransactions.cfc">
<cfelseif cgi.script_name EQ "/index.cfm" OR cgi.script_name EQ "/m7s/index.cfm">
<cfelseif cgi.script_name EQ "/login.cfm" OR cgi.script_name EQ "/m7s/login.cfm">
<cfelseif cgi.script_name EQ "/login_process.cfm" OR cgi.script_name EQ "/m7s/login_process.cfm">
<cfelseif cgi.script_name EQ "/register.cfm" OR cgi.script_name EQ "/m7s/register.cfm">
<cfelseif cgi.script_name EQ "/submit_confirmation_email.cfm" OR cgi.script_name EQ "/m7s/submit_confirmation_email.cfm">
<cfelseif cgi.script_name EQ "/resubmit_confirmation_email.cfm" OR cgi.script_name EQ "/m7s/resubmit_confirmation_email.cfm">
<cfelseif cgi.script_name EQ "/confirmation_email_sent.cfm" OR cgi.script_name EQ "/m7s/confirmation_email_sent.cfm">
<cfelseif cgi.script_name EQ "/unconfirmed_account.cfm" OR cgi.script_name EQ "/m7s/unconfirmed_account.cfm">
<cfelseif cgi.script_name EQ "/confirm_account.cfm" OR cgi.script_name EQ "/m7s/confirm_account.cfm">
<cfelseif cgi.script_name EQ "/account_confirmed.cfm" OR cgi.script_name EQ "/m7s/account_confirmed.cfm">
<cfelseif cgi.script_name EQ "/adminlogin.cfm" OR cgi.script_name EQ "/m7s/adminlogin.cfm">
<cfelseif cgi.script_name EQ "/cash_ipn.cfm" OR cgi.script_name EQ "/m7s/adminlogin.cfm">
<cfelseif cgi.script_name EQ "/user_profile.cfm" OR cgi.script_name EQ "/m7s/user_profile.cfm">
<cfelseif cgi.script_name EQ "/temp.cfm" OR cgi.script_name EQ "/m7s/temp.cfm">
<cfelseif cgi.script_name EQ "/browse_members.cfm" OR cgi.script_name EQ "/m7s/browse_members.cfm">
<cfelseif cgi.script_name EQ "/browse_blogs.cfm" OR cgi.script_name EQ "/m7s/browse_blogs.cfm">
<cfelseif cgi.script_name EQ "/admin_login.cfm" OR cgi.script_name EQ "/m7s/admin_login.cfm">
<cfelseif cgi.script_name EQ "/user_blog.cfm" OR cgi.script_name EQ "/m7s/user_blog.cfm">
<cfelseif cgi.script_name EQ "/view_blog.cfm" OR cgi.script_name EQ "/m7s/view_blog.cfm">
<cfelseif cgi.script_name EQ "/forgot_password.cfm" OR cgi.script_name EQ "/m7s/forgot_password.cfm">
<cfelseif cgi.script_name EQ "/password_sent.cfm" OR cgi.script_name EQ "/m7s/password_sent.cfm">
<cfelseif cgi.script_name eq "/testimonials.cfm">
<cfelseif cgi.script_name EQ "/upload_user.cfm" OR cgi.script_name EQ "/m7s/upload_user.cfm">
<cfelseif cgi.script_name EQ "/contact_us.cfm" OR cgi.script_name EQ "/m7s/contact_us.cfm">
<cfelseif cgi.script_name EQ "/about_us.cfm" OR cgi.script_name EQ "/m7s/about_us.cfm">
<cfelseif cgi.script_name EQ "/news.cfm" OR cgi.script_name EQ "/m7s/news.cfm">
<cfelseif cgi.script_name EQ "/uc.cfm" OR cgi.script_name EQ "/m7s/news.cfm">
<cfelseif cgi.script_name EQ "/tos.cfm" OR cgi.script_name EQ "/m7s/tos.cfm">
<cfelseif cgi.script_name EQ "/faq.cfm" OR cgi.script_name EQ "/m7s/faq.cfm">
<cfelseif cgi.script_name EQ "/purchase.cfm" OR cgi.script_name EQ "/m7s/purchase.cfm">
<cfelseif cgi.script_name EQ "/cfm/status.cfc" OR cgi.script_name EQ "/m7s/cfm/status.cfc">
<cfelseif cgi.script_name EQ "/top_ten.cfm" OR cgi.script_name EQ "/m7s/top_ten.cfm">
<cfelseif cgi.script_name EQ "/test.cfm" OR cgi.script_name EQ "/m7s/top_ten.cfm">
<cfelseif cgi.script_name EQ "/EmbedPortfolioTransactions.cfc" OR cgi.script_name EQ "/HNH/top_ten.cfm">
<cfelseif cgi.script_name eq "google3e5569c7e3b5f5fd.html">
<cfelse>
<script>
parent.location = "register.cfm"
</script>
</cfif>
<cfelse>
<cfif find("/admin/", cgi.script_name) neq 0 and session.user_account_type less than 8>
<script>
parent.location = "../register.cfm"
</script>
</cfif>
</cfif>
</cfif>
 
Have you tried to just stop and start the ColdFusion service once a day (e.g. at 4am) we used to have the same issue, and that resolved it for us.

a shellscript and a cron job on Linux or a batch file and a windows scheduled task do the job perfectly, just run it in your sites low-traffic hours :)

We never fail, we just find that the path to succes is never quite what we thought...
 
We had an issue with CF server at one time. There was a memory leak if you had any querys that did a 'Select *'. The proper fix was to only select the fields you needed. I do not know if Adobe ever fixed the issue, and I do not know what version it was.
 
I think you might want to reconsider cleaning up some of this application.cfm code. Remember, it is called every time a cfm page runs. Couple suggestions:
1. do not ever store db username / password in variables.
2. there a ton of cfif statements. whyyyy? I would create a list or an array of available pages without login.
like
Code:
<cfset linksWithOutLogin = '/top_ten.cfm,/EmbedPortfolioTransactions,/resubmit_confirmation_email,...'>
<cfif ListFindNoCase(linksWithOutLogin, CGI.SCRIPT_NAME,",") NEQ 0>
 you can see these pages without login
<cfelse>
  <cflocation url="register.cfm" addtoken="false">
</cfif>

When the server bugs down, it could be because of many different reasons:
1.You could have memory leaks like kray mentioned.
2.You don't have enough memory, try to increase max heap size.
3.Too many visitors.
4.Bad code(?).




 
Ty to those who replied. The site is pretty new and we only had 30-40 members on at a time. I've switched web hosting companies after getting the run-around and everything's working perfectly now.

Falcon - ty for the tips. I'll be implementing them today. Do you recommend hard-coding database passwords into the code? It seems like it would be a pain if you ever changed your mysql server's password, although at second thought I guess if the password is pretty unique a find - replace would work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top