Top Banner
29

Mistakes Made and Lessons Learnt Scaling Plone post-Launch

May 08, 2015

Download

Technology

Matt Hamilton

This is a run down of the mistakes we made and the lessons we learnt trying to scale a big Plone site with un-anticipated traffic once the site had gone live and the budget all been spent. Find out what we did wrong, and how we fixed it.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mistakes Made and Lessons Learnt Scaling Plone post-Launch
Page 2: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Matt Hamilton&

Matt Sital-Singh

Page 3: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Background0

Page 4: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• Learning Management-type system

• A lot of content

• Users ‘editing’ content, but not necessarily aware of it

• Lots of ‘clustering’ of load on resources

Use Case

Page 5: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Scale

• Plone 3

• User accounts: 30,000

• Messages: 160,000

• Course questions: 260,000

• Other: 60,000

Page 6: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Don’t Create Ghost Content1

Page 7: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• User perception of speed

• If they expect a ‘read’ they want a ‘read’- user signups- course starting

• Will accept a delay if you are actually processing something

Page 8: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Use Optimization Products2

Page 9: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• experimental.catalogqueryplan

• experimental.contentcreation

• experimental.daterangeindexoptimisations

• experimental.aggressiveopaquespeedup

• collective.indexing

Page 10: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

One Plone site or Multiple?3

Page 11: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• One Plone site per ‘site’

• Multiple ‘sites’ per Plone site

• Common content?

Page 12: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Large Catalogs are Slow4

Page 13: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• We had 260,000 questions

• each had 2-4 answers

• = 520,000 - 1,400,000 answers

All in portal_catalog!

Page 14: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Optimize your Catalogs5

Page 15: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• Pre-load Catalog Queryplan

• Balance your BTrees

Page 16: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

1319817170

1319817198

1319730857

1319126057

1308585257

effective date index:

Page 17: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

1308585257

1319126057

1319730857

1319817170

1319817198

Page 18: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• Used catalog multiplexer to assign ‘Answer’ content type to dummy catalog

• Moved messages to separate message_catalog

• Monkey-patch items out of the catalog?

Page 19: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

If You Know Where Something Is - Don’t

Search for it6

Page 20: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• Got into bad habit of using the catalog ALL the time

• Don’t just blindly use catalog when unrestrictedTraverse / contentValues will do

• RAM is cheap, user patience is NOT

Page 21: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Use unrestrictedSearchResults

if possible7

Page 22: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• unrestrictedSearchResults does not check:

• effective index

• allowed_roles_and_users index

➡ A lot less work for the catalog to do

Page 23: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Is Plone the Right Tool?8

Page 24: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• “When you have a hammer, everything looks like a nail...”

• A lot of this data is relational...

• Not much of it is CMSish

• Maybe should have used Pyramid?

Page 25: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Use Event Driven Workflow

(Don’t recalculate)9

Page 26: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• User rating / Course ranking

• Use workflow event subscribers, don’t re-calculate on view every time

Page 27: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Some things don’t need to be immediate10

Page 28: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

• “You have 10 new messages”

• Not everything has to be updated all the time in every location on the site

Page 29: Mistakes Made and Lessons Learnt Scaling Plone post-Launch

Matt HamiltonMatt Sital-Singh

Plone Conference 2011San Francisco

Thanks!