210 likes | 312 Views
Multi-directonal Scaling. Emile Heitor – NBS System 04 / 06 / 2011. You're not alone. E-commerce paradigm Whatever you sale, traffic is never flat However, it is predictible Sales, holidays, newsletters, TV shows. Newsletter and Sales. Facebook effect. How to handle traffic burst.
E N D
Multi-directonal Scaling Emile Heitor – NBS System 04 / 06 / 2011
You're not alone E-commerce paradigm Whatever you sale, traffic is never flat However, it is predictible Sales, holidays, newsletters, TV shows
How to handle traffic burst What are your choices ? The rich: Enough servers to handle bursts anytime The poor: Traffic limit The pessimistic: accept performance drop, server crash The smart: Find a way to extend your hosting space for a defined period
Virtualization ? It's 2011, nowadays : Paravirtualization's overhead is only 2 to 7% CPU usage can be distributed over cores or pinned to it Scheduling mechanisms are now very reliable We're talking about 24 cores by machine Next generation processors will provide 48 real cores by machine ! More cores make hypervisors happy
It's all about infrastructure Xen's perfect hardware setup Virtualization's a pretty lady, she likes shiny jewels. Don't be cheap. Lots-of-core Lots-of-memory External storage (SAN or NAS) High capacity switches
Vertical scaling Power growth through Xen Increase CPU: very complex task xm vcpu-set Increase memory: very very complex task xm mem-set Migrate virtual machine to new hardware xm migrate
Scalability Technologies Zend Session Cluster Manager Memcached MySQL 5.5 / Percona Split read/write accesses Xtradb backend Nginx media servers
Don't believe the hype What REALLY is Cloud Computing Companies providing : Tons of available CPU cores Tons of available memory Terabytes of bandwidth Highly performant virtualization systems being able to use parts of the latters A proper API in order to manipulate all this
Latency kills Think infrastructure: how do I grow my platform Who's the memory hog ? Who's CPU hungry ? Who's easily scalable ? Our friends Apache/PHP ! “Easy” win: grow your frontends, integrate them to your infrastructure Find a cloud provider near you
Virtualization made real Typical setup A medium-sized virtual machine 8 Intel cores @ 2.5GHz 16GB RAM The process of creating a fully functionnal machine takes about 5 minutes fab -f fab-nbs-kloug.py -H kloug create_machine:"standalone","vm2","clone"
Interlude What is that “fab” thing anyway ? Fabric: http://docs.fabfile.org/0.9.2/, a python-based system designed to help automating tasks How does it bond with a CC environment As a matter of fact, NiftyName's API is actually available as a python class, easily expandable as fabric files
Virtual machines management Uniform platforms 3 nodes templates Small (media server, small burst) 4 cores, 8GB Medium 8 cores, 16 GB Large 16 cores, 32GB
Architecture tricks Usecase 1: Media server The heavy medias problem (flv, avi, mov...) Short time media server Easy setup Usecase 2: Magento frontend Harder setup, think about: DocumentRoot sharing Database Access Customer-only network
Documentroot Sharing Best by far: SAN / NAS Shared data between real servers and CC nodes Easy to maintain, easy to setup, no tricks Oldschool solutions Rsync (asynchronous, tricky to deploy) NFS (weak failover) Distributed filesystems GlusterFS, drbd, Lustre
Load Balancing Pop'ing a virtual machine is easy, integrate it is not Expanding a private infrastructure means joining a private VLAN Tunneling to the rescue Ability to connect to the databases with a minimal latency As of now, the node can be integrated to the loadbalancing pool like a “real” machine
Next As of today, and since mid-2010, we're able to spawn nodes quicky and prepare them as real servers Late 2011, a convenient system, being developped at this very moment, will permit to spawn and prepare nodes when needed
Thank You Q&A