Contenu connexe Similaire à Getting started with Riak in the Cloud (20) Getting started with Riak in the Cloud2. I work with I work with
Code! Data!
Michael Brodhead Ines Sombra
@mojinations @RandomMood
5. A tale of 2 apps
• One brand
new (no code
written)
• One in production
running MySQL
24. “We need a
Riak cluster”
(@mojinations circa 3 months ago)
... but we have no
hardware
26. Why Riak Product?
• Linearly Scalable
• Fault-tolerant
• Ops friendly
• Product lacks
HA options
27. Riak @ Engine Yard
• We’ll use it first
• No custom Chef
• Provisioning,
configuration,
monitoring, &
backups
28. Your Choices
• Number of nodes
• Instance type
You are trying
to create a Riak
cluster. Do you
need any help?
• Data location
• Backend type
31. Instances & I/O
• Riak’s I/O patterns
• Small blobs from many
places on disk
• EBS best at bulk reads &
writes
32. Instance types
• m1.large & m1.xlarge
• EBS-optimized NEW!
• Consider PIOPS NEW!
• High I/O Quadruple XL
(hi1.4xlarge) - SSDs! NEW!
33. Prepare
Yourself
More instances to compensate
for the performance variability
of virtualized resources
34. Cluster Sizes
• 5 nodes or more
Best performance
& growth
• Scales linearly
• Don’t be stingy
35. Ring Size
• Change default value!
• Cannot be reset
• Ring size: 256
8/64 vnodes per node
• Don’t go above 512
36. Provisioning
Riak Cluster
App MyRiakCluster: node-0
haproxy
HTTP
or MyRiakCluster: node-1
Protobuff
App
haproxy
MyRiakCluster: node-2
App
MyRiakCluster: node-3
haproxy
MyRiakCluster: node-4
37. Disable Swap
• Riak process pages should
not hit swap
• Swap usage
can result in
unresponsive server
• Let the kernel kill it
38. Mount & Scheduler
• mount with noatime flag
• Use deadline scheduler
on EBS
cat /sys/block/xvdj1/queue/scheduler
noop [deadline] cfq
echo deadline > /sys/block/xvdj1/
queue/scheduler
41. Kernel Optimizations
• /etc/sysctl.conf
vm.swappiness = 0
net.core.somaxconn= 4000
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 40000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_tw_reuse = 1
http://wiki.basho.com/Linux-Performance-Tuning.html
43. Backups
• Backup both the ring and
data directories
• Integrate with EY tools
• scp or rsync data directory
• EBS snapshots
46. Tests
• 5-node cluster / 5 hours
• 50 concurrent connections
• gets 10 /puts 5 /deletes 1
• Bitcask backend
• Protobuffs protocol