Deploying Plone applications is about more than getting a Zope instance running and Apache installed. In this talk I show what we do at current big projects and how we think small projects can benefit.
13. Platform
Application
Components
Management
Automation
Monitoring
Support OS
Virtualization
Hardware
Data center
Tuesday, October 16, 12
14. Virtualization OS
Components
• Virtualization is very
affordable
• Platform creates
interface between app
and infrastructure
Tuesday, October 16, 12
15. Platform
Application
Components
Management
Automation
Monitoring
Support OS
Virtualization
Hardware
Data center
Tuesday, October 16, 12
16. Automation
• convergence
• idempotency
• versioning
• everything as code
• continuous repairs
Tuesday, October 16, 12
17. Platform
Application
Components
Management
Automation
Monitoring
Support OS
Virtualization
Hardware
Data center
Tuesday, October 16, 12
18. Management
• Take care of updates and “production-
ready” configuration
• Backup and other day-to-day operations
• OS and regularly used components
• Gradual process moving components from
user-space installations to platform-wide
features
Tuesday, October 16, 12
19. Platform
Application
Components
Management
Automation
Monitoring
Support OS
Virtualization
Hardware
Data center
Tuesday, October 16, 12
29. Components
good bad
nginx apache
varnish mysql, BDB
haproxy OpenLDAP
PostgreSQL
memcached
supervisor
postfix
Tuesday, October 16, 12
30. Minimal "production-
ready" checklist
• Sane front-end configuration
• System startup/shutdown
• Log rotation
• Database maintenance
• Monitoring: processes and ports
• Service user
Tuesday, October 16, 12
31. Secrets
• One AES-encrypted config file per
environment
• Transparent decryption
• Safety-belt to avoid accidental checking in
unencrypted files
• Future: PGP-encryption
Tuesday, October 16, 12
32. Environments
• Production vs. Staging
• Structurally identical but smaller
• Only one of many (dev, integration, ...)
• "Fly what you test, test what you fly."
Tuesday, October 16, 12
33. Web applications
• Shared nothing in your app!
• Many small processes
• Do not listen early
• Never store runtime config in the database
Tuesday, October 16, 12
34. Web applications II
• Log long running requests
• Avoid synchronous external requests
• Avoid accidental write requests.
• Use feature switches.
Tuesday, October 16, 12
35. Process control
• only one component to
integrate
• turn anything into a
daemon
• use superlance (httpok,
memmon) for active
restarts
• use 3.0 release candidate
Tuesday, October 16, 12
36. Python: virtualenv and
buildout
• use both, combined
• buildout might be a hammer, but not
everything is a nail
Tuesday, October 16, 12
37. more buildout
• use extends to keep your configs clean and
structured
• allow-picked-versions=False
• -t 3
• buildout >= 1.6
• mr.developer
• allowed-hosts = ...
Tuesday, October 16, 12
38. and even more buildout
• multiple small better than one big
• different Python versions
• different subsets of egg versions
• use mirrors - see pypi-mirrors.org
• latency to the PyPI server is the biggest
factor in buildout performance
Tuesday, October 16, 12
39. Databases
• As much RAM as you can afford - seriously
• Low latency network (<0.1ms)
• Multi-core if necessary
• Disk usage < 40%
Tuesday, October 16, 12
40. story: more hardware =
slower
• Application is slow.
• Customer buys more hardware.
Specifically: RAM.
• System is slower now.
• System runs many components. Hard to
see through.
Tuesday, October 16, 12
41. story: more hardware =
slower
• One number stands out: process exit rate
is 20/sec. PosgreSQL. What?
• Customer creates new connection for
each query.
• PostgreSQL forks master for new
connection.
• Fork went from few 10ms to few 100ms
Tuesday, October 16, 12
42. story: more hardware =
slower
• Diagnose. Find root cause.
Tuesday, October 16, 12
43. HTTP/S termination
• HTTP and SSL
• Virtual hosting
• Redirects
• host normalization
• Proxy to load balancer
• Static files
Tuesday, October 16, 12
47. SLAs
• Availability
• more keeps your business safe
• less reduces costs
• Friends don't let friends think in "nines".
• Alignment of technical and organisational
measures
Tuesday, October 16, 12
48. References
• "The practice of system and network
administration" (Limoncelli, et. al.)
• Mark Burgess on config management
• "The twelve-factor app" (Heroku)
• gocept.net/doc
Tuesday, October 16, 12
49. Conclusion I
• Use infrastructure to build platforms
• Platforms should be transparent.
• Deploy applications on platforms.
Tuesday, October 16, 12
50. Conclusion II
• Do not cobble together random stuff from
the internet.
• Careful work pays. Buzzwords don't.
• If you hear "enterprise". Run.
• Sapere aude.
Tuesday, October 16, 12
51. Conclusion III
• I don't think IaaS and PaaS in the current
extremes are a good answer to many
projects.
• Many people experiment with ideas.
Everything is becoming more flexible.
• Let's play!
Tuesday, October 16, 12