This document discusses software performance analysis and security issues related to app development. It begins by introducing the speaker and his background. The rest of the document covers concepts around scaling systems to handle increased traffic, such as database scaling through master-slave and sharding approaches. It also discusses performance considerations like caching and synchronization primitives. Finally, it touches on security topics like security groups in cloud computing environments.
16. Step 1: Master/Slave - Preparation
Even with one server:
Make code write to master and read from slave
Don't write code that would fail with slave lag:
$master->query('update users set comments += 1');
$slave->query('select comments from users');
24. Cost of Partitioning
• Loss of direct SQL support
• Increased Web Server / Application Load
• More complicated programming
25. Caching in Brief
• Often considered performance
• Can absolutely be a scalability factor, especially
when combined with smaller discrete DB queries
• Allows you to get around DB scalability by
ignoring the DB
26. Type of Caching
• Single server memory caches
– For PHP: APC or Zend Server Data Cache
– Limited due to lack of sync'd cache
• Distributed
– Memcached (Generic) or Zend Platform (PHP)
– Required for true scalability enhancement
29. Atomic Increment of global variable
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
Interconnect MemoryMemory
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Lots and Lots of Latency!!!
33. Atomic Increment of per CPU variable
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
CPU CPU CPU CPU
$ $ $ $
Interconnect
Interconnect MemoryMemory
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Store
Buffer
Little Latency, Lots of Increments at Core Clock RateLittle Latency, Lots of Increments at Core Clock Rate
34. Cloud at scale
• Host management
• Capacity management
• What host to use to deploy a new VM
• Failure handling
• Security group propagation