• No results found

Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist

N/A
N/A
Protected

Academic year: 2021

Share "Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist"

Copied!
29
0
0

Loading.... (view fulltext now)

Full text

(1)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Architecting ColdFusion For

Scalability And High Availability

Ryan Stewart

(2)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Introduction

Architecture & Clustering Options

Design an architecture and develop applications that scale linearly across multiple servers and handles failures gracefully.

Performance Oriented Development

Getting the most out of a single server by optimizing your application code.

Performance Tuning

ColdFusion server tuning and load testing.

Monitoring

(3)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Scalability

≠ High Availability

 Scalability - applications and architecture that will allow you to linearly

add servers and take on an increasing number of users.

(4)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Web server clustering

 Round Robin DNS, Hardware, Software

 ColdFusion Clustering (Application Level)

 Clustered instances, Connector clustering, session replication

 Database Server Clustering

 Database Specific

(5)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Create ColdFusion instances

 Cluster the instances

 Enable J2EE Sessions

 Connect your web server to the cluster

 Deploy your application

 Test

ColdFusion Clustering – simple example

Single Server Example

connector

CF Instance 1

CF Instance 2

Cluster Web server

(6)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 ColdFusion J2EE installation is needed

 Using the cfusion instance on port 8300 create your instances

(7)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Create instance on the same server

 Register remote instances

(8)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Cluster the Instances

 Enable J2EE Sessions

(9)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 After enabling session replication you will need to enable J2EE session

variables within the ColdFusion admin.

 Uses jsessionid in addition to CFID and CFTOKEN

(10)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 ColdFusion web server connector clustering

 JRun Webserver Connector allows a webserver to communicate with

JRun, runs as a filter or plugin in the webserver

 Cluster by connecting multiple instances of ColdFusion to a single

webserver with the JRun Webserver Configuration Tool

 Load balancing and Failover built in to the connector

 Connector load balancing algorithms

(round-robin, weighted round-robin, weighted random)

(11)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 JRun web server connector clustering

 Use wsconfig to connect your webserver to the cluster

(12)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Test sticky sessions

 Test failover

 Test session replication

 Identify which server is fulfilling your request

ColdFusion Clustering – Testing

<cfif not isdefined("application.jrunInstanceName")>

<cfobject action="create" type="java" class="jrunx.kernel.JRun" name="jr"> <cfset application.jrunInstanceName = jr.getServerName()>

(13)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Two or more web servers that support one or more domains are

grouped together as a cluster of servers

 Use Load balancing scheme to manage increases in load using

round-robin DNS or a hardware device

 Failover is used to protect against web server failures, implemented

using a hardware or software solution

Web Server Clustering - Overview

Web Server A Web Server B Web Server B Web Server Clustering Web Server Clustering CF Server A CF Server B Web Container Web Container Web ContainerServerJ2EE

Web ContainerServerJ2EE

(14)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Common hardware options

 F5 Big IP

 Cisco CSS (new ver Cisco ACE)

 Advantages

 Highly scalable

 Support probes

 Disadvantages

 Cost

 Can be difficult to configure

 Links

 CSS with CF -http://www.adobe.com/devnet/coldfusion/articles/css_multi.html

 F5 Big IP -http://www.adobe.com/devnet/coldfusion/j2ee/articles/balancing_j2ee.html

(15)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Windows Network Load Balancing (NLB)

 HAProxy (Unix only)

 http://www.37signals.com/svn/posts/1073-nuts-bolts-haproxy

 Speed. It’s really, really fast.

 It’s efficient. One of our instances is handling around 700 requests per second and using less than 5% CPU and only around 40MB of RAM on the Xen instance that it’s running on.

 It allows us to make configuration changes gracefully, without breaking any existing connections.

(16)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Two server cluster with DNS round robin and CF cluster

 DNS Round robin handles distribution of load

 ColdFusion is clustered across two servers, session replication can be

enabled or disabled depending on needs.

 No web server failover but ColdFusion instances can be shutdown for

maintenance

Clustering Examples

www1.site.com Web Server A Web Server B Web Container Web Container Web ContainerServerCF Web ContainerServerCF www2.site.com Round Robin DNS www.site.com

(17)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Two server cluster with software load balancing

 NLB or software solution handles web server load balancing and failover

 ColdFusion does not need to be clustered unless session replication is

needed.  http://www.adobe.com/devnet/coldfusion/articles/nlb_failover.html

Clustering Examples

Web Server A Web Server B Web Container Web Container Web ContainerServer BCF Web ContainerServer ACF Windows NLB software solution NLB Web Server A Web Server B Web Container Web Container Web ContainerServer BCF Web ContainerServer ACF HAProxy software solution Web ContainerWeb ContainerHAProxyServer

(18)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Two server cluster with hardware load balancing

 Hardware solution handles web server load balancing and failover

 ColdFusion does not need to be clustered unless session replication is

needed.

Clustering Examples

Web Server A Web Server B Web Container Web Container Web ContainerServer BCF Web ContainerServer ACF Hardware solution With CF clustering Web ContainerWeb Container CSS Or BigIP Web Server A Web Server B Web Container Web Container Web ContainerServer BCF Web ContainerServer ACF Hardware solution Without CF clustering Web ContainerWeb Container CSS Or BigIP

(19)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 If a failure occurs with a cluster member what do your users

experience?

 Handling user persistence across the cluster

 Session replication

 Creating your own persistence mechanism

Improving Availability

(20)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Create a robust architecture in a cloud environment with the ability to

add on demand servers. Do it without purchasing a single piece of hardware.

 Amazon Web services

 Ec2- Elastic Computing Cloud  S3 - Simple Storage Service

 Third party companies make it easier to get started on the cloud

 RightScale - deploy & scale applications in a turnkey architecture  Stax.net - develop & deploy

 Deployment

 Apache with Tomcat or JBoss  MySQL

 Archive ColdFusion Applications as a J2EE Archive

Clustering in the Clouds

(21)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

(22)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Identifying, isolating and fixing bottlenecks during development

 Load testing features or specific areas during development

 Tuning Process

 Measuring Performance

 Focus on single user baseline performance  Load test for multi user performance

 What are the tunable  Application Code  ColdFusion settings

 Application server/JVM settings  Web Server/OS Settings

(23)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Single user testing

 Bottleneck testing and isolation with ColdFusion debugging  GetTickCount, CFTIMER

 Load Testing

 Small test scripts, no wait time

 Free tools available (OpenSTA, WebStress, ApacheBench)  Run single user tests within your browser during load tests

 Common areas to improve in your code

 Database queries  External Calls

 Caching (content & queries) - CF_Accelerate

Testing During Development

(24)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

ColdFusion Settings

 Simultaneous thread or active handler threads

 Template cache size

 Query cache size

 Trusted cache

Application Server settings

 JVM settings

 Garbage collection

 OS Specific tuning

(25)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 JRun metrics  JVM Output  Network Monitoring  Disk IO monitoring  CPU monitoring  ColdFusion 8 Monitor

 Third party tools

 Fusion Reactor  See Fusion

 Database monitoring

 Profile in real time and identify queries by execution time and CPU time.

Monitoring Performance

(26)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Performance Monitoring in Production

 CF8 Monitor  See Fusion

(27)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Monitoring Production Servers

 ColdFusion probes – Debugging & Logging -> System Probes  Third party monitoring products (Nagios - open source)

(28)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

Architecture & Clustering Options

Design an architecture and develop applications that scale linearly across multiple servers and handles failures gracefully.

Performance Oriented Development

Getting the most out of a single server by optimizing your application code.

Performance Tuning

ColdFusion server tuning and load testing.

Monitoring

Tools and approaches for monitoring

(29)

®

Copyright 2008 Adobe Systems Incorporated. All rights reserved.

 Questions

References

Related documents

Sometimes the squirting will be the end of the Yoni Massage because it’s quite a peak and it is common for some women to experience a slight burning sensation inside their vagina

Old Habit: Paper CRF Process Primary Investigator Source Document CRC CRFs CRFs DB1 Double Data Entry Master Clinical 6 Query Report Form Site Sponsor Query Report Form CDM

One of the most significant decisions faced by a foreign real estate purchaser is how to take title. The choices include: ownership in one’s individual name or with one’s spouse

The exact estimation of quantization effects requires numerical simulation and is not amenable to exact analytical methods.. But an approach that has proven useful is to treat

◆ Guidelines for planning, implementing, and reviewing a comprehensive maintenance training program ◆ Easy-to-use techniques for improving your “Maintenance IQ” and your value to

New employees are classified Trainees until they have completed the training academy and pass a fire department physical.. They subsequently will be reclassified

Wearing of suitable protect- ive equipment (including personal protective equipment referred to under Section 8 of the safety data sheet) to pre- vent any contamination of skin,

Summary statistics for all relevant data elements (e.g., non-procedural and procedural time, QMP and staff time, intensity, total work values, service mix, number of patients