69
8 PERFOMANCE TIPS FOR MARATHON

8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

8 PERFOMANCE TIPS FORMARATHON

Page 2: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

TOMASZ JANISZEWSKIJANISZTJANISZ

Page 3: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 4: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 5: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

xxx active usersxxx itemsxxx transactions per minute1 Country (Poland)

Page 6: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

xxx servicesxxx agents2 Datacenters1 Framework (Marathon)

Page 7: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

METRICS

Page 8: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

— Release Notes: v0.13.0

We collect a lot of metrics in Marathon. You can collectthose metrics via the /metrics endpoint. With those

reporters you can transfer the data into either Graphiteor DataDog and see the values over time.

Page 9: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 10: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

--reporter_graphite=tcp://localhost:2003?prefix=marathon-test&interval=10

Page 11: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 12: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

--reporter_graphite=tcp://localhost:2003?prefix=marathon-test&interval=55

Page 13: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 14: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 15: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 16: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 17: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 18: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

PROFILING

Page 19: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

The Honest ProflierVisualVMFlamegraphs

Page 20: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

JVM

Page 21: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

GC

Page 22: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

-XX:+PrintTenuringDistribution

-XX:+PrintGC

-XX:+PrintGCDetails

-XX:+PrintGCTimeStamps

-XX:+PrintGCApplicationStoppedTime

-Xloggc:/var/log/marathon/gc.log

-XX:+UseGCLogFileRotation

-XX:NumberOfGCLogFiles=2

-XX:GCLogFileSize=50M

Page 23: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

-XX:InitialHeapSize=4294967296

-XX:MaxHeapSize=6442450944

-XX:MetaspaceSize=104857600

-XX:+UseG1GC

Page 24: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

AKKA

Page 25: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Throughput defines the maximum number ofmessages to be processed per actor before the threadjumps to the next actor. Set to 1 for as fair as possible.

Page 26: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

-Dakka.default-dispatcher.throughput=20

Page 27: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

THREADS

Page 28: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

// src/main/scala/mesosphere/marathon/Main.scala

setIfNotDefined("scala.concurrent.context.minThreads", "5")

setIfNotDefined("scala.concurrent.context.numThreads", "x2")

setIfNotDefined("scala.concurrent.context.maxThreads", "64")

Page 29: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

// src/main/scala/mesosphere/util/ThreadPoolContext.scala

private val numberOfThreads: Int = System

.getProperty("numberOfIoThreads", "100").toInt

Page 30: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

64 + 100 = ????

Page 31: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

64 + 100 ≈ 2000

Page 32: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

64 + 100 = O( TASKS)

Page 33: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 34: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

ZOOKEEPER

Page 35: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

SIZE

Page 36: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

--zk_max_versions=3

Page 37: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

422 - Failed to deploy app [/really/important/app] to [prod].

Caused by: (http status: 422 from https://production).

RESPONSE: [{

"message":"Object is not valid",

"details":[{

"path":"/",

"errors":[

"The way we persist data in ZooKeeper would exceed the maximum ZK node

size (1024000 bytes). You can adjust this value via --zk_max_node_size,

but make sure this value is compatible with your ZooKeeper ensemble!

See: http://zookeeper.apache.org/doc/r3.3.1/zookeeperAdmin.html#Unsafe+Opt

]

}]

}]

Page 38: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

--zk_max_node_size=2024000

Page 39: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

-Djute.maxbuffer=2024000

Page 40: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

jute.maxbuffer: This option can only be set as a Java system property. There is nozookeeper prefix on it. It specifies the maximum size of the data that can be stored in a

znode. The default is 0xfffff, or just under 1M. If this option is changed, the systemproperty must be set on all servers and clients otherwise problems will arise. This is

really a sanity check. ZooKeeper is designed to store data on the order of kilobytes insize.

Page 41: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

ZooKeeper is designed to store data onthe order of kilobytes in size.

Page 42: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

— Introducing Marathon 1.4, Joerg Schad, March 29, 2017

“In version 1.4, Marathon stores agroup only with references in order to

keep node size under 1 MB.”

Page 43: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 44: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 45: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

WRITES

Page 46: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

LATENCY

Page 48: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

NOOP optimization: the fastestoperation you can possibly perform is

no operation at all.

Page 49: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

HEALTHCHECKS

Page 50: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

Page 51: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

Page 52: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

Page 53: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

— Introducing Mesos-native health checks in Apache Mesos – Part II, Gaston Kleiman, January 17, 2017

“Marathon could handle only up to3700 tasks with Marathon TCP health

checks”

Page 54: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

— Introducing Mesos-native health checks in Apache Mesos – Part II, Gaston Kleiman, January 17, 2017

“when using Marathon HTTP checks,we found out that Marathon started to

report health failures and returnerrors to the API requests when the

cluster reached the 1900 tasks mark”

Page 55: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

EVENTS

Page 56: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

CALLBACKsends every eventsome evets are big (≥ 10 MB)deprecated

Page 57: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 58: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 59: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

PLUGINS

Page 60: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

Page 61: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

F A C A D E

Page 62: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

SHARDING

Page 63: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

F A C A D E

Page 64: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

Marathon

F A C A D E

Marathon

Marathon

Page 65: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

MARATHON 1.4+

Page 66: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 67: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)
Page 68: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

It was a "soft" release. It is the version of Marathon that is at theroot of DC/OS 1.10 that was released. Full announcement tofollow.15:07 - 9.09.2017

1

9 wrz.not @janiszt

@kensipe @mesosphere Is this official Marathon 1.5 release? It'smissing release notes. github.com/mesosphere/mar…

Ken Sipe @kensipe

Obserwuj

Page 69: 8 PERFOMANCE TIPS FOR MARATHON - …€¦ · xxx activ e users xxx items xxx transactions per minut e 1 Countr y (Poland)

1. Shard your marathon2. Monitor — enable metrics3. Update to 1.3.13*4. Minimize Zookeeper latency5. Tune JVM6. Do not use the event bus7. Use a custom executor8. Prefer batch deployments to many individual ones

janiszt