java on the mainframe

Post on 21-Mar-2017

413 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Java on the MainframeJavagruppen,

Copenhagen, 27th October 2015

Michael Erichsen,Xact Consulting A/S,

michael.erichsen@xact.dk

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Introduction

COBOL is Native to the Mainframe

Java is also NativeIt was just born later

Good or Bad?

Old or New?

• OO is just a way to do somecategories of computing– Not something given to Moses

on tablets

• The first OO language, Simula,was formalized in 1962-1965

• COBOL was formalized in 1959-60

6

When I’m Good I run your Payroll

When I’m Bad you have overseen a ”.”

When I’m good I run stuff like Watson

When I’m Bad you’ll get a Null Pointer Exception

Paradigm Shifts

11

Batch OLTP Client/Server WWW Mobile/IOT

Flat files Databases Relational NoSQL ...

Unstructuredmachine

instructions

Procedurallanguages

Objectoriented

Parallelprocessing ...

IBM’s Competition

12

Burroughs,Univac, ICL,Honeywell...

Oracle,Tuxedo,Unikix

Sun, DEC,Microsoft

WebLogic,Tomcat

Apple,Google,Amazon

Burroughs,Univac, ICL,Honeywell...

Adabas,Datacom Oracle OSS ...

Burroughs,Univac, ICL,Honeywell...

MicrosoftBasic C# ... ...

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Why Java?

Sun wanted to confront Microsoft

• Killer hardware– The SPARC processor

• “An industrial-strength Smalltalk, written in C++“– Dropped C++– Dropped ObjectiveC– Then “Oak”– Then “Java”

• Lost the Browser war – strong on the server side – underconstant attack for security

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Why Java on Mainframe

Java on the Big Iron

• Open the mainframe to a new generation of developers• Portability of applications• But also

– IBM wanted to confront Microsoft too– Microsoft exerted an aggressive dominance– Hard to imagine in these Apple, Google and Facebook times?– At that point in time it was ”EAM”: Everybody Against Microsoft

IBM has always been Competition driven

Why invent a mainframe whenyou made most of your moneyon selling small pieces ofcardboard?

Why invent a PC when you mademost of your money onmainframes?

Which Runtimes? All of them!

• Batch– BPX– JZOS

• CICS– OSGi– Liberty– PHP– Mobile– Servlets– JSP– SAML– JDBC Type 4– JCICS

• DB2– SQLJ– JDBC type 2– JDBC type 4

• IMS– JMP– JDBC

• MQ– WMQ API– jms

• WAS– ”Classic”– Liberty

• zLinux

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Development of Java on the Mainframe

Mainframe Issues

• Processor technology• Virtualization• Changing implementations• Garbage Collection Policies

Processor Technology

• Mainframe processors optimized for batch I/O and OLTP– Data intensive– ”Invisible” extra processors for I/O

• Java developed on the opposite types of processors– Numeric intensive

• IBM’s challenges– Change the processors to accomodate for Java– Adapt the JVM to IBM Hardware– Specialized processors for special tasks

Processor Development

• Java is a very high priority for z series mainframes• The IBM hardware lab works hard to satisfy requirements from

the IBM Java lab• 1998 COBOL/Java performance were perhaps 1/200• 2015 it is close to even• New functionality tends to be implemented in Java before

other languages like COBOL and PL/I– New compiler technology, DWARF debugging

Early steps

• GZIP accelleration in hardware• UTF conversion

– ”CONVERT UTF-16 TO UTF-8” is a single instruction!• Cryptograpic Instructions

– z/OS subsystem– Offloaded to crypto coprocessors

• XML z/OS subsystem• Each step then implemented in an IBM JVM version

– I recommend you always stay on the highest level of hardware and JVM!

Z196

• Out-of-order pipeline design, larger cache structure, higherclock speed

• 70+ new instructions used by Java• Conditional-load/store• Non-destructive operands• Interlock facility update for better Java concurrency

EC12• Hardware Transaction Memory (HTM)

– Better concurrency for multi-threaded applications eg. ~2X improvement to juc.ConcurrentLinkedQueue• Run-time Instrumentation (RI)

– Innovation new h/w facility designed for managed runtimes– Enables new expanse of JRE optimizations

• 2GB page frames (no zVM)– Improved performance targeting 64-bit heaps

• Pageable 1MB large pages using flash– Better versatility of managing memory

• New software hints/directives– Data usage intent improves cache management– Branch pre-load improves branch prediction

• New trap instructions– Reduce overhead of implicit bounds/null checks

z13

• Java 8 improvements• Simultaneous Multi-Threading (SMT)

– 2x hardware threads/core for improved throughput– Also available on zIIP and IFL

• Single Instruction Multiple Data (SIMD)– Vector processing unit– Accelerates loops and string operations

• Cryptographic Function (CPACF)– Improved performance of crypto co-processors

Virtualization

• Mainframe has excelled in virtual storage and machines sincethe 1960’es– Based on a set of civilized traffic rules in a multi-tenant system

• Java has its own Virtual Machine– Raised as a spoiled only child with no manners– Grabs all the storage it can immediately– Has been handled in different ways over time

• JVM on top of Virtual Storage on top of z/VM on top ofPR/SM...?

HPJ (”High Performance Java”)

• In the beginning it was impossible for IBM to make a JVMperform

• Initialization cost of a JVM: 20.000.000 instructíons• HPJ ran as a fully compiled Language Environment load module

– Performed like C (which is probably what it really was?)– Still humongeous startup cost

• Impossible for IBM to have their HPJ compiler support all thenew functionality pouring into Java (Only 1.1)

Reuse – Reset – Continuous...

• IBM switched focus to the JVM and tried various strategies• Reusable

– Keep the environment running for exactly the same program• Resettable

– Keep the JVM running, but reset the environment• Continuous

– More sharing, JIT• Since then

– Still more sharing, more threads, 64 bit

Garbage CollectionJava has no explicit allocationand deallocationDeallocation done as GarbageCollection

– All active objects marked andcopied away

– All unused deleted bycompacting storage

– Done in different pools tohandle short and long livedobjects separately

Garbage Collection Issues

• Pause time• Pause predictability• CPU usage• Memory footprint

– Virtual footprint– GC interaction with paging and

swapping• The unimaginable memory leaks

– Unintended object retention

IBM JVM Garbage Collection Policies

• Four GC policies – optimized for different scenarios– -Xgcpolicy:optthruput

• For “batch” type apps

– -Xgcpolicy:optavgpause• For apps with responsiveness criteria

– -Xgcpolicy:gencon• Highly transactional workloads

– -Xgcpolicy:subpools• Large systems with allocation contention

gencon• Generational & concurrent GC collector introduced with IBM JVM 1.5

– It does split the Java Heap space between nursery and tenured spaces– Nursery (YoungGen) space objects are collected separately via the scavenger GC

collector– Tenured space objects are collected via the global GC collector– The GC collector is concurrent and taking advantage of any multi physical cores

machine• Results:

– Reduced major collection frequency (Full GC)– Reduced Full GC elapsed time & pause time– Increase JVM throughput– Increase performance & capacity of your application

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Challenges

Challenges

• Hardware has been optimized for Java• JVM has been optimized for z/OS• Still a number of challenges

– Sizing of heaps and underlying layers– Startup CPU usage– Batch

Heap Sizes

• Java heap size tuning is an art– Small heaps get filled up quickly => GC often– Large heaps holds a lot of objects => GC takes a long time (”Stop the

World”)– Need tools, measurements, statistics and tuning

• Java heaps lives on top of Language Environment heaps andz/OS virtual storage– LE heaps can be measured and tuned– Paging and swapping can be the result of overallocating heaps

Or you can just buy more Real Storage...

JVM startup overhead

A full scale two LPAR share-allclassic WebSphere ApplicationServer startup?!?

Time for a BIG cup of coffee...

IBM Heap Analyzer

IBM Health Center, GC Perspective

IBM Garbage Collection and Memory Visualizer

More Tools

• IBM Extensions for Memory Analyzer• IBM Interactive Diagnostic Data Explorer

– All available with ISA, IBM Support Assistant, at no separate cost

• Perhaps your favourite Monitor product has support?– Omegamon, TMON, Mainview, Sysview...

Batch

• BPXBATCH is the normal Unix Systems Services batchimplementation

• JZOS is a custom JVM launcher for z/OS– Built by 3rd party as Open Source– Bought by IBM and added to z/OS– Better Java support– Better DB2 interface

• “Modern batch” is a different story

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Development

Plain Java Development

• All Java tools can be used• Rational Developer for z has support for special API’s like JCICS• The IBM JVM is 100% compatible with Sun/Oracle from the

development side– Differences only in JVM implementation and in toolbox

Mixed Language Development

• OO COBOL was originally intended to redefine COBOL as an OOlanguage– This has been dropped to let OO and COBOL each do what they are best at

• OO COBOL remains as an interface to call COBOL from Java– Allows you to define classes with methods in Cobol– Create instances of Java and Cobol classes– Invoke methods on Java and Cobol objects– Write classes that inherit from Java or Cobol classes– Overload methods

Mixed Language Development• In Enterprise Cobol you can also invoke the Java Native Interface (JNI) to

obtain other Java-oriented capabilities• Function pointers for JNI services are in the JNI Environment Structure• New special register JNIEnvPtr• Linkage section

– COPY 'JNI.cpy'

• Procedure division– Set address of JNIEnv to JNIEnvPtr– Set address of JNINativeInterface to JNIEnv– Invoke aJavaObject 'someJavaMethod'– Invoke exceptionObject 'PrintStackTrace'

Storage Differences

• Storage is static in COBOL,HLASM, PL/I etc.

• Storage is dynamic in Java• You can call from Java to

COBOL with an area that hasnot yet been allocated by Java– Storage violations– Null pointer exceptions

Deployment

• OSGi has been added to CICS– Being extended to COBOL and

PL/I

• Elsewhere later?

Security

• EJBROLE– Member class for Enterprise Java

Beans authorization roles• GEJBROLE

– Grouping class for Enterprise JavaBeans authorization roles

• JAVA– Contains profiles that are used by

Java for z/OS applications toperform authorization checking forJava for z/OS resources

EJBROLE Examples

• ADMINISTRATOR• ADMINSECURITYMANAGER• BBNBASE.deployer• BBNBASE.CosNamingCreate• COSNAMINGCREATE• OPERATOR• IZUDFLT.*.izuUsers (G)

• isCallerInRole()• isUserInRole()

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Economy

Processor Economy

• IFL– Integrated Facility for Linux– Same processor, reduced price

• zIIP– System z Integrated Information Processor

Contract Economy• zNALC

– System z New Application License Charges– Reduced price on LPAR with ”new workload” such as Java on WAS

• VUE– Value Unit Edition– One time charge for eligible workloads in such LPAR

• MWP– Mobile Workload Pricing for z/OS– Extra load must be documented

• This is not Java specific, but can improve your business case

The Last Words

FOR MORE INFORMATION PLEASE CONTACTXact Consulting A/SArnold Nielsens Boulevard 68ADK-2650 Hvidovre

+45 7023 0100info@xact.dkwww.xact.dk

Enterprise Modernization

Moderniza-tion

Conversion

Business

SoftwareConsultants

top related