magnolia performance tuning and high availabilty best practices

18
If you're not failing 90% of the time, then you're probably not working on sufficiently challenging problems.

Post on 18-Oct-2014

188 views

Category:

Software


3 download

DESCRIPTION

Mark Korthaus from Syseleven talks about the challenges of running, tuning and scaling a Magnolia platform. He explores caching and high availability best practices and will provide a deeper insight into the infrastructure side of things.

TRANSCRIPT

Page 1: Magnolia Performance Tuning and High Availabilty Best Practices

If you're not failing 90% of the time, then you're probably not working on

sufficiently challenging problems.

Page 2: Magnolia Performance Tuning and High Availabilty Best Practices

High Performance and Scalability with MagnoliaMarc Korthaus

CEO SysEleven GmbH

Magnolia Conference 2014

Page 3: Magnolia Performance Tuning and High Availabilty Best Practices

About SysEleven Born out of a macnews.de (1997 - 2010†)

Founded 2007 in Berlin, 2 datacenters, 50 people (40+ engineers), ISO 27001, Akamai Partner, SuperCache Developer, specialized in Application Management, fully virtualized datacenter, a lot of big iron

„If there are two or more ways to do something, and one of those ways can result in a catastrophe, then someone will do it.“

Page 4: Magnolia Performance Tuning and High Availabilty Best Practices

Why yet another Hosting Company?

• Way to expensive offers from enterprise hosters

• nobody offered application expertise for scaling applications

• strict budget but application knowledge

• … pressure makes diamonds

Page 5: Magnolia Performance Tuning and High Availabilty Best Practices

But some definitions first…

Scalabilty … is horizontal aka means capacity, serve more users at the same time, reached

via clustering (Session sharing, Shared Storage, Load balancing etc.),

Performance … is vertical, is about zippiness, means to optimize for time to first byte and general load time, needs bigger iron, caching (much cheaper, just do it) and

application optimization (a must).

!

Page 6: Magnolia Performance Tuning and High Availabilty Best Practices

… which actually means:

Capacity (Our job)

Performance (your job)

Page 7: Magnolia Performance Tuning and High Availabilty Best Practices

Typical CMS Setup

Page 8: Magnolia Performance Tuning and High Availabilty Best Practices

Clustered Magnolia Setup

Page 9: Magnolia Performance Tuning and High Availabilty Best Practices

Typical eCommerce Server Setup

MySQL Master

F5 Loadbalancer

Shared Storage

MySQL-Replikation

Application Cluster

SuperCache (NginX & Couchbase)

MySQL Slaves

DB Writes DB Reads

Prudsys Server

FACT Finder Cluster

Cache API

Backend & Syslog

Search

Application Server

Shared Storage

DBS

Log Processing

Recommendation Engine

Cache Frontend

Loadbalancing

Caching API

DBM

Page 10: Magnolia Performance Tuning and High Availabilty Best Practices

How to improve Performance

• „Normally“ bigger Iron will help, doesn´t really help with bad Application code

• SSDs (SAS vs. PCI cards), higher CPU frequency per Thread, more memory

• General approach: Optimize for „time to first byte“

• Database Tuning (slow query, read from slave, write to master)

• Profile your application: NewRelic, JProfiler, hprof, AppDynamics, DynaTrace

• Caching, Caching and Caching

Page 11: Magnolia Performance Tuning and High Availabilty Best Practices

Scalabality & Clustering• JackRabbit on different nodes for author and app server (you already knew that)

• Big Iron is good, too(Hardware Loadbalancers, Web Application Firewalls, DDoS-Protection incl.)

• High Performance Shared Storage (go with NetApp or Isilon - don´t even think of working with Linux NFS servers!)

• Database clusteringMaster/Master & Master/Slave, maybe even sharding?

• Elasticity, automatic deployment (Puppet, Chef, Go), DevOps in general

Page 12: Magnolia Performance Tuning and High Availabilty Best Practices

Caching: Ehcache, Varnish & SuperCache

• Good ol’ Ehcache is active by default (so good so far)

• Passive Caching (Varnish)serving full pages (or snippets via ESI), no advanced flushing out of the box, needs a lifetime per URL, no shared memory backend per instances, no warm restart, slow start is painful

• Active Caching (SuperCache)separates memory backend, infinite Cache Lifetime, active flushing via mapping service, API based, full flexibility

• Best is: Client for Magnolia is in development

Page 13: Magnolia Performance Tuning and High Availabilty Best Practices

SuperCache in detail

Hardware Loadbalancer

http-Request

Proxy incl. API(NginX + Lua)

Cache Memory Backend(Couchbase Server)

MagnoliaApplication Servers

Magnolia Authoring Server

Hit

Miss Tag

Page 14: Magnolia Performance Tuning and High Availabilty Best Practices

SuperCache - What´s in for you

• RESTful API (not for a single Application), mapping & tags per cache item

• infinite Cache Lifetime, no cold cache, even after startup

• memory & disk backend, multi level scalability

• DDoS proof, very little CPU resources are used (2 Threads)

• ESI as a way to combine content of different applications

• HTTP Layer 7 Manipulation

Page 15: Magnolia Performance Tuning and High Availabilty Best Practices

Cache hit rates

Customer C

MISS 29 %

HIT 71 %

Measure your Hitrate!

Customer B

MISS 87 %

HIT 13 %

Customer A

MISS!50 %

HIT!50 %

Page 16: Magnolia Performance Tuning and High Availabilty Best Practices

How to ruin your cache hit rate

• Put sessions in URL

• Do lot of AB-Testing (and implement it lousy)

• make a lot of content updates (≥ thousands of updates per day)

• not having a page with content but a search only site(…yes, it´s a trend: „Don´t use a CMS, just do a search!“)

Page 17: Magnolia Performance Tuning and High Availabilty Best Practices

Time to first byte

Application

some other cache :-)

SuperCache

0,00 Sec. 0,50 Sec. 1,00 Sec. 1,50 Sec. 2,00 Sec.

Page 18: Magnolia Performance Tuning and High Availabilty Best Practices

If you're not failing 90% of the time, then you're probably not working on

sufficiently challenging problems.