+ All Categories
Home > Software > 2014 cf summit_clustering

2014 cf summit_clustering

Date post: 26-Jun-2015
Category:
Upload: coldfusionconference
View: 1,314 times
Download: 1 times
Share this document with a friend
Description:
ColdFusion Clustering
Popular Tags:
40
© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. © 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. The More the Merrier, Clustering in ColdFusion Elishia Dvorak | ColdFusion Solution Consultant & Evangelist Nimit Sharma | Software Engineer, ColdFusion
Transcript
Page 1: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

The More the Merrier, Clustering in ColdFusionElishia Dvorak | ColdFusion Solution Consultant & Evangelist

Nimit Sharma | Software Engineer, ColdFusion

Page 2: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Agenda

Different ways of clustering in ColdFusion Vertical Horizontal Distributed

Load Balancing

Failover & Session Management

2

Page 3: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Why Cluster?

High Availability/Failover

Redundancy

3

Page 4: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Clustering in ColdFusion

JEE Clustering Mechanism in Tomcat Peer to peer at the instance level

Will not provide failover for your web server Will need HWLB or use of built-in failover for web server

ie. IIS failover via Microsoft Network Load Balancing (NLB)

4

Page 5: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Types of Clustering

Vertical Cluster “Scale Up”

Multiple instances on same box Increased efficiency Greatest utilization of hardware resources Manageability Most cost-effective Protection against software failover

(localized redundancy) Implications for hardware failure

5

Page 6: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 6

Page 7: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 7

Page 8: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 8

DemoSetting Up a Vertical Cluster

Page 9: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Types of Clustering

Horizontal Cluster “Scale Out” Clustered across different physical or virtual servers

Protects against hardware failures Not most cost-effective solution Effective management of workloads

May be most effective if you have an application that can run efficiently on limited hardware The most common solution typically involves a hybrid vertical + horizontal solution (scale up

then out)

9

CF1

CF2

CF3

CF4

CF5

Web1

Web2

Web3

Web4

Web5

Page 10: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 10

Instance Manager ->Register Remote Instance

Default 8985/8987 (in jetty.xml)

Must be unique for session affinity

Weighted round robin

Page 11: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 11

DemoSetting Up a Horizontal ColdFusion Cluster

Page 12: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Clustering in ColdFusion

12

A A AB B BC C C

Page 13: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Distributed Architecture

Web server resides on a separate server than ColdFusion Security Scalability Redundant & Independent

Three-Tier Architecture Tier 1: Web Server Tier 2: Application Server (ColdFusion) Tier 3: Data

13

Page 14: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 14

DemoDistributed Architecture

Page 15: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Where is all this stored?

Web Server Configuration Utility: CF_Install_Dir/cfusion/runtime/bin Connector Config: CF_Install_Dir/config/

cluster.xml: Stores info about the cluster, including multicast port Instances.xml: Stores info about the instances and where they are located In /config/wsconfig/n/ - config files for connector, logs

Isapi_redirect.properties workers.properties

\CF_Install_dir\cfusion\jetty\etc\jetty.xml: Admin component ports \instance_name\runtime\conf\server.xml: stores port/connector info for server

instances AJP Port Connector Port for Built-In Web Server Web root for Built-In Web Server, context path

15

Page 16: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Consideration for architecture

Code Maintenance

Maintaining multiple copies of the shared assets

Requires replication mechanism to keep shared assets up to date

Always possibility of something getting out of sync

Using NAS (Network Attached Storage) device

Centrally located

Still need failover mechanism

Possibility of latency

16

Page 17: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Load Balancing & Failover

Load balancer For distribution of load and failover across web server level Allows proxy based distribution of traffic across multiple servers Hardware or Software Based Example: F5 Big-IP

ColdFusion Offers Load balancing via round robin (at instance level) Failover (at instance level) - Requires session replication, or alternative to maintain session at failover

Session Management Options: Server Affinity / Sticky Sessions (J2EE sessions must be enabled) Session Replication (J2EE sessions must be enabled) Distributed Caching Client Variables

17

Page 18: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Troubleshooting

Verbose Connector Logging Isapi_redirect.properties Set log_level= debug

Log files Isapi_redirect.log

Ensure ports are open between machines: Check OS Firewalls, External Firewalls, If AWS need to open TCP ports AJP Port for communicating with cluster members (remote) – by default 801X HTTP port, for testing using internal web server would be port 850X

18

Page 19: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Clustering and Scalability

Nimit Sharma

19

Page 20: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Agenda

PDFg Service(CFHTMLTOPDF) PDFg Service Clustering

Vertical Horizontal

Troubleshooting tips Performance improvements

20

Page 21: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service

21

Fully revamped PDF Engine Produces high quality PDFs Re-architected for high performance Cluster Support for Enterprise Edition

Page 22: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service

22

CFHTMLToPDF CFHTMLToPDFItem

Page 23: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDF generated using CFDocument and CFHtmlToPdf

23

CFDocument CFHtmlToPdf

Page 24: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Components of PDFg Service

24

Service: It is process named HTML2PDFConverter.

Service Manager: It manages the lifecycle of PDF generation.

Page 25: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Request Flow

25

End-Users ColdFusion Server

ColdFusion Add-on

Services

ServiceHTML2PDFConverter

PDF Service Manager

Page 26: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service Clustering for Scalability

26

Vertical Scaling

Horizontal Scaling

Page 27: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service – Vertical Scaling

27

Html2PdfConverter N

Html2PdfConverter 3

Html2PdfConverter 2

Html2PdfConverter 1

PDF Service Process Pool

PDF Service process can be increased with

load.

Page 28: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service – Vertical Scaling

28

Configuration File <cf_install_root>/cfusion/jetty/webapps/PDFgServlet/WEB-INF/web.xml

<context-param><description> Minimum PDFg process running in Process pool </description>

<param-name>minService</param-name>

<param-value>1</param-value></context-param>

<context-param> <description> Maximum PDFg process running in Process pool </description>

<param-name>maxService</param-name>

<param-value>2</param-value> </context-param>

Page 29: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 29

Demo

Page 30: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service – Horizontal Scaling

30

Load Balancer

Html2PdfConverter 2

Html2PdfConverter 1

PDF Service Process Pool

Html2PdfConverter 2

Html2PdfConverter 1

PDF Service Process Pool

Page 31: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

PDFg Service – Horizontal Scaling

31

Login to ColdFusion Administrator, and then navigate to ‘Data & Services’ > PDF Service.

Page 32: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

List PDF Service Managers

32

Login to ColdFusion Administrator, and then navigate to ‘Data & Services’ > PDF Service.

Page 33: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 33

Demo

Page 34: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Troubleshooting Tips

34

How to access PDFg service manager remotely

How to enable PDFg service logging

Page 35: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Accessing PDFg service manager remotely

35

Configuration File:

<cf_install_root>/cfusion/jetty/etc/jetty.xml

<Call name="addConnector"><Arg> <New class="org.mortbay.jetty.bio.SocketConnector">

<Set name="Host">127.0.0.1</Set> <Set name="port"> <SystemProperty name="jetty.port" default="8987"/></Set> <Set name="maxIdleTime">50000</Set> <Set name="lowResourceMaxIdleTime">1500</Set>

</New> </Arg> </Call>

Page 36: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 36

Logging

End-Users ColdFusion Server

ColdFusion Add-on

Services

ServiceHTML2PDFConverter

ColdFusion logs

PDF service logsPDF Service

Manager

Page 37: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Enabling PDFg service logging

37

Configuration file:

<cf_install_root>/cfusion/jetty/webapps/PDFgServlet/WEB-INF/web.xml

It creates PDF service log named pdfg_access.log

<context-param> <description>EnableLogging logs complete details about PDFg service and conversion request life cycle.</description>

<param-name>enableLogging</param-name>

<param-value>true</param-value> </context-param>

Page 38: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Performance Improvements

38

10 20 40 50 80 1000

20

40

60

80

100

120

CFDocumentCFHtmlToPdf

Virtual Users

Th

rou

gh

pu

t(R

eq

ue

st/S

ec)

104%

Page 39: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Configuration used for Performance tests

39

Server details:

OS: Windows Server 2012 R2 Processors: Xeon with 16 cores RAM: 32 GB

PDF Service Configuration details:

minService: 8 maxService: 12

CFDocument:

No option available to scale

Page 40: 2014 cf summit_clustering

© 2014 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.

Nimit [email protected]@nimsharm

Elishia [email protected]@elishdvorak


Recommended