Taking Advantage of 64 bit support in Cold
Taking Advantage of 64 -bit support in Cold. Fusion Manjukiran Pacchhipulusu www. manjukiran. net Lead Software Engineer Cold. Fusion Product Team 18 th June 2008 2006 Adobe Systems Incorporated. All Rights Reserved. 1
Agenda § Section 1: What is 64 -bit computing? § Section 2: Cold. Fusion and 64 -bit support § Section 3: Taking advantage of 64 -bit support in Cold. Fusion § Section 4: Performance numbers as we saw § Final verdict § References § Q&A 2006 Adobe Systems Incorporated. All Rights Reserved. 2
Taking Advantage of 64 -bit in Cold. Fusion WHAT IS 64 -BIT COMPUTING? 2006 Adobe Systems Incorporated. All Rights Reserved. 3
The world is moving… 4 -bit Processor eg: Intel 4004 (1971) 8 -bit Processor eg: Intel 8086 (1978) 64 -bit Processors eg: Intel Xeon (2000 s) 32 -bit Processors eg: Intel Pentium III (1990 s) 2006 Adobe Systems Incorporated. All Rights Reserved. 16 -bit Processor eg: Intel 80286 (1982) 4
What is 64 -bit computing? More Registers 64 -bit Instruction Set Has 64 -bit Data bus 2006 Adobe Systems Incorporated. All Rights Reserved. 5
Advantages – High Precision Computations 64 -bit computing provides § More registers § 64 -bit registers Which leads to § Integer Arithmetic and High-Precision Math is up to 4 times faster as compared to 32 -bit. § Computations on long and double (in Java) data types is faster. § Date computations (in Java), encryption/decryption are fast. § Graphics/Fractals, which require high precision are faster. § Computationally Intensive applications gain! 2006 Adobe Systems Incorporated. All Rights Reserved. 6
Advantages – Memory Addressable limit 64 -bit computing provides § 64 -bit wide addresses § 64 -bit data bus which leads to § 264 bytes = 17. 2 billion GB of addressable space! (32 -bit systems can address 232 bytes = 4 GB) § Better caching – reduced database calls, reduced disk access § Memory intensive applications gain! 2006 Adobe Systems Incorporated. All Rights Reserved. 7
Advantages – Others 64 -bit computing provides § Ability to operate on more files § Ability to operate on larger files (although this also may be a feature of certain 32 -bit software) which leads to § Reduced disk access § Access files of size in order of GB easily 2006 Adobe Systems Incorporated. All Rights Reserved. 8
Disadvantages – Increased Memory Usage § Wider address, wider data -> Higher memory footprint § For a given cache, 64 -bit systems can store less data compared to 32 bit systems increasing (processor) cache misses § Software incompatibility – unavailability of device drivers, other specific software incompatibilities 2006 Adobe Systems Incorporated. All Rights Reserved. 9
Pros and Cons of 64 -bit computing - Summary +ve § High precision computations are faster as compared to 32 -bit § Higher memory addressability § ability to operate on more files and larger files (although this also may be a feature of certain 32 -bit software) -ve § Binaries are larger than 32 -bit. Cache misses increase Finally § Performance gain/loss is usually around +/- 10% of 32 -bit applications 2006 Adobe Systems Incorporated. All Rights Reserved. 10
Taking Advantage of 64 -bit in Cold. Fusion COLDFUSION AND 64 -BIT SUPPORT 2006 Adobe Systems Incorporated. All Rights Reserved. 11
Cold. Fusion 64 -bit – Support History § Cold. Fusion 8 introduced 64 -bit support for Solaris. § Cold. Fusion 8. 0. 1 introduces full 64 -bit support! Refer http: //www. adobe. com/products/coldfusion/pdfs/cf 8_systemsupportmatri x. pdf for details. 2006 Adobe Systems Incorporated. All Rights Reserved. 12
Cold. Fusion 8. 01 – Support Matrix Cold. Fusion Standalone/Multiserver Windows 64 -bit Linux 64 -bit Mac Intel 64 -bit IIS Apache Mac PPC Apache 64 -bit Solaris 64 -bit Apache 2006 Adobe Systems Incorporated. All Rights Reserved. 32 -bit (Standard) 64 -bit (Enterprise) 32 64 32 NA 64 NA 13
Cold. Fusion 64 -bit – Installation § 3 New Installers – Windows 64 -bit, Mac Intel 64 -bit, Linux 64 -bit § Installation experience remains the same § 64 -bit is a Cold. Fusion Enterprise Edition only feature. However Standard Edition can be installed in 32 -bit mode on 64 -bit systems § Refer the Technote and System requirements for details 2006 Adobe Systems Incorporated. All Rights Reserved. 14
Cold. Fusion – 32 -bit Vs 64 - bit binaries 64 -bit Cold. Fusion Installer § 64 -bit Cold. Fusion Installer runs on only 64 -bit machines § Installs Cold. Fusion in 64 -bit mode § If 64 -bit Cold. Fusion Installer is run on 32 -bit machines, error is thrown on installation or on server start-up § Make sure your system and the JDK (if external JDK) used is 64 -bit § Fresh installation is necessary for upgrade from 32 -bit Cold. Fusion to 64 -bit Cold. Fusion 32 -bit Cold. Fusion Installer § 32 -bit Cold. Fusion Installer runs on both 32 -bit and 64 -bit machines § Installs Cold. Fusion in 32 -bit mode § 32 -bit Cold. Fusion cannot make use of the ‘unlimited’ heap space provided by 64 -bit systems as they still would use 32 -bit addresses 2006 Adobe Systems Incorporated. All Rights Reserved. 15
Cold. Fusion 64 -bit – Compatibility Issues § Cold. Fusion – COM Interoperability does not work § Cold. Fusion – Delphi Interoperability does not work § MS Access database connectivity does not work § Cold. Fusion. Net integration Service, Verity Service currently run in 32 bit mode § Performance monitor dll does not load when Cold. Fusion 32 -bit is installed on 64 -bit Windows 2006 Adobe Systems Incorporated. All Rights Reserved. 16
Taking Advantage of 64 -bit in Cold. Fusion TAKING ADVANTAGE! 2006 Adobe Systems Incorporated. All Rights Reserved. 17
How to take advantage? § § Cold. Fusion is a Java application. Tune JVM first § Increase heap space § Tune Garbage Collector § Tune other JVM args Modify your CF applications 2006 Adobe Systems Incorporated. All Rights Reserved. 18
Digression – Java Arguments § Java Arguments are inputs to the Java compiler § They define the behavior of the compiler § Java arguments can be used to set heap space, garbage collector algorithm and related settings, class paths, library paths, etc § Cold. Fusion is a Java application. Java args can be set in jvm. config or in the administrator § Server needs to be restarted for the settings to get applied 2006 Adobe Systems Incorporated. All Rights Reserved. 19
Heap Space – What is Heap? Stack contains Local method variables, primitive variables like int, double Heap contains Objects, Instance variables 2006 Adobe Systems Incorporated. All Rights Reserved. 20
Heap Space – Things to know § 32 -bit systems can have heap spaces of 2 -3 GB only. Remaining space is used up by the OS. § 64 -bit systems can have unlimited heap space limited only by § The amount of RAM available on the system § OS limitations – Mac Pro recognises 32 GB of RAM whereas Windows 2008 recognises 32 GB-2 TB of RAM § Heap Space can be set by the java args Xms and Xmx § Xms defines the Initial Java Heap Size § Xmx defines the Maximum Java Heap Size 2006 Adobe Systems Incorporated. All Rights Reserved. 21
Garbage Collection in Java § Memory given to objects created on the heap is collected back using garbage collection. § Garbage collection happens on a different thread. § Various algorithms for garbage collection are available. Various java arguments are there for configuring garbage collection. § Cold. Fusion uses the Throughput/Parallel garbage collector as the default collector. § Garbage collector can be tuned/controlled using various java arguments 2006 Adobe Systems Incorporated. All Rights Reserved. 22
Heap Space and GC – What should be the value? § § In General, for server class machines, SUN recommends the following: § The -server compiler § The -XX: +Use. Parallel. GC parallel (throughput) garbage collector § The -Xms initial heap size is 1/64 th of the machine's physical memory § The -Xmx maximum heap size is 1/4 th of the machine's physical memory (up to 1 GB max). “Recommendations for Tuning CF” White paper coming up! 2006 Adobe Systems Incorporated. All Rights Reserved. 23
Modify your CF applications § Reduce DB calls – Cache large databases into memory (More Caching > More cache hits -> Increased Throughput) § Reduce Disk access – Can now have large data-structures in memory § Run a boot-strapper which puts all the data-sets into Server/Applications Scope so that it stays in memory. § Other Technologies that can be used to leverage memory better – Apache Commons [RAM as VFS], Memcache for Caching Framework 2006 Adobe Systems Incorporated. All Rights Reserved. 24
Taking Advantage of 64 -bit in Cold. Fusion PERFORMANCE NUMBERS 2006 Adobe Systems Incorporated. All Rights Reserved. 25
Environment § Hardware used - HP Pro. Liant DL 360 G 5 with 2 2 GHz Intel® Xeon® Dual-Core 5130 processors and 8 GB RAM § 32 -bit and 64 -bit environments were installed as dual boot § Software for 64 -bit: Windows 2003 OS 64 -bit + Cold. Fusion 8. 0. 1 Enterprise Edition 64 -bit § Software for 32 -bit: Windows 2003 OS 32 -bit + Cold. Fusion 8. 0. 1 Enterprise Edition 32 -bit § Cold. Fusion Settings: Debugging OFF, Trusted Cache ON, Whitespace Management if ON, Max Jrun Threads is 100 § Client: JMeter + 30 no-think-time Virtual Users + 5 minutes § Client, CF Server and database server run on 3 different systems but on the same network switch 2006 Adobe Systems Incorporated. All Rights Reserved. 26
Test 1: Large Memory Scenario § Cold. Fusion script that reads a few large files (around 3 MB each) stored on the disk. 2006 Adobe Systems Incorporated. All Rights Reserved. 27
Test 1: Large Memory Scenario…contd 2006 Adobe Systems Incorporated. All Rights Reserved. 28
Test 1: Large Memory Scenario…contd § Observation – Throughput increases dramatically as the Java heap space is increased. § Reason § § Low disc-swapping operations as the heap space increases § Maximum File-descriptors limit is high in 64 -bit systems However, this is a “best-case” scenario. Good enough to demonstrate that memory intensive applications scale better on 64 -bit. 2006 Adobe Systems Incorporated. All Rights Reserved. 29
Test 2: Top Tags (Windows) § Top tags: Stuctures, Components, Is. Defined, CFImage, CFDocument, REFind. No. Case, CFSwitch/CFCase, p. Evaluate, Date Functions, Encryption, Evaluate § Heap size was set at 1280 MB for both the configurations. 2006 Adobe Systems Incorporated. All Rights Reserved. 30
Test 2: Top Tags (Windows)…contd 2006 Adobe Systems Incorporated. All Rights Reserved. 31
Test 2: Top Tags (Windows)…contd § Observation: Performance gains of around 0 -15% seen in most tags/functions. § Reason: § § Tags like CFImage, CFDocument, Encryption, p. Evaluate, Evaluate are computationally intensive and perform better on 64 -bit systems. § JDK Improvements – For 32 -bit, JDK 1. 6_04 32 -bit was used. For 64 -bit, JDK 1. 6_04 64 -bit was used. § Java generated code optimizations to fully leverage 64 -bit performance extensions. However these are specific tag scenarios. The performance of these tags in real-time application might be different 2006 Adobe Systems Incorporated. All Rights Reserved. 32
Test 3: Top Tags (Mac) 2006 Adobe Systems Incorporated. All Rights Reserved. 33
Test 3: Top Tags (Mac)…contd § Observation: Huge performance gains around 10 -150% were seen. However there was a drop in performance of cfdocument. § Reason: § § JDKs are different: For Mac Intel 10. 4 32 -bit OS, JDK 1. 5. 0_07 32 -bit is the default JDK. For Mac Intel 10. 5 64 -bit OS, JDK 1. 5. 0_13 64 -bit is the default JDK § Mac JVM has a lot of stuff implemented natively on Mac which provides this performance boost § Of course 64 -bit matters! No Disclaimer this time 2006 Adobe Systems Incorporated. All Rights Reserved. 34
Final Verdict § Adobe. com runs on Cold. Fusion 8. 0. 1 64 -bit. Adobe. com Servers run with a Heap Space of 8 GB to 32 GB § Upgrade if your applications demand high memory and high computations. § We Recommend for Enterprise level applications § World is on the move! Software and Hardware always in a race. The Hardware is ahead. Its time for Software to catch up! 2006 Adobe Systems Incorporated. All Rights Reserved. 35
References § My article: Taking advantage of 64 -bit support in Cold. Fusion § Steven Erat's blog: Performance considerations for running Cold. Fusion 8 in 64 -bit mode § Wikipedia definition: 64 -bit § Article: Tiger Developer Overview Series: Developing 64 -bit applications § White paper: IBM Web. Sphere Application Server 64 -bit Performance Demystified § SUN JVM White Paper: http: //java. sun. com/performance/reference/whitepapers/tuning. html 2006 Adobe Systems Incorporated. All Rights Reserved. 36
Q&A 2006 Adobe Systems Incorporated. All Rights Reserved. 37
2006 Adobe Systems Incorporated. All Rights Reserved. 38
- Slides: 38