• Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
813
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
13
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Performance for Product Developers Matthew WilkesFriday, 12 October 12 1
  • 2. Who am I? • Performance and security work at the Code Distillery • Framework and security teams, membership committee • Foundation board memberFriday, 12 October 12 2
  • 3. Who am I? • Zope / Plone core developer • Silly accent. Sorry. • Not a morning person. Sorry.Friday, 12 October 12 3
  • 4. Performance… • Plone is pretty damn fast • Low edit sites are really easy to make fly • Runs fine on a 256mb VMFriday, 12 October 12 4
  • 5. Performance… • plone.app.caching takes about 5 minutes to configure • Add Varnish and it goes really rather quick • Writing is harderFriday, 12 October 12 5
  • 6. Performance…Friday, 12 October 12 6
  • 7. … for Product Developers?Friday, 12 October 12 7
  • 8. … for Product Developers • Security isn’t the sole responsibility of the integrator • Neither is performance • Everyone is careful about the code they writeFriday, 12 October 12 8
  • 9. some even over do itFriday, 12 October 12 9
  • 10. Recap • Don’t add things to the catalog if you can help it • If you have to, use an indexer, not just a raw FieldIndexFriday, 12 October 12 10
  • 11. Recap • Build your types on Dexterity, not Archetypes • If you’re not sure what structure to use for your data, the answer is OOBTreeFriday, 12 October 12 11
  • 12. Recap • Avoid big object churn by keeping Lengths of things you need • Find a balance between huge objects and annotation soupFriday, 12 October 12 12
  • 13. Recap • If you see for loops inside for loops you’re probably missing a simpler way • Don’t forget sets and itertools, they’re goodFriday, 12 October 12 13
  • 14. … for Product Developers • Very few people are using the tools we have available • Equally true for publicly available products as for policiesFriday, 12 October 12 14
  • 15. Who’s used this?Friday, 12 October 12 15
  • 16. You guys! Seriously‽Friday, 12 October 12 16
  • 17. Access time for a browser view through Varnish 80ms 23 60ms 56 processing connect 40ms 20ms 0ms 0 without cache:ruleset with cache:ruleset I love this chartFriday, 12 October 12 17
  • 18. plone.app.caching • Assign caching rules directly to contexts by interface • Can map to an operation, like plone.app.caching.strongCaching • or to a ruleset, like plone.content.itemViewFriday, 12 October 12 18
  • 19. psst, integrators! • You can have commit access today • If your favourite product doesn’t have rulesets defined, add them • I’ll bring “I cleaned up your mess” stickers to BrasíliaFriday, 12 October 12 19
  • 20. Edge Side Includes photo (c) http://www.flickr.com/photos/fornal/Friday, 12 October 12 20
  • 21. ESIs • Varnish is your friend • Lets integrators do page composition • but easy to leak dataFriday, 12 October 12 21
  • 22. Friday, 12 October 12 22
  • 23. ESI • Suddenly, cache hits for logged in users! • aaaand, cache hits on private pages for anonymous • Really rather badFriday, 12 October 12 23
  • 24. ESI • Set ETags to roles|lastModified? • ETags can be faked • Still leaks dataFriday, 12 October 12 24
  • 25. ESI • Integrators will still have to segment their cache manually • Hard work • A lot easier if add-ons are written with this in mindFriday, 12 October 12 25
  • 26. ESI • Plan your templates for eventual ESIs • Many small templates is appropriate, lets them be customisedFriday, 12 October 12 26
  • 27. ESI • If there is a block of markup that is mostly static but uses the user in some bit, make sure that’s separated out • Integrators shouldn’t need more than a few minutes to add ESI to your templatesFriday, 12 October 12 27
  • 28. Testing caching photo (c) http://www.flickr.com/photos/alisdair/Friday, 12 October 12 28
  • 29. Testing • Far too few people run automated tests on their caching • Well, far too few people run automated tests at allFriday, 12 October 12 29
  • 30. Testing • If you have plone.app.testing based tests already it’s easyish • Create a new layer using a ZServer and start up Varnish • Make some testbrowser callsFriday, 12 October 12 30
  • 31. Things that need buildingFriday, 12 October 12 31
  • 32. Utility packages • We need helper classes and methods for writing caching tests • Actual tests in popular packages, as examplesFriday, 12 October 12 32
  • 33. Rulesets • The current plone.app.caching rulesets are integrator focused • We need some standard ones for product developers to useFriday, 12 October 12 33
  • 34. The Code Distillery Bristol Questions? Want help putting this into practice? sales@thedistillery.euFriday, 12 October 12 34