SlideShare a Scribd company logo
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
Use your current wisely
Harvey Raja
Oracle
Chris Neal
Pegasus
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3
§  Senior Engineer
§  Oracle Coherence
Introduction
Harvey Raja
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4
§  Systems Architect
§  Pegasus Solutions
Introduction
Chris Neal
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5 5 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
The following is intended to outline our general
product direction. It is intended
for information purposes only, and may not be
incorporated into any contract.
It is not a commitment to deliver any material,
code, or functionality, and should not be relied
upon in making purchasing decisions. The
development, release, and timing of any features
or functionality described for Oracle s products
remains at the sole discretion of Oracle.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6
What’s all this about?
§  Big Data / Big Memory on a transistor diet
§  Applications and conceived concerns
§  Object Profiling
§  Elastic Data
§  Improvements
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7
Heap me up
§  JVM manages our objects
§  Understands Live Data
–  References
–  Free Lists
new Object()
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8
Heap me up
§  Two distinct regions of data locality
–  Young Generation
–  Old Generation
§  Allows conscious distinction between:
–  Long living objects
–  Short lived objects
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9
Heap me up
§  All memory allocations are against the
same resource
§  Why would it be any different?
§  Provides means to access
–  off-heap memory
–  File Descriptors a.k.a. any resource
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10
Heap me up
JVM
100%
0%
0%
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11
Applications & Their Objects
§  Every application has very different uses of objects
–  Size
–  Scope
§  Structures / Containers
–  Structures {Containers}
–  Containers {Structures}
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12
Application Object Profiles
§  Ye olde faithful… Pet Store
§  Short-lived objects
–  Search Results
§  Long-living objects
–  Popular items
JEE Pet Store
JEE Pet Store
JEE Pet Store
JEE Pet Store
Pet Store
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13
Application Object Profiles
§  Foreign Exchange Position Keeping
§  Aggregate Trades Values per
currency pair
§  Some currencies are a ‘busier’
§  Currencies may have varying SLAs
FX Position Keeping
T
T
T
T
USD-GBP
USD-EUR
T
T T
T
T
T
T
T
T
T
T
T
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14
What we know about applications?
§  The application understands more about each object than the JVM
–  Frequency
–  Size
§  Keeping everything in RAM is
possible but is it efficient?
§  Huge Leap between Object on heap &
stored in DB
-  Recency
-  Custom characteristics of the object
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15
Can the JVM just make the right choice?
§  The JVM would have to span multiple devices
§  Non-Heap must be serialized
§  Applications are diverse therefore to make generic decisions on object
usage would likely lead to false-positives
§  Down to the application or a layer above the JVM allowing users to
define resource assignment policies
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16
Municipality
§  The application deems its own usage of each resource
§  JVM provides primitives to load & store to these devices
§  May be useful to have an API that performs this storage appropriate to
the device:
–  Routing stores to appropriate device
–  Handle concerns of multiple applications on the same JVM
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17
CPU Architectures
§  As latency increases so does
capacity
§  Data fetched as required by instructions
§  Data is demoted as well as writes to
shared data rippling through the caches
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18
CPU Architectures
Speed Capacity
Registry 1ns 0.00
L1 Cache 2-5ns 2x32KB
L2 Cache 5ns 256KB
L3 Cache 20ns 8MB
Main Memory 20-60ns 16GB
Nehalem2GHZ
processor
Mayfair
Kensington
Camden
Wimbledon
Manchester
§  Perhaps we should charge our objects rental premiums?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19
Blank Canvas
£600pcm
£1800pcm
£2400pcm
£100000pcm
£100
Per TimeUnit
£500
Per TimeUnit
£250
Per TimeUnit
£1000
Per TimeUnit
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20
How do you choose the right property?
§  How do you select the right property:
–  How often are you in the office?
–  How long does it take you to get into the
office?
–  How much space do you occupy in the
office?
–  How do you get to the office?
–  MFU
–  Device latency
–  Object size
–  Every device has its own
quirks
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21
Translated to memory
USD -> GBP
USD-> JMD
Heap RAM
(off heap)
Disk
GBP -> MUR
Usage
Pet store
example
Pedigree Chum
Orijen
Dog Ugg boots
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22
Translated to memory
§  Objects held on heap are:
–  Structures (Containers)
–  Containers (Structures)
§  Similar to a file descriptor, each object has its own metadata:
–  Access Time
–  Modified Time
§  With ((Map) Containers) we already have a location to store
metadata
-  Size
-  Touch Count
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23
Translated to memory
CPU
Heap
NIO
Flash
Mechanical Disk
§  Each object has metadata
§  Some policy can manage these
objects
§  Demoted & promoted to the
various media types
§  Big jump from heap to NIO
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24
Brainstorm Summary
§  Cherish your high commodity investments
§  Reduce the regularity of going to a highly contended foreign
resource
§  Would be ideal to have objects float between high latency resources
using a telepathic API
–  Having some metadata could drive our decision for data locality
§  Map provides a nice abstraction for objects that should ripple
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25
Challenges
§  Serialization cost
§  Generally interactions are performed against the object form
§  False Positives
§  Device type peculiarities
§  A handle to the object (key) and metadata must be held on heap
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26
Elastic Data
§  A Feature in Coherence
§  Store binary key and value objects
in RAM or Disk
§  Overflow from RAM to Disk
§  RAM can be configured as NIO
store(byte[] key, byte[] val)
load(byte[] key)
erase(byte[] key)
RAM
Flash
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27
Elastic Data
§  Its simply writing a number of bytes to some stream?
§  How do you maintain handles?
§  Need a pointer to the written data?
§  How about updates, seek & replace?
Easy Peasy
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28
Elastic Data
§  Require a compact structure to hold handles (keys) to device pointers
§  Journal writes to the file system
§  Consistent API regardless of write to RAM, NIO, Flash or Mechanical
Disk
§  Buffer writes with thread dedicated to writing
Implementation Details
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29
Elastic Data
FlashJournal
RAMJournal
Collector
Overflow
Preparer
Writer
Binary Key Pointer
00110101001
11001001011
...
...
Serialize
110101
LFU
Collector
Store Index
Object deemed
unworthy of Heap
store(key, value)Pointer returned
Create
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30
Elastic Data
FlashJournal
RAMJournal
Collector
Overflow
Preparer
Writer
Binary Key Pointer
00110101001
11001001011
...
...
Collector
Store Index
Deserialize
110101
Deserialized object
returned
load(pointer)binary value
The binary
key provides
the physical
location of
the stored
item
Read
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31
Elastic Data
Elastic Data
100%
100%
100%
Utilization
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32
Elastic Data
§  RAM Journal can be used with NIO ByteBuffers
–  Memory managed using same mechanisms between RAM & Flash
§  Consider device specifics prior to use and design components /
interactions accordingly
§  Multi-threaded clients
§  Flash vs Mechanical
More Features
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33
Elastic Data
§  Several platters & reading / writing heads
§  Faraday & Lorentz
§  Seek time + Rotational Latency = L
§  Can not get to the same speeds as the disk controllers
Mechanical Media
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34
Elastic Data
§  NAND gates
§  MLC
§  Write in pages erase in blocks
§  No Seek Time or Rotational Latency
Flash Media
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35
Elastic Data
JVM
handle *
handle *
handle *
handle *
handle *
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
0111011100110110101
0111010110100110101
handle *(disk pointer)
HARRIET *
HARVEY *
HILARY *
HILTON *
Handles are
stored in
process
Number of handles
constrains amount of
data that can be
stored
Key Management
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36
Elastic Data
H
AR
RIET VEY
IL
ARY TON
HARRIET
HARVEY
HILARY
HILTON
1 2 4 8Tickets:
§  Data structure to hold handles
is a Binary Radix Tree
–  allows sharing
of common denominators
§  Handles (keys) are stored in
serialized form
§  Benefit increases as common bytes increase and less
heap memory is used
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37
Elastic Data
§  Writes are journalled
§  Erase is a logical removal
§  Update = erase + write
§  Avoids seek time or cascading pointer
changes
write write
write
APPEND
APPEND
APPEND
erase
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
010111001
101111010
100111010
100111100
File 1
File 2
File 3
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38
Elastic Data
§  Require a Journal Garbage Collector
–  Reclaim unreferenced memory
§  Evacuation process for each file
§  Eviction logically removes from Journal File
§  May enter an exhaustive mode
–  Synonymous to Full GC
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
1001110
100111100
010111001
101111010
100111101
110011000
Journal
Collector
sort
evacuate
(exhaustive-
mode)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39
Elastic Data
§  Dedicated threads to unblock writes
–  Tuned to device type
§  Client write appears to be as fast as
heap write
§  Overwhelming number of writes will
result in push back to the client
Preparer Buffer
Writer
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40
Who am I?
§  Chris Neal, Systems Architect
§  Started with Pegasus in 1994
§  Worked with Coherence since 3.3.1 in 2007
§  Participate in Coherence CAB
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.41
Who is Pegasus Solutions?
§  Founded in 1988
§  Provide technology and services to hotels and travel distributors
§  Three main service areas:
–  Representation Services
–  Distribution Services
–  Central Reservation Services (CRS)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.42
Distribution Services
–  Connects hotel systems with distribution partners.
–  100,000 hotels connected to all major distributors (Expedia, Orbitz, Hotwire, Travelocity, etc)
–  Cheaper and easier than a direct connect
–  If you book a hotel online, chances are your transaction goes through Pegasus.
–  Pegasus processes roughly 8 billion transactions per month… sustained ~3000TPS @200ms
latency or less.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.43
Why do we need a cache?
§  In travel agent days, “Look to book” ratios were 3:1
§  At internet scale, they are roughly 4200:1
–  Travel aggregators like Sidestep, Kayak, Mobissimo, etc burst this to >100,000:1
§  Looks are the most expensive transaction from systems processing perspective.
§  We make no money on “looks”, so saving resources by not processing these
transactions is important to both Pegasus and the downstream hotel systems.
§  …Hello Coherence….
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.44
Distribution Services and Coherence
Physical deployment:
–  Production cluster consists of 6 servers, 144GB RAM each.
–  Each server runs 3 storage enabled JVMs
–  Servers run Solaris x64
–  Each Hotspot JVM is 32GB
–  Using CMS collector, and having no GC pauses
–  The vast majority of the storage space is for AvailibilityCache (22GB) to service the “looks”
Client Applications
–  ~120 storage disabled clients either in containers or stand alone
–  Backing store is so large that NearCache is disabled
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.45
The problem…
§  The cache is too small. Empty to full in ~3 hours.
§  Evicting valuable, usable data
§  Cache hit rate is too low
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.46
The Challenge….
§  Increase the cache size on the current servers from 20M to 200M
§  Spend as little money as possible
§  Do it by EOY
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.47
The Process…
§  “spend as little as possible” means adding servers to reach 200M is not
possible, which means no more RAM.
§  Enter ElasticData
§  In terms of $, RAM > SSD > SATA, but is SATA fast enough?
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.48
iozone
§  Reads and writes a file to a filesystem as fast as it can
§  Compare SSD to SATA with regards to throughput
§  We know SSD is faster, but will SATA do?
www.iozone.org - Filesystem benchmark tool
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.49
SSD benchmark results
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.50
SATA benchmark results, part 1
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.51
SATA benchmark results, part 2
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.52
Elastic Data Hardware configuration
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.53
What we observe
§  At production volumes in RAM:
–  Avg get/put times ~2ms
§  At production volumes on SATA:
–  Avg put times ~3ms
–  Avg get times ~10ms
Benchmark data through the application
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.54
Hurdles We Have Overcome
§  Configuring the heap size:
–  Enough room to store keys for 1.6TB of objects, so that Full GCs do not
occur
–  Enough room to store puts() while partitions are being evicted
–  64GB (up to 72GB with G1)
§  Eviction killing throughput. Eviction process was reading the values from disk
at it evicted (for indexes and listeners). Behavior was changed with
BlindCompactSerializationCache.
§  Stopping a JVM: Transferring full partitions. Instead, drop the data, then
transfer (DropContentPartitionListener)
§  Starting a JVM: Rebalancing partitions to the new JVM.
(DropContentPartitionListener)
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.55
Configuring Coherence for Elastic Data
§  Operational overrides:
<journaling-config>
<ramjournal-manager>
<minimum-load-factor>.4</minimum-load-factor>
<maximum-size>8GB</maximum-size>
</ramjournal-manager>
<flashjournal-manager>
<minimum-load-factor>.7</minimum-load-factor>
<!-- 3.6TB filesystem size total / 2 JVMs is 1843GB each VM -->
<!-- That gives 511 files @ 3690MB each per JVM -->
<maximum-file-size>3690MB</maximum-file-size>
<collector-timeout>30m</collector-timeout>
<!-- 1600GB to force a more aggressive prune (same as high-units) -->
<high-journal-size>1600GB</high-journal-size>
</flashjournal-manager>
</journaling-config>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.56
Configuring Coherence for Elastic Data
§  Cache-config.xml
<distributed-scheme>
<backup-count>0</backup-count>
<partition-listener>
<class-name>com.tangosol.net.partition.DropContentPartitionListener</class-name>
</partition-listener>
<backing-map-scheme>
<ramjournal-scheme>
<class-name>com.tangosol.net.cache.BlindCompactSerializationCache</class-name>
<high-units>1600KB</high-units>
<low-units>1400KB</low-units>
<unit-calculator>Binary</unit-calculator>
<unit-factor>1048576</unit-factor>
</ramjournal-scheme>
</backing-map-scheme>
</distributed-scheme>
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.57
Garbage Collection settings
argv[12]: -XX:+UseG1GC
argv[13]: -XX:MaxGCPauseMillis=800
argv[14]: -XX:ConcGCThreads=10
argv[15]: -XX:ParallelGCThreads=10
argv[16]: -XX:InitiatingHeapOccupancyPercent=25
argv[17]: -XX:NewRatio=16
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.58
Did we meet our goals
§  Goal: 500M cached objects
–  Actual: 1.6B cached objects
§  Goal: Spend as little as possible
–  Actual: Spent 1400/machine (8640 total), 84x more objects
§  Goal: Do it by EOY
–  Actual: On track for production release before EOY
So far, so good…
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.59
Graphic Section Divider
Copyright © 2012, Oracle and/or its affiliates. All rights reserved.60

More Related Content

PDF
Spotlight private dns-oraclecloudservices
PDF
Search Analytics Business Value & NoSQL Backend
PDF
Oracle Cloud – Application Performance Monitoring
PDF
OOW-TBE-12c-CON7307-Sharable
PDF
Session 319
PDF
Oracle Data Protection - 1. část
PPTX
01 Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
PDF
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...
Spotlight private dns-oraclecloudservices
Search Analytics Business Value & NoSQL Backend
Oracle Cloud – Application Performance Monitoring
OOW-TBE-12c-CON7307-Sharable
Session 319
Oracle Data Protection - 1. část
01 Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
TechEvent 2019: Oracle to PostgreSQL - a Travel Guide from Practice; Roland S...

What's hot (20)

PPTX
Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
PPTX
OOW19 - HOL5221
PDF
Database@Home : The Future is Data Driven
PDF
Coherence 12.1.2 Hidden Gems
PDF
Database-as-a-Service with Oracle Enterprise Manager Cloud Control 12c and Or...
PDF
Oracle engineered systems executive presentation
PDF
AWR and ASH in an EM12c World
PDF
Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (1. část)
PDF
Oracle Database Availability & Scalability Across Versions & Editions
PDF
5 here today still here tomorrow new technology for big_forever_archives
PDF
Turning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
PPTX
Oracle database 12c_and_DevOps
PDF
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
PPTX
Oracle GoldenGate Performance Tuning
PPTX
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
PDF
Oracle RAC 19c with Standard Edition (SE) 2 - Support Update
PDF
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
PDF
JAX-RS 2.0: What’s New in JSR 339 ?
PPTX
Improve PostgreSQL replication with Oracle GoldenGate
PDF
Websocket 1.0
Ronald Vargas 18c cloud service el siguiente paso en la nueva generacion
OOW19 - HOL5221
Database@Home : The Future is Data Driven
Coherence 12.1.2 Hidden Gems
Database-as-a-Service with Oracle Enterprise Manager Cloud Control 12c and Or...
Oracle engineered systems executive presentation
AWR and ASH in an EM12c World
Oracle databáze - zkonsolidovat, ochránit a ještě ušetřit! (1. část)
Oracle Database Availability & Scalability Across Versions & Editions
5 here today still here tomorrow new technology for big_forever_archives
Turning Relational Database Tables into Hadoop Datasources by Kuassi Mensah
Oracle database 12c_and_DevOps
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Oracle GoldenGate Performance Tuning
Big Data Management System: Smart SQL Processing Across Hadoop and your Data ...
Oracle RAC 19c with Standard Edition (SE) 2 - Support Update
JAX-RS 2.0: New and Noteworthy in RESTful Web services API at JAX London
JAX-RS 2.0: What’s New in JSR 339 ?
Improve PostgreSQL replication with Oracle GoldenGate
Websocket 1.0
Ad

Viewers also liked (20)

PDF
Banche centrali
PPTX
Κλασική εποχή β'
PPTX
Samir Mesić prezentacija
PDF
WeB Početni sastanak - Igor Pandžić
PPTX
Ministarstvo prosvjete u kulture - Sanela Dojčinović
PPTX
Program Konferencije o IKT
PDF
Zakonsko okruženje kao preduslov razvoja informacionog društva - Igor Pandžić
PPTX
Od 09
PPTX
Caster111111111
PPTX
Radna snaga u it industriji - Brano Vujičić
PDF
Primjena informaciono-komunikacionih tehnologija u privrednim društvima kao b...
PPTX
Coherence 12.1.3 hidden gems
PPTX
Program Konferencije o IKT
PDF
Coherence 12.1.2 Live Events
PDF
Tasso di cambio reale
PDF
Zakonsko okruženje kao preduslov razvoja informacionog društva - Srđan Rajčević
PPTX
Prezentacija east code
PDF
Igor Pandžić prezentacija
DOCX
ραψωδία Ζ στ. 369 465
PDF
ICT prezentacija udruzenja
Banche centrali
Κλασική εποχή β'
Samir Mesić prezentacija
WeB Početni sastanak - Igor Pandžić
Ministarstvo prosvjete u kulture - Sanela Dojčinović
Program Konferencije o IKT
Zakonsko okruženje kao preduslov razvoja informacionog društva - Igor Pandžić
Od 09
Caster111111111
Radna snaga u it industriji - Brano Vujičić
Primjena informaciono-komunikacionih tehnologija u privrednim društvima kao b...
Coherence 12.1.3 hidden gems
Program Konferencije o IKT
Coherence 12.1.2 Live Events
Tasso di cambio reale
Zakonsko okruženje kao preduslov razvoja informacionog društva - Srđan Rajčević
Prezentacija east code
Igor Pandžić prezentacija
ραψωδία Ζ στ. 369 465
ICT prezentacija udruzenja
Ad

Similar to JavaOne-2013: Save Scarce Resources by Managing Terabytes of Objects off-heap or Even on Disk (20)

PPTX
GlassFish in Production Environments
PPT
Oracle storage best of-breed, best for oracle
PDF
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
PPTX
Things learned from OpenWorld 2013
PDF
MySQL Document Store - A Document Store with all the benefts of a Transactona...
PPT
Sparc solaris servers
PDF
Ebs troubleshooting con9019_pdf_9019_0001
PPTX
Simplify IT: Oracle SuperCluster
PDF
NoSQL and MySQL
PDF
Session 203 iouc summit database
PDF
Best Practices for Interoperable XML Databinding with JAXB
PPTX
Presentation oracle exalogic elastic cloud
PPTX
Tom Kyte and and Cary Milsap - 2013
PPTX
Con8833 access at scale for hundreds of millions of users final
PPTX
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
PDF
Oracle NoSQL
PPTX
The great 8 of ODA
PPT
Why_Oracle_Hardware.ppt
PDF
Exadata z pohledu zákazníka a novinky generace X8M - 1. část
PPTX
GLOC Keynote 2014 - In-memory
GlassFish in Production Environments
Oracle storage best of-breed, best for oracle
Multi-Tenancy: Da Teoria à Prática, do DB ao Middleware
Things learned from OpenWorld 2013
MySQL Document Store - A Document Store with all the benefts of a Transactona...
Sparc solaris servers
Ebs troubleshooting con9019_pdf_9019_0001
Simplify IT: Oracle SuperCluster
NoSQL and MySQL
Session 203 iouc summit database
Best Practices for Interoperable XML Databinding with JAXB
Presentation oracle exalogic elastic cloud
Tom Kyte and and Cary Milsap - 2013
Con8833 access at scale for hundreds of millions of users final
Oracle real time replica solution (Oracle GoldenGate) in Telco and FSI vertic...
Oracle NoSQL
The great 8 of ODA
Why_Oracle_Hardware.ppt
Exadata z pohledu zákazníka a novinky generace X8M - 1. část
GLOC Keynote 2014 - In-memory

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
MYSQL Presentation for SQL database connectivity
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
Building Integrated photovoltaic BIPV_UPV.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
CIFDAQ's Market Insight: SEC Turns Pro Crypto

JavaOne-2013: Save Scarce Resources by Managing Terabytes of Objects off-heap or Even on Disk

  • 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.1
  • 2. Use your current wisely Harvey Raja Oracle Chris Neal Pegasus
  • 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.3 §  Senior Engineer §  Oracle Coherence Introduction Harvey Raja
  • 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.4 §  Systems Architect §  Pegasus Solutions Introduction Chris Neal
  • 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.5 5 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle.
  • 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.6 What’s all this about? §  Big Data / Big Memory on a transistor diet §  Applications and conceived concerns §  Object Profiling §  Elastic Data §  Improvements
  • 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.7 Heap me up §  JVM manages our objects §  Understands Live Data –  References –  Free Lists new Object()
  • 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.8 Heap me up §  Two distinct regions of data locality –  Young Generation –  Old Generation §  Allows conscious distinction between: –  Long living objects –  Short lived objects
  • 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.9 Heap me up §  All memory allocations are against the same resource §  Why would it be any different? §  Provides means to access –  off-heap memory –  File Descriptors a.k.a. any resource
  • 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.10 Heap me up JVM 100% 0% 0%
  • 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.11 Applications & Their Objects §  Every application has very different uses of objects –  Size –  Scope §  Structures / Containers –  Structures {Containers} –  Containers {Structures}
  • 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.12 Application Object Profiles §  Ye olde faithful… Pet Store §  Short-lived objects –  Search Results §  Long-living objects –  Popular items JEE Pet Store JEE Pet Store JEE Pet Store JEE Pet Store Pet Store
  • 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.13 Application Object Profiles §  Foreign Exchange Position Keeping §  Aggregate Trades Values per currency pair §  Some currencies are a ‘busier’ §  Currencies may have varying SLAs FX Position Keeping T T T T USD-GBP USD-EUR T T T T T T T T T T T T
  • 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.14 What we know about applications? §  The application understands more about each object than the JVM –  Frequency –  Size §  Keeping everything in RAM is possible but is it efficient? §  Huge Leap between Object on heap & stored in DB -  Recency -  Custom characteristics of the object
  • 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.15 Can the JVM just make the right choice? §  The JVM would have to span multiple devices §  Non-Heap must be serialized §  Applications are diverse therefore to make generic decisions on object usage would likely lead to false-positives §  Down to the application or a layer above the JVM allowing users to define resource assignment policies
  • 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.16 Municipality §  The application deems its own usage of each resource §  JVM provides primitives to load & store to these devices §  May be useful to have an API that performs this storage appropriate to the device: –  Routing stores to appropriate device –  Handle concerns of multiple applications on the same JVM
  • 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.17 CPU Architectures §  As latency increases so does capacity §  Data fetched as required by instructions §  Data is demoted as well as writes to shared data rippling through the caches
  • 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.18 CPU Architectures Speed Capacity Registry 1ns 0.00 L1 Cache 2-5ns 2x32KB L2 Cache 5ns 256KB L3 Cache 20ns 8MB Main Memory 20-60ns 16GB Nehalem2GHZ processor Mayfair Kensington Camden Wimbledon Manchester §  Perhaps we should charge our objects rental premiums?
  • 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.19 Blank Canvas £600pcm £1800pcm £2400pcm £100000pcm £100 Per TimeUnit £500 Per TimeUnit £250 Per TimeUnit £1000 Per TimeUnit
  • 20. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.20 How do you choose the right property? §  How do you select the right property: –  How often are you in the office? –  How long does it take you to get into the office? –  How much space do you occupy in the office? –  How do you get to the office? –  MFU –  Device latency –  Object size –  Every device has its own quirks
  • 21. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.21 Translated to memory USD -> GBP USD-> JMD Heap RAM (off heap) Disk GBP -> MUR Usage Pet store example Pedigree Chum Orijen Dog Ugg boots
  • 22. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.22 Translated to memory §  Objects held on heap are: –  Structures (Containers) –  Containers (Structures) §  Similar to a file descriptor, each object has its own metadata: –  Access Time –  Modified Time §  With ((Map) Containers) we already have a location to store metadata -  Size -  Touch Count
  • 23. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.23 Translated to memory CPU Heap NIO Flash Mechanical Disk §  Each object has metadata §  Some policy can manage these objects §  Demoted & promoted to the various media types §  Big jump from heap to NIO
  • 24. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.24 Brainstorm Summary §  Cherish your high commodity investments §  Reduce the regularity of going to a highly contended foreign resource §  Would be ideal to have objects float between high latency resources using a telepathic API –  Having some metadata could drive our decision for data locality §  Map provides a nice abstraction for objects that should ripple
  • 25. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.25 Challenges §  Serialization cost §  Generally interactions are performed against the object form §  False Positives §  Device type peculiarities §  A handle to the object (key) and metadata must be held on heap
  • 26. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.26 Elastic Data §  A Feature in Coherence §  Store binary key and value objects in RAM or Disk §  Overflow from RAM to Disk §  RAM can be configured as NIO store(byte[] key, byte[] val) load(byte[] key) erase(byte[] key) RAM Flash
  • 27. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.27 Elastic Data §  Its simply writing a number of bytes to some stream? §  How do you maintain handles? §  Need a pointer to the written data? §  How about updates, seek & replace? Easy Peasy
  • 28. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.28 Elastic Data §  Require a compact structure to hold handles (keys) to device pointers §  Journal writes to the file system §  Consistent API regardless of write to RAM, NIO, Flash or Mechanical Disk §  Buffer writes with thread dedicated to writing Implementation Details
  • 29. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.29 Elastic Data FlashJournal RAMJournal Collector Overflow Preparer Writer Binary Key Pointer 00110101001 11001001011 ... ... Serialize 110101 LFU Collector Store Index Object deemed unworthy of Heap store(key, value)Pointer returned Create
  • 30. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.30 Elastic Data FlashJournal RAMJournal Collector Overflow Preparer Writer Binary Key Pointer 00110101001 11001001011 ... ... Collector Store Index Deserialize 110101 Deserialized object returned load(pointer)binary value The binary key provides the physical location of the stored item Read
  • 31. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.31 Elastic Data Elastic Data 100% 100% 100% Utilization
  • 32. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.32 Elastic Data §  RAM Journal can be used with NIO ByteBuffers –  Memory managed using same mechanisms between RAM & Flash §  Consider device specifics prior to use and design components / interactions accordingly §  Multi-threaded clients §  Flash vs Mechanical More Features
  • 33. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.33 Elastic Data §  Several platters & reading / writing heads §  Faraday & Lorentz §  Seek time + Rotational Latency = L §  Can not get to the same speeds as the disk controllers Mechanical Media
  • 34. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.34 Elastic Data §  NAND gates §  MLC §  Write in pages erase in blocks §  No Seek Time or Rotational Latency Flash Media
  • 35. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.35 Elastic Data JVM handle * handle * handle * handle * handle * 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 0111011100110110101 0111010110100110101 handle *(disk pointer) HARRIET * HARVEY * HILARY * HILTON * Handles are stored in process Number of handles constrains amount of data that can be stored Key Management
  • 36. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.36 Elastic Data H AR RIET VEY IL ARY TON HARRIET HARVEY HILARY HILTON 1 2 4 8Tickets: §  Data structure to hold handles is a Binary Radix Tree –  allows sharing of common denominators §  Handles (keys) are stored in serialized form §  Benefit increases as common bytes increase and less heap memory is used
  • 37. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.37 Elastic Data §  Writes are journalled §  Erase is a logical removal §  Update = erase + write §  Avoids seek time or cascading pointer changes write write write APPEND APPEND APPEND erase 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 010111001 101111010 100111010 100111100 File 1 File 2 File 3
  • 38. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.38 Elastic Data §  Require a Journal Garbage Collector –  Reclaim unreferenced memory §  Evacuation process for each file §  Eviction logically removes from Journal File §  May enter an exhaustive mode –  Synonymous to Full GC 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 1001110 100111100 010111001 101111010 100111101 110011000 Journal Collector sort evacuate (exhaustive- mode)
  • 39. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.39 Elastic Data §  Dedicated threads to unblock writes –  Tuned to device type §  Client write appears to be as fast as heap write §  Overwhelming number of writes will result in push back to the client Preparer Buffer Writer
  • 40. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.40 Who am I? §  Chris Neal, Systems Architect §  Started with Pegasus in 1994 §  Worked with Coherence since 3.3.1 in 2007 §  Participate in Coherence CAB
  • 41. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.41 Who is Pegasus Solutions? §  Founded in 1988 §  Provide technology and services to hotels and travel distributors §  Three main service areas: –  Representation Services –  Distribution Services –  Central Reservation Services (CRS)
  • 42. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.42 Distribution Services –  Connects hotel systems with distribution partners. –  100,000 hotels connected to all major distributors (Expedia, Orbitz, Hotwire, Travelocity, etc) –  Cheaper and easier than a direct connect –  If you book a hotel online, chances are your transaction goes through Pegasus. –  Pegasus processes roughly 8 billion transactions per month… sustained ~3000TPS @200ms latency or less.
  • 43. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.43 Why do we need a cache? §  In travel agent days, “Look to book” ratios were 3:1 §  At internet scale, they are roughly 4200:1 –  Travel aggregators like Sidestep, Kayak, Mobissimo, etc burst this to >100,000:1 §  Looks are the most expensive transaction from systems processing perspective. §  We make no money on “looks”, so saving resources by not processing these transactions is important to both Pegasus and the downstream hotel systems. §  …Hello Coherence….
  • 44. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.44 Distribution Services and Coherence Physical deployment: –  Production cluster consists of 6 servers, 144GB RAM each. –  Each server runs 3 storage enabled JVMs –  Servers run Solaris x64 –  Each Hotspot JVM is 32GB –  Using CMS collector, and having no GC pauses –  The vast majority of the storage space is for AvailibilityCache (22GB) to service the “looks” Client Applications –  ~120 storage disabled clients either in containers or stand alone –  Backing store is so large that NearCache is disabled
  • 45. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.45 The problem… §  The cache is too small. Empty to full in ~3 hours. §  Evicting valuable, usable data §  Cache hit rate is too low
  • 46. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.46 The Challenge…. §  Increase the cache size on the current servers from 20M to 200M §  Spend as little money as possible §  Do it by EOY
  • 47. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.47 The Process… §  “spend as little as possible” means adding servers to reach 200M is not possible, which means no more RAM. §  Enter ElasticData §  In terms of $, RAM > SSD > SATA, but is SATA fast enough?
  • 48. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.48 iozone §  Reads and writes a file to a filesystem as fast as it can §  Compare SSD to SATA with regards to throughput §  We know SSD is faster, but will SATA do? www.iozone.org - Filesystem benchmark tool
  • 49. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.49 SSD benchmark results
  • 50. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.50 SATA benchmark results, part 1
  • 51. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.51 SATA benchmark results, part 2
  • 52. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.52 Elastic Data Hardware configuration
  • 53. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.53 What we observe §  At production volumes in RAM: –  Avg get/put times ~2ms §  At production volumes on SATA: –  Avg put times ~3ms –  Avg get times ~10ms Benchmark data through the application
  • 54. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.54 Hurdles We Have Overcome §  Configuring the heap size: –  Enough room to store keys for 1.6TB of objects, so that Full GCs do not occur –  Enough room to store puts() while partitions are being evicted –  64GB (up to 72GB with G1) §  Eviction killing throughput. Eviction process was reading the values from disk at it evicted (for indexes and listeners). Behavior was changed with BlindCompactSerializationCache. §  Stopping a JVM: Transferring full partitions. Instead, drop the data, then transfer (DropContentPartitionListener) §  Starting a JVM: Rebalancing partitions to the new JVM. (DropContentPartitionListener)
  • 55. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.55 Configuring Coherence for Elastic Data §  Operational overrides: <journaling-config> <ramjournal-manager> <minimum-load-factor>.4</minimum-load-factor> <maximum-size>8GB</maximum-size> </ramjournal-manager> <flashjournal-manager> <minimum-load-factor>.7</minimum-load-factor> <!-- 3.6TB filesystem size total / 2 JVMs is 1843GB each VM --> <!-- That gives 511 files @ 3690MB each per JVM --> <maximum-file-size>3690MB</maximum-file-size> <collector-timeout>30m</collector-timeout> <!-- 1600GB to force a more aggressive prune (same as high-units) --> <high-journal-size>1600GB</high-journal-size> </flashjournal-manager> </journaling-config>
  • 56. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.56 Configuring Coherence for Elastic Data §  Cache-config.xml <distributed-scheme> <backup-count>0</backup-count> <partition-listener> <class-name>com.tangosol.net.partition.DropContentPartitionListener</class-name> </partition-listener> <backing-map-scheme> <ramjournal-scheme> <class-name>com.tangosol.net.cache.BlindCompactSerializationCache</class-name> <high-units>1600KB</high-units> <low-units>1400KB</low-units> <unit-calculator>Binary</unit-calculator> <unit-factor>1048576</unit-factor> </ramjournal-scheme> </backing-map-scheme> </distributed-scheme>
  • 57. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.57 Garbage Collection settings argv[12]: -XX:+UseG1GC argv[13]: -XX:MaxGCPauseMillis=800 argv[14]: -XX:ConcGCThreads=10 argv[15]: -XX:ParallelGCThreads=10 argv[16]: -XX:InitiatingHeapOccupancyPercent=25 argv[17]: -XX:NewRatio=16
  • 58. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.58 Did we meet our goals §  Goal: 500M cached objects –  Actual: 1.6B cached objects §  Goal: Spend as little as possible –  Actual: Spent 1400/machine (8640 total), 84x more objects §  Goal: Do it by EOY –  Actual: On track for production release before EOY So far, so good…
  • 59. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.59 Graphic Section Divider
  • 60. Copyright © 2012, Oracle and/or its affiliates. All rights reserved.60