SlideShare a Scribd company logo
1 of 32
Running CF in a Shared and Dedicated Hosting Environment Tim Nettleton [email_address] “ You can’t say that I didn’t tell ya!” What I wish that I could tell every  customer before stuff happens.
Hosting Obstacles: ,[object Object],[object Object],[object Object],[object Object],Hosting Environment: ,[object Object],[object Object],[object Object],Goal: “ To provide a stable and flexible application platform for customers to experience success and grow through profitability toward ownership.” ,[object Object],[object Object]
Performance: CF Configurations Limit simultaneous requests: 15 Timeout Requests at 75 seconds Restart on 3 unresponsive requests Restart CFAS on abnormal termination Suppress whitespace Enforce Strict Attribute Validation Missing Template Handler and Default Error Handler are both empty? Tip:Stay away from ?RequestTimeout=1000000
Performance: Caching Settings Approx 2x total .cfm template pool. Trusted enabled for Production/Non-development environments. Client Variable Storage ,[object Object],[object Object],[object Object],Variables
Tip:   If you don’t use Client variables,  don’t make CF track them. Example code that creates unnecessary overhead: <CFAPPLICATION NAME=&quot;CF2001&quot; SESSIONMANAGEMENT=&quot;YES&quot; CLIENTMANAGEMENT=&quot;YES&quot;> Corrected code without Registry interaction: <CFAPPLICATION NAME=&quot;CF2001&quot; SESSIONMANAGEMENT=&quot;YES&quot; CLIENTMANAGEMENT=“NO&quot;> Performance:
Performance: Logging Settings Log Long Running Templates.  They provide an easy way To identify bottlenecks in code and database design. Any templates that typically runs more than 10-15 seconds will most likely lose a user’s attention and result in F5 or Alt+F4.
Performance: Databases and DSNs ,[object Object],[object Object],[object Object],[object Object],[object Object]
Performance: Databases and Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Performance: Databases and Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CFQUERYPARAM, CFPARAM, VAL(), explicit validation or CGI.HTTP_REFERER 1.) “SELECT COLUMN1 FROM TABLE WHERE ID=#VAL(ID)#” 2.)  “SELECT ….  WHERE ID= <CFQUERYPARAM  VALUE=&quot;#URL.ID#&quot;  CFSQLTYPE=&quot;CF_SQL_INTEGER&quot;>”   3.) <CFPARAM TYPE=“NUMERIC” NAME=“URL.ID” VALUE=“#URL.ID#”> Performance: Databases and Code Choosing the right database and reworking  malfunctioning code can offer the most immediate  Performance and Stability gain.
Performance: Code Bottlenecks ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Scalability: First, choose the right Database. Load Balancing Hardware or Software?  Sticky or Not? Why is sticky bad? It binds a particular user to an application server until the  session is terminated, thereby the primary goal of load balancing. How can you avoid sticky? Avoid all server specific memory resident variables.  Convert to Client  variables, cookies or a breed of URL identifiers.  Similar to CFID and  CFTOKEN sent in a CF URL. Note: Client variables will only take simple data.  No structures or queries  unless serialized for text storage.
Security: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],My favorites! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Security: Before After Unicode Hack .CFM, .DBM, .ASP, .ASA, etc.
Stability: Logs, logs and more logs? A thorough examination of the logs with a complete understanding  of what goes in ( code ) provides an insight of  “What Happened?!?” Hung Threads Long Running Templates Numeric Errors Catastrophic Errors Application Server restarts with Proximity TIP: Run CYCLE.BAT (in CFUSIONIN to  release an ODBC memory leak.
If  you have ever looked in the /cfusion/log/ directory you have probably  seen one or more of the many Cold Fusion generated error/information logs. These text files can easily grow to hundreds of MB and contain the best indicators of 'what happened'.  As with any other service or application, regular review of system logs should be part of normal administration.  Unfortunately, because of their large size and the fact that the data is segmented into so many logs, it is difficult to get a complete picture of performance, problems, and failure. Developers who work on a dedicated server can use the Cold Fusion Administrator to view these logs.  This can be accomplished clicking on &quot;Log Files&quot; and then downloading the entire log via a browser.  Unfortunately, this is usually not possible given the size of most logs and remote connection speed. For shared developers, the critical information is unavailable due to the nature of the shared environment and security.  In most cases, a developer only knows what a site user tells them or what they trap using CFTRY/CFCATCH and CFERROR.  Even with these mechanisms in place, the larger picture is unavailable and the majority of performance issues go unnoticed and unattended. COSMOS
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],COSMOS
General Application Error Listing  -Application errors are the best view into the progress and developmental completeness of a site.  A well-coded site generates no application errors.  This listing provides a top down view of the most recent Application errors for all IIS Roots.  By clicking on the error message on the right, a popup window displays the error message as displayed to a site visitor.  COSMOS
General Missing Template  - This applies to all .cfm templates requested by the web server but not found.  In most cases, the developer doesn't even know that people are getting &quot; 404 File Not Found &quot; messages.  If a search engine indexes your site or a user bookmarks a page, a change in the site causes missed business.  The solution is to use the Default Missing Template Handler in Cold Fusion Administrator or to add a  CFERROR TYPE=&quot;REQUEST&quot;   in your site's Application.cfm. COSMOS
Long Running Template Listing  -This applies to the processing time for pages that take longer than expected.  The determination of how long is too long is configured in the Logging/Settings section of Cold Fusion Administrator.  A typical setting is 45 seconds, though anything taking that long would most likely be canceled or ignored by the calling client.  In addition, a script running for 45 seconds could help identify a performance bottleneck for the Application Server.  COSMOS
Undeliverable CFMAIL Listing  - When Cold Fusion is unable to deliver a message, the original template is renamed and filed in the /cfusion/mail/undelivr/ directory.  An error message is also written to the Mail.log or Error.log that describes the problem preventing proper delivery.  This listing brings those two pieces of information together by clicking on the message at right.  The following popup allows a user to correct and resend the message from their server.  This function is indispensable for any business that relies on  CFMAIL  to reliably carry email and cannot accept undeliverable messages. COSMOS
Hung Thread Listing  - Probably the greatest indicator of a performance problem. Hung Threads are Cold Fusion's method of alerting us that it was unable to completely process the requested template.  This is usually the result of code or database issues.  CF4.x and above has an option in the Administrator to have CF &quot; Restart at n unresponsive requests &quot;.  Hung Threads  directly relate to the operation of the Application server.  When the Hung Thread count matches the defined threshold, Cold Fusion reaches a critical point, and will stop/restart itself to avoid excessive down time.  Constant examination of Hung Threads is necessary to avoid Application Server failure. COSMOS
Scheduled Task Listing  - Most scheduled tasks run completely unnoticed until someone realizes that a critical function has not processed in days.  This listing is not much to look at but, under the hood, a huge modification and improvement has been created for the Executive Service. COSMOS  can determine if your task started, succeeded, or failed.  It will also allow you to define a target string in the page HTML and record the generated content from the target URL to the database.  If a scheduled task does not return the defined string, an email containing the content and diagnostics can be generated at the time of failure OR a VoiceXML application can call you with the news. COSMOS
Aggregation and Stratification More commonly called a  GROUPING , the next series of graphs were created to help identify the greatest problems quickly.  By examining the data based on Time, Date, and IIS Root, we can gather a greater understanding of where faults exist.  COSMOS
Application Errors Stratified by Date COSMOS
Time/Error graph   - Especially useful in determining if your day is getting better or worse, this graph breaks down the servers errors by 10 minute increments over a selectable date span.  This is often used to diagnose a recurring failure point over a multiple day or week period.  COSMOS
Long Running Template Aggregation by IIS Root  - Similar to the previous Root Aggregations, this has several prominent exceptions.  Because a Long Running Page has a value associated with the processing time, I have included a column for the  Sum  and  Average  values.  Using this display, it is possible to extract the templates most often run beyond acceptable limits, demanding the greatest processing time.  This affects performance, though not necessarily a failure, and is a fantastic indicator of templates that need to be addressed  Before  they become a stability issue.  COSMOS
Hung Thread Aggregation by IIS Root  - This graph will often tell which application is responsible for killing the server.  Over a selectable data span, one can easily see which sites are causing CF to lose resources.  COSMOS Hung Threads=Bad Puppies=Good
One Final Look So when did your Application Server last crash and why?   Event Chronology  - The first view that brings together data from multiple sources.  This report provides a chronological view of all Application Errors, Hung Threads, Long Running Templates, and Application server failures.  This information threads events based on time in order to provide a trace leading up to a failure.  COSMOS
Spectral Analysis  - This graph is unique because it rapidly identifies problems that would otherwise slip under the wire.  The three colors representing CF stops (red), starts (green) and Hung threads (purple) are graphed relative to a 24-hour time line.  COSMOS
What now? Read your errors and understand them. Always look for a better solution:code and database. Find people that can help when you get stuck Never give up Get on all related security mailings
Running CF in a Shared and Dedicated Hosting Environment Tim Nettleton [email_address] “ You can’t say that I didn’t tell ya!” ,[object Object],[object Object],[object Object],“ And then the aliens came…………………”

More Related Content

What's hot

How to install Microsoft Dynamics CRM 2011
How to install Microsoft Dynamics CRM 2011How to install Microsoft Dynamics CRM 2011
How to install Microsoft Dynamics CRM 2011ashrawi92
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A StudyVijay Prasad Gupta
 
Apache logs monitoring
Apache logs monitoringApache logs monitoring
Apache logs monitoringUmair Amjad
 
Online Bank Hack
Online Bank HackOnline Bank Hack
Online Bank HackCaleb Sima
 
Web Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedWeb Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedPort80 Software
 
Citrix Store front planning guide
Citrix Store front planning guideCitrix Store front planning guide
Citrix Store front planning guideNuno Alves
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0Dima Maleev
 
Citrix StoreFront - Implementation Guide
Citrix StoreFront - Implementation GuideCitrix StoreFront - Implementation Guide
Citrix StoreFront - Implementation GuideNuno Alves
 
9 Most Common HTTP Errors Explained
 9 Most Common HTTP Errors Explained 9 Most Common HTTP Errors Explained
9 Most Common HTTP Errors ExplainedAmit Kute
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniquesguest8899ec02
 
Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622Banking at Ho Chi Minh city
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesOrtus Solutions, Corp
 

What's hot (20)

How to install Microsoft Dynamics CRM 2011
How to install Microsoft Dynamics CRM 2011How to install Microsoft Dynamics CRM 2011
How to install Microsoft Dynamics CRM 2011
 
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
2009 - Microsoft IIS Vs. Apache - Who Serves More - A Study
 
Apache logs monitoring
Apache logs monitoringApache logs monitoring
Apache logs monitoring
 
Apache error
Apache errorApache error
Apache error
 
Online Bank Hack
Online Bank HackOnline Bank Hack
Online Bank Hack
 
Web Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting StartedWeb Server Technologies I: HTTP & Getting Started
Web Server Technologies I: HTTP & Getting Started
 
Securing applications
Securing applicationsSecuring applications
Securing applications
 
Citrix Store front planning guide
Citrix Store front planning guideCitrix Store front planning guide
Citrix Store front planning guide
 
I3 - for Web & J2EE
I3 - for Web & J2EEI3 - for Web & J2EE
I3 - for Web & J2EE
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
 
ColdFusion Internals
ColdFusion InternalsColdFusion Internals
ColdFusion Internals
 
Citrix StoreFront - Implementation Guide
Citrix StoreFront - Implementation GuideCitrix StoreFront - Implementation Guide
Citrix StoreFront - Implementation Guide
 
Microsoft Azure
Microsoft AzureMicrosoft Azure
Microsoft Azure
 
9 Most Common HTTP Errors Explained
 9 Most Common HTTP Errors Explained 9 Most Common HTTP Errors Explained
9 Most Common HTTP Errors Explained
 
Opr089 xx
Opr089 xxOpr089 xx
Opr089 xx
 
Web Server-Side Programming Techniques
Web Server-Side Programming TechniquesWeb Server-Side Programming Techniques
Web Server-Side Programming Techniques
 
Quickr
QuickrQuickr
Quickr
 
Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622Ibm tivoli access manager for e business tracing http connections redp4622
Ibm tivoli access manager for e business tracing http connections redp4622
 
ITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul ServicesITB2016 - Building ColdFusion RESTFul Services
ITB2016 - Building ColdFusion RESTFul Services
 
Apache web server
Apache web serverApache web server
Apache web server
 

Viewers also liked

Viewers also liked (11)

Create your on personal website - PowerPoint Presentation
Create your on personal website - PowerPoint PresentationCreate your on personal website - PowerPoint Presentation
Create your on personal website - PowerPoint Presentation
 
IMPORTANCE OF HAVING A WEBSITE PRESENTATION
IMPORTANCE OF HAVING A WEBSITE PRESENTATIONIMPORTANCE OF HAVING A WEBSITE PRESENTATION
IMPORTANCE OF HAVING A WEBSITE PRESENTATION
 
Web based media
Web based mediaWeb based media
Web based media
 
Peak Performance Trail Maps
Peak Performance Trail MapsPeak Performance Trail Maps
Peak Performance Trail Maps
 
What is website? Why You Need it?
What is website? Why You Need it?What is website? Why You Need it?
What is website? Why You Need it?
 
Need and importance of website, educational CD's& learning Module
Need and importance of website, educational CD's& learning ModuleNeed and importance of website, educational CD's& learning Module
Need and importance of website, educational CD's& learning Module
 
New Media vs. Traditional Media
New Media vs. Traditional MediaNew Media vs. Traditional Media
New Media vs. Traditional Media
 
Introduction to New Media
Introduction to New MediaIntroduction to New Media
Introduction to New Media
 
New Media Vs Traditional Media
New Media Vs Traditional MediaNew Media Vs Traditional Media
New Media Vs Traditional Media
 
Old Media vs. New Media
Old Media vs. New MediaOld Media vs. New Media
Old Media vs. New Media
 
Old Media vs. New Media
Old Media vs. New MediaOld Media vs. New Media
Old Media vs. New Media
 

Similar to "Running CF in a Shared Hosting Environment"

BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...
BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...
BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...Martijn de Jong
 
KACE Agent Architecture and Troubleshooting Overview
KACE Agent Architecture and Troubleshooting OverviewKACE Agent Architecture and Troubleshooting Overview
KACE Agent Architecture and Troubleshooting OverviewDell World
 
EMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingEMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingHaytham Ghandour
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And ScalabilityJason Ragsdale
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Coldfusion
ColdfusionColdfusion
ColdfusionRam
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Robert MacLean
 
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Niels de Bruijn
 
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017AgileNZ Conference
 
Dev ops 2016 dockerizing the it
Dev ops 2016 dockerizing the itDev ops 2016 dockerizing the it
Dev ops 2016 dockerizing the itDeveo
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectorsrtretola
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...MongoDB
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeMatt Ray
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...ColdFusionConference
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Shailendra Prasad
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hostingwebhostingguy
 

Similar to "Running CF in a Shared Hosting Environment" (20)

BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...
BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...
BP101 - 10 Things to Consider when Developing & Deploying Applications in Lar...
 
KACE Agent Architecture and Troubleshooting Overview
KACE Agent Architecture and Troubleshooting OverviewKACE Agent Architecture and Troubleshooting Overview
KACE Agent Architecture and Troubleshooting Overview
 
EMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x TroubleshootingEMC Documentum - xCP 2.x Troubleshooting
EMC Documentum - xCP 2.x Troubleshooting
 
Microsoft Lync Server 2010 Installation
Microsoft Lync Server 2010 InstallationMicrosoft Lync Server 2010 Installation
Microsoft Lync Server 2010 Installation
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Coldfusion
ColdfusionColdfusion
Coldfusion
 
Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?Windows Server AppFabric Caching - What it is & when you should use it?
Windows Server AppFabric Caching - What it is & when you should use it?
 
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
 
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017
DevSec Delight with Compliance as Code - Matt Ray - AgileNZ 2017
 
Dev ops 2016 dockerizing the it
Dev ops 2016 dockerizing the itDev ops 2016 dockerizing the it
Dev ops 2016 dockerizing the it
 
Web Security
Web SecurityWeb Security
Web Security
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Isset Presentation @ EECI2009
Isset Presentation @ EECI2009Isset Presentation @ EECI2009
Isset Presentation @ EECI2009
 
New Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP ConnectorsNew Flash Builder 4 WSDL and HTTP Connectors
New Flash Builder 4 WSDL and HTTP Connectors
 
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
 
Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...Developing High Performance and Scalable ColdFusion Application Using Terraco...
Developing High Performance and Scalable ColdFusion Application Using Terraco...
 
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...Developing High Performance and Scalable ColdFusion Applications Using Terrac...
Developing High Performance and Scalable ColdFusion Applications Using Terrac...
 
Apache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual HostingApache web server installation/configuration, Virtual Hosting
Apache web server installation/configuration, Virtual Hosting
 

More from webhostingguy

Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Frameworkwebhostingguy
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guidewebhostingguy
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3webhostingguy
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serverswebhostingguy
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidationwebhostingguy
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreementwebhostingguy
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...webhostingguy
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...webhostingguy
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructurewebhostingguy
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.pptwebhostingguy
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy webhostingguy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandiserswebhostingguy
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Productswebhostingguy
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mbwebhostingguy
 

More from webhostingguy (20)

File Upload
File UploadFile Upload
File Upload
 
Running and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test FrameworkRunning and Developing Tests with the Apache::Test Framework
Running and Developing Tests with the Apache::Test Framework
 
MySQL and memcached Guide
MySQL and memcached GuideMySQL and memcached Guide
MySQL and memcached Guide
 
Novell® iChain® 2.3
Novell® iChain® 2.3Novell® iChain® 2.3
Novell® iChain® 2.3
 
Load-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web serversLoad-balancing web servers Load-balancing web servers
Load-balancing web servers Load-balancing web servers
 
SQL Server 2008 Consolidation
SQL Server 2008 ConsolidationSQL Server 2008 Consolidation
SQL Server 2008 Consolidation
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
What is mod_perl?
What is mod_perl?What is mod_perl?
What is mod_perl?
 
Master Service Agreement
Master Service AgreementMaster Service Agreement
Master Service Agreement
 
Notes8
Notes8Notes8
Notes8
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...Dell Reference Architecture Guide Deploying Microsoft® SQL ...
Dell Reference Architecture Guide Deploying Microsoft® SQL ...
 
Managing Diverse IT Infrastructure
Managing Diverse IT InfrastructureManaging Diverse IT Infrastructure
Managing Diverse IT Infrastructure
 
Web design for business.ppt
Web design for business.pptWeb design for business.ppt
Web design for business.ppt
 
IT Power Management Strategy
IT Power Management Strategy IT Power Management Strategy
IT Power Management Strategy
 
Excel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for MerchandisersExcel and SQL Quick Tricks for Merchandisers
Excel and SQL Quick Tricks for Merchandisers
 
OLUG_xen.ppt
OLUG_xen.pptOLUG_xen.ppt
OLUG_xen.ppt
 
Parallels Hosting Products
Parallels Hosting ProductsParallels Hosting Products
Parallels Hosting Products
 
Microsoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 MbMicrosoft PowerPoint presentation 2.175 Mb
Microsoft PowerPoint presentation 2.175 Mb
 
Reseller's Guide
Reseller's GuideReseller's Guide
Reseller's Guide
 

"Running CF in a Shared Hosting Environment"

  • 1. Running CF in a Shared and Dedicated Hosting Environment Tim Nettleton [email_address] “ You can’t say that I didn’t tell ya!” What I wish that I could tell every customer before stuff happens.
  • 2.
  • 3. Performance: CF Configurations Limit simultaneous requests: 15 Timeout Requests at 75 seconds Restart on 3 unresponsive requests Restart CFAS on abnormal termination Suppress whitespace Enforce Strict Attribute Validation Missing Template Handler and Default Error Handler are both empty? Tip:Stay away from ?RequestTimeout=1000000
  • 4.
  • 5. Tip: If you don’t use Client variables, don’t make CF track them. Example code that creates unnecessary overhead: <CFAPPLICATION NAME=&quot;CF2001&quot; SESSIONMANAGEMENT=&quot;YES&quot; CLIENTMANAGEMENT=&quot;YES&quot;> Corrected code without Registry interaction: <CFAPPLICATION NAME=&quot;CF2001&quot; SESSIONMANAGEMENT=&quot;YES&quot; CLIENTMANAGEMENT=“NO&quot;> Performance:
  • 6. Performance: Logging Settings Log Long Running Templates. They provide an easy way To identify bottlenecks in code and database design. Any templates that typically runs more than 10-15 seconds will most likely lose a user’s attention and result in F5 or Alt+F4.
  • 7.
  • 8.
  • 9.
  • 10. CFQUERYPARAM, CFPARAM, VAL(), explicit validation or CGI.HTTP_REFERER 1.) “SELECT COLUMN1 FROM TABLE WHERE ID=#VAL(ID)#” 2.) “SELECT …. WHERE ID= <CFQUERYPARAM VALUE=&quot;#URL.ID#&quot; CFSQLTYPE=&quot;CF_SQL_INTEGER&quot;>” 3.) <CFPARAM TYPE=“NUMERIC” NAME=“URL.ID” VALUE=“#URL.ID#”> Performance: Databases and Code Choosing the right database and reworking malfunctioning code can offer the most immediate Performance and Stability gain.
  • 11.
  • 12. Scalability: First, choose the right Database. Load Balancing Hardware or Software? Sticky or Not? Why is sticky bad? It binds a particular user to an application server until the session is terminated, thereby the primary goal of load balancing. How can you avoid sticky? Avoid all server specific memory resident variables. Convert to Client variables, cookies or a breed of URL identifiers. Similar to CFID and CFTOKEN sent in a CF URL. Note: Client variables will only take simple data. No structures or queries unless serialized for text storage.
  • 13.
  • 14. Security: Before After Unicode Hack .CFM, .DBM, .ASP, .ASA, etc.
  • 15. Stability: Logs, logs and more logs? A thorough examination of the logs with a complete understanding of what goes in ( code ) provides an insight of “What Happened?!?” Hung Threads Long Running Templates Numeric Errors Catastrophic Errors Application Server restarts with Proximity TIP: Run CYCLE.BAT (in CFUSIONIN to release an ODBC memory leak.
  • 16. If you have ever looked in the /cfusion/log/ directory you have probably seen one or more of the many Cold Fusion generated error/information logs. These text files can easily grow to hundreds of MB and contain the best indicators of 'what happened'. As with any other service or application, regular review of system logs should be part of normal administration. Unfortunately, because of their large size and the fact that the data is segmented into so many logs, it is difficult to get a complete picture of performance, problems, and failure. Developers who work on a dedicated server can use the Cold Fusion Administrator to view these logs. This can be accomplished clicking on &quot;Log Files&quot; and then downloading the entire log via a browser. Unfortunately, this is usually not possible given the size of most logs and remote connection speed. For shared developers, the critical information is unavailable due to the nature of the shared environment and security. In most cases, a developer only knows what a site user tells them or what they trap using CFTRY/CFCATCH and CFERROR. Even with these mechanisms in place, the larger picture is unavailable and the majority of performance issues go unnoticed and unattended. COSMOS
  • 17.
  • 18. General Application Error Listing -Application errors are the best view into the progress and developmental completeness of a site. A well-coded site generates no application errors. This listing provides a top down view of the most recent Application errors for all IIS Roots. By clicking on the error message on the right, a popup window displays the error message as displayed to a site visitor. COSMOS
  • 19. General Missing Template - This applies to all .cfm templates requested by the web server but not found. In most cases, the developer doesn't even know that people are getting &quot; 404 File Not Found &quot; messages. If a search engine indexes your site or a user bookmarks a page, a change in the site causes missed business. The solution is to use the Default Missing Template Handler in Cold Fusion Administrator or to add a CFERROR TYPE=&quot;REQUEST&quot; in your site's Application.cfm. COSMOS
  • 20. Long Running Template Listing -This applies to the processing time for pages that take longer than expected. The determination of how long is too long is configured in the Logging/Settings section of Cold Fusion Administrator. A typical setting is 45 seconds, though anything taking that long would most likely be canceled or ignored by the calling client. In addition, a script running for 45 seconds could help identify a performance bottleneck for the Application Server. COSMOS
  • 21. Undeliverable CFMAIL Listing - When Cold Fusion is unable to deliver a message, the original template is renamed and filed in the /cfusion/mail/undelivr/ directory. An error message is also written to the Mail.log or Error.log that describes the problem preventing proper delivery. This listing brings those two pieces of information together by clicking on the message at right. The following popup allows a user to correct and resend the message from their server. This function is indispensable for any business that relies on CFMAIL to reliably carry email and cannot accept undeliverable messages. COSMOS
  • 22. Hung Thread Listing - Probably the greatest indicator of a performance problem. Hung Threads are Cold Fusion's method of alerting us that it was unable to completely process the requested template. This is usually the result of code or database issues. CF4.x and above has an option in the Administrator to have CF &quot; Restart at n unresponsive requests &quot;. Hung Threads directly relate to the operation of the Application server. When the Hung Thread count matches the defined threshold, Cold Fusion reaches a critical point, and will stop/restart itself to avoid excessive down time. Constant examination of Hung Threads is necessary to avoid Application Server failure. COSMOS
  • 23. Scheduled Task Listing - Most scheduled tasks run completely unnoticed until someone realizes that a critical function has not processed in days. This listing is not much to look at but, under the hood, a huge modification and improvement has been created for the Executive Service. COSMOS can determine if your task started, succeeded, or failed. It will also allow you to define a target string in the page HTML and record the generated content from the target URL to the database. If a scheduled task does not return the defined string, an email containing the content and diagnostics can be generated at the time of failure OR a VoiceXML application can call you with the news. COSMOS
  • 24. Aggregation and Stratification More commonly called a GROUPING , the next series of graphs were created to help identify the greatest problems quickly. By examining the data based on Time, Date, and IIS Root, we can gather a greater understanding of where faults exist. COSMOS
  • 26. Time/Error graph - Especially useful in determining if your day is getting better or worse, this graph breaks down the servers errors by 10 minute increments over a selectable date span. This is often used to diagnose a recurring failure point over a multiple day or week period. COSMOS
  • 27. Long Running Template Aggregation by IIS Root - Similar to the previous Root Aggregations, this has several prominent exceptions. Because a Long Running Page has a value associated with the processing time, I have included a column for the Sum and Average values. Using this display, it is possible to extract the templates most often run beyond acceptable limits, demanding the greatest processing time. This affects performance, though not necessarily a failure, and is a fantastic indicator of templates that need to be addressed Before they become a stability issue. COSMOS
  • 28. Hung Thread Aggregation by IIS Root - This graph will often tell which application is responsible for killing the server. Over a selectable data span, one can easily see which sites are causing CF to lose resources. COSMOS Hung Threads=Bad Puppies=Good
  • 29. One Final Look So when did your Application Server last crash and why? Event Chronology - The first view that brings together data from multiple sources. This report provides a chronological view of all Application Errors, Hung Threads, Long Running Templates, and Application server failures. This information threads events based on time in order to provide a trace leading up to a failure. COSMOS
  • 30. Spectral Analysis - This graph is unique because it rapidly identifies problems that would otherwise slip under the wire. The three colors representing CF stops (red), starts (green) and Hung threads (purple) are graphed relative to a 24-hour time line. COSMOS
  • 31. What now? Read your errors and understand them. Always look for a better solution:code and database. Find people that can help when you get stuck Never give up Get on all related security mailings
  • 32.

Editor's Notes

  1. thousands of lines of customer code. My task, figure out why the code is failing and provide an alternative route. Into each equation Server OS, Application, configuration, Network and Database next 60 minutes all the little things before it was too late.
  2. What is the Hosted Environment? All customers who seek to learn, test, run an application, run a business.
  3. Over the next 45 minutes, I will show you a system based on an experience. An experience that begins and ends with you. A little over 3 years ago, I discovered Cold Fusion. Through the shared environment, I tested the language and myself to accomplish something ever greater. I learned the hard way, through failure time and time again. Like most, I pushed my limits alone, to overcome each successive problem with study, research and trial-and-error. Through this experience, I came to believe in the need for a tool of enablement. Over the next 45 minutes, I am going to show you what excites me. Along the way, I am going to show you COSMOS.
  4. Some documentation directs to allocate 1.5, while others say 4-5x. If you can spare the RAM go All the way! Trusted cache will tell CF to avoid checking the Date Last Modified on the Requested file when retrieving from cache.
  5. Many CF manuals pair SESSIONMANAGEMENT with CLIENTMANAGEMENT though the two are not dependant. Every time your site users request templates, CF is forced to update several values in the registry.
  6. Hacking.