• No results found

ColdFusion 8. Performance Tuning, Multi-Instance Management and Clustering. Sven Ramuschkat MAX 2008 Milan

N/A
N/A
Protected

Academic year: 2021

Share "ColdFusion 8. Performance Tuning, Multi-Instance Management and Clustering. Sven Ramuschkat MAX 2008 Milan"

Copied!
46
0
0

Loading.... (view fulltext now)

Full text

(1)

ColdFusion

8

Performance Tuning,

Multi-Instance

Management and

Clustering

Sven Ramuschkat

(2)

About

me

Sven Ramuschkat

CTO of Herrlich & Ramuschkat GmbH

ColdFusion

since

Version 3.1

Authorized

ColdFusion

Trainer since

1998

Also Specialist

for

Flash Media Server, Adobe Connect

and

LiveCycle

ES

www.richinternet.de

www.richinternet.de/blog

(English Blog)

(3)

Agenda

ColdFusion

8 Performance Gains

Best Settings

for

Performance

ColdFusion

Installation Options

(4)

ColdFusion

Performance with

Version 8

Adobe Observations

of CF8 over

CF7

Most applications

average

30-40% performance

gain

some

applications

3 or

4 times

better

Structure

manipulation

in CF 8 twice

as fast as CF 7

List manipulation

three

times

faster

CFSET more

than

four

times

faster

CFPARAM tag 35 times

faster

Date functions

about

6 times

as fast

Regular

expression

functions

more

than

twice

as fast

(5)

ColdFusion

8 now

deployed

atop

JDK 1.6

fixes some

past

problems, adds

some

new

features

adds

substantial performance

increases

Unfortunate

JVM bug

with

class

loading

Fall back to Java 1.5

Some

have

also updated

to 1.6 update 10

(1.6 update 10 unsupported

by

Adobe yet)

(6)

ColdFusion

Performance with

Version 8

Think

about

ColdFusion

64 Bit and Windows 2008 64-Bit:

No memory

heap

restrictions

anymore

As you can see, there are

performance gains of

around 0-15% in most of

the tags. This can be

attributed to the fact that

most of these tags are

computationally intensive

and perform better on

64-bit systems

(7)

ColdFusion

Performance with

Version 8

So an update to ColdFusion

8 is

a

must

from

a performance

(8)

Best settings

for

Performance

This

can

not

fix bad or

slow

code!

So always

start to optimize

your

code

(9)

CF-Administrator

Server Settings

Settings

“Enable Whitespace Management”

Setting

Tradeoff between extra server work and download speed

Can be expensive (up to a ~10% hit) on server side

Some webservers

offer HTTP compression

Squeezing whitespace out of .CFM files in batch can help

Please solve the whitespace problem inside your source code:

<cfsetting

enablecfoutputonly="true">

<cfoutput>Hello

World! </cfoutput>

(10)

CF-Administrator

Server Settings

-

Request

Tuning

Simultaneous Requests

Controls number of worker (request) threads created and able to service requests simultaneously

Single most important CF Admin setting (Def = 10)

Under the hood, this sets the JRun

“Active Handler Threads”

No magic formula, BUT:

Optimal CF5 setting may be too low for CFMX

Generally, start tuning at 3 per CPU

(i.e.: 6 on 2-way or 12 on 4-way)

Too high can cause heavy context switching

(11)

CF-Administrator

Server Settings

Caching

Template Cache Size

Use to cache compiled template Java bytecode

Where templates actually execute from

Memory considerations:

Consumption can be 3-10X ASCII template size

Can get OutOfMemory

conditions if set too high for the Java VM MaxHeapSize

on a very large site

CFMX = the NUMBER of templates

(12)

CF-Administrator

Server Settings

Caching

Trusted Cache

If “ON”, no check of template source file date/time

If “OFF”, will check and recompile templates if newly changed

Turn it “ON”

for production

Enabling “Trusted Cache”

Admin switch minimizes file system stat() calls

Includes Application.cfm

and OnRequestEnd.cfm

Can dramatically increase performance under load

Especially on shared network file systems

No server restart required

(13)

CF-Administrator

Server Settings

Caching

Some

people

have

been

noticing

dramatically

slower

application

startup

times

on ColdFusion

8 compared

to ColdFusion

MX 7.

The

answer

is

Java 6. For all the

other

performance

improvements

and

increased

functionality

in Java 6, it

introduced

a bug

in the

class

loader

that

causes

substantially

slower

class

loading.

A fix appears

to be

out now. JDK 6 update 10.

(14)

CF-Administrator

Server Settings

Caching

Number of Cached Queries

Sizing:

Default = 100, maximum is memory size

Make:

Big enough to fit a popular RS’s in memory

Small enough to keep out of swap space

NOT too big that you exceed Heap Size (OutOfMemory)

How much memory does each DB result set require?

Depends on (# Rows) X (# Bytes per Row)

(15)

Database Drivers in ColdFusion

Never

use

ODBC!

(16)
(17)

Important

Datasource

Parameters

Maintain

Connections

Connection-Pooling: ColdFusion

establishes

a connection

to a

data

source

for

every

operation

that

requires

one. Enable

this

option

to improve

performance

by

caching

the

data

source

connection

Max Pooled

Statements

Enables

reuse

of prepared

statements

(that

is, stored

procedures

and queries

that

use

the

cfqueryparam

tag).

Although

you

tune this

setting

based

on your

application, start

by

setting

it

to the

sum of the

following:

Unique

cfquery

tags that

use

the

cfqueryparam

tag

Unique

cfstoredproc

tags

(18)

JVM-Settings

for

ColdFusion

Standalone

In 32-Bit Windows max

is

1.6 GB RAM

(19)
(20)

ColdFusion

Versions

Limited

=

Enterprise feature

that

runs

through

the

Enterprise Feature Router

(EFR). These

features

will run

in the

Standard Edition.

However, all features

running

through

the

EFR will be

limited

to one

shared

(21)

Installation

Option 1:

CF 8 Standalone

with

embedded

JRun

4

(22)

ColdFusion

Standalone

Installation

ColdFusion

will be

installed

to C:\CFusion8

The

Windows Service Name

is

„ColdFusion

8

Applicationserver“

(23)

Installation

Option 2:

CF 8 as

J2EE-Application inside

a

JRun

4 full

installation

(24)

ColdFusion

on JRun4

JRun

4 full

installation

to

C:\JRun4.

ColdFusion-Instance

will be

deployed

automatically.

Windows Service Name is

Macromedia

JRun

CFusion

Server“

You

can

create

as many

(25)

Installation

Option 3:

Creating a EAR-

or

WAR-File

for

(26)
(27)
(28)
(29)

Installed

Services and Directories

(30)

Instance-

and

Clustermanagement

(only possible with Option 2:

Multiserver configuration)

(31)

Instance

Management

You can delete the “samples”

Instance, because this is JRun

Stuff …

The CF-Instance named CFusion

is the Master-Instance. Only the Master Instance

has the Instance-

and Cluster-Manager. The Master Instance can not be added to a

cluster.

(32)
(33)
(34)

Instance

Management

Every

CF-Instance

has:

1.

It‘s

own

JVM-Instance

(Application

Isolation)

2.

It‘s

own

CF-Admin

with

separate Settings

3.

It‘s

own

CustomTag

(35)
(36)

ColdFusion

WebServer

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)

(37)

ColdFusion

WebServer

Connector

Clustering

ColdFusion

Cluster Manager

When a cluster uses

session replication

, session

data is copied to other servers in the cluster each time

it is modified. This can degrade performance if you

store a significant amount of information in session

scope. If you plan to store a significant amount of

A

sticky session

specifies that once a

session is created by a given server,

subsequent requests from the user will

continue to be routed to that same

server in order to preserve session

information

(38)

ColdFusion

WebServer

Connector

Clustering

After enabling

session

replication

you

will need

to enable

J2EE session

variables within

the

ColdFusion

admin.

(39)

Important

Cluster Parameters

Algorithm

Description

Round robin

(default)

The web server connector sends each request to the next JRun

server in the list.

Specify ROUNDROBIN

to use this option.

Weighted round

robin

The web server connector sends relatively more requests (one after the other) to

certain JRun

servers, as specified in the serverweight

attribute. Specify

ROUNDROBIN_WEIGHTED

to use this option.

Random weighted

The web server connector sends relatively more requests (in a random order) to

JRun

servers, as specified in the serverweight

attribute. Specify

RANDOM_WEIGHTED

to use this option.

(40)

Important

Cluster Parameters

sticky

sessions

Yes

— The

web server

connector

detects

whether

a request

has an existing

session

and automatically

routes

that

request

to the

original JRun

server

instance. If

your

ColdFusion

application

uses

session

management

but

does

not

use

session

replication, you

must

enable

sticky

sessions.

No —

The

web server

connector

routes

incoming

request

to the

next

JRun

server

instance, as determined

by

the

cluster

algorithm.

session

replication

Yes

— JRun

automatically

replicates

session

in-memory

to other

servers

in the

cluster.

No —

Session replication

is

disabled. If

your

ColdFusion

application

uses

session

replication, sticky

sessions

are

not

typically

required.

(41)

Cluster Parameters

C:\JRun4\servers\clusterInstance1\SERVER-INF\jrun.xml

<service class="jrun.servlet.jrpp.JRunProxyService"

name="ProxyService"><attribute

name="activeHandlerThreads">25</attribute><attribute

name="backlog">500</attribute><attribute

name="deactivated">false</attribute><attribute

name="interface">*</attribute><attribute

name="maxHandlerThreads">1000</attribute><attribute

name="minHandlerThreads">1</attribute><attribute

name="port">51004</attribute><attribute

name="threadWaitTimeout">20</attribute><attribute

name="timeout">300</attribute><attribute

name="bindToJNDI">true</attribute><attribute

name="StickySessions">false</attribute><attribute

name="LoadBalancingAlgorithm">ROUNDROBIN</attribute><attribute

name="ServerWeight">3</attribute>

(42)

ColdFusion

Clustering

connecting

the

web server

JRun

web server

connector

clustering

(43)

ColdFusion

Clustering

Testing

<cfobject

action="create" type="java" class="jrunx.kernel.JRun" name="jr">

<cfset

servername

= jr.getServerName()>

<cfoutput>Jrun

ServerName: #servername#</cfoutput>

(44)

Web Server Clustering

-

Overview

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

roundrobin

DNS or

a hardware

device

Failover

is

used

to protect

against

web server

failures, implemented

using

a hardware

or

software

solution

(45)

Web Server Clustering

-

Hardware

Common hardware

options

F5 Big IP

Cisco CSS

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

(46)

Mixed Cluster-Concepts

1.

Web server

clustering

References

Related documents

Use the Discount Drug Program* The Discount Drug Program is available to Blue Cross and Blue Shield Service Benefit Plan members for specific!. medicines not covered under

Covariance functions for additive genetic and permanent environmental effects and, subsequently, genetic parameters for test-day milk (MY), fat (FY) protein (PY) yields and mozzarella

Universal quantum computation with hybrid spin-Majorana qubits Silas Hoffman, Constantin Schrade, Jelena Klinovaja, and Daniel Loss Department of Physics, University of

The main contributions of MASA are: (a) a flexible and customizable architecture for deployment of pairwise biological sequence aligners in different hardware/software platforms; (b)

Veracode’s Vendor Application Security Testing (VAST) Program provides the first comprehensive application security compliance program to large enterprise customers as well as

The sensor is a linear array with a lenslet strip positioned directly in front of it.. This strip will be removed, leaving the sensor at the bottom of a deep, dark channel with a

Ponovljivost i srednja preciznost bile su zadovoljavajuće za više koncentracije standarda, dok za najniţu koncentraciju nisu zadovoljavale, što nije neuobičajeno za