Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

42
For Lovers of Packets and Jumbo Frames Redis Networking Nerd Down

Transcript of Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Page 1: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

For Lovers of Packets and Jumbo FramesRedis Networking Nerd Down

Page 2: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Intro

John BullardVP Engineering

Benji TaylorDevOps Lead

Page 3: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

We Block BotsDistil

Page 4: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

How the Distil Bot Detection Solution Works

As web traffic passes through Distil, the system

1. Fingerprints each incoming connection and compares it to our Known Violators Database

2. If it’s a new fingerprint, validates the browser to determine if it’s a Bot or Not

3. Based on your preferences, automatically tags, challenges, or blocks the bot

Page 5: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Bad Bots Cause Problems

Page 6: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Fortune 500 & Alexa Global 10,000 CustomersEcommerce

Travel

Publishers

Directories

Traditional Media

Marketplace

Services

Page 7: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

We Block BotsDistil Architecture

Page 8: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Distil Architecture

Page 9: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Topology - Single Master

Page 10: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Topology - Master : Master

Page 11: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Topology - Master : Slave

Page 12: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Every Packet MattersCustomer Story

Page 13: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

○Large Online MarketplaceHigh traffic volume Approaching seasonal peak - 3x trafficAWS EC2 Classic

○ Soft 100k PPS Limit○ Customer concern

Page 14: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

○Scaling Up + OutMaster : Slave Topology

○ 9 Node: 1 Master, 8 SlavesC3.8xlarge Instances

○ 36 vCPU, 60 GiB, 10 GigabitProof of Concept

○ Onboard <5% of traffic

Page 15: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

POC - Slave Measurements

Page 16: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

POC - Master Measurements

Page 17: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

POC - Master Measurements

Page 18: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

Page 19: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

Page 20: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

○Bottleneck - Master PPSRedis Master : Write + Replicate

○ All nodes write○ All writes replicate to all nodes

○RequirementsMaster PPS < 100kNo partitioningEC2 Classic$0 Cost Increase

Page 21: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

We Block BotsPackets

Page 22: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks
Page 23: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 24: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 25: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 26: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 27: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Overview

○Jumbo CaveatsNot supported everywhere (Virtualbox)“Jumbo” differs among vendorsEvery component on path must support itSwitches - drop jumbo framesRouters - must support ingress and egress

Page 28: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Overview

○ Tuning - Jumbo frames - AWS Support for jumbo frames:

○ Compute optimized: C3, C4, CC2 ○ General purpose: M3, M4, T2 - GPU: CG1, G2 ○ Memory optimized: CR1, R3 ○ Storage optimized: D2, HI1, HS1, I2

MTU 9001 bytes

Page 29: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 30: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 31: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 32: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 33: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

○TCP Small Packet ProblemApplication sending 1 byte packetsTCP packets have a 40 byte header

○ 20 bytes for TCP○ 20 bytes for IPv4

41 byte packet ○ For 1 byte of useful information

Page 34: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

○Nagle’s algorithm (RFC 896)Combine small outgoing messages

Reduce # of packetsImprove TCP/IP efficiency Trade-off: increased latency

○ Problematic for real-time systems○ Per-socket: TCP_NODELAY

Page 35: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

# Disable TCP_NODELAY on the slave socket after SYNC?## If you select "yes" Redis will use a smaller number of TCP packets and# less bandwidth to send data to slaves. But this can add a delay for# the data to appear on the slave side, up to 40 milliseconds with# Linux kernels using a default configuration.## If you select "no" the delay for data to appear on the slave side will# be reduced but more bandwidth will be used for replication.## By default we optimize for low latency, but in very high traffic conditions# or when the master and slaves are many hops away, turning this to "yes" may# be a good idea.repl-disable-tcp-nodelay no

Page 36: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 37: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Page 38: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

Master/Slave ChainsCommon Architecture for Read Intensive

ScenariosBalance Write Duplication to Read-SlavesShift PPS to Read-SlavesConfiguration Change - No DevNo Added Cost

○ 1 Master 2 Read-Slaves 6 Edgenodes

Page 39: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

Page 40: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Customer Story

Page 41: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Packets

○ApproachEthernet tuning - Enable Jumbo PacketsTCP/IP tuning - Enable “Naggling”Topology - Read-Slave fan-out

Page 42: Redis Networking Nerd Down: For Lovers of Packets and Jumbo Frames- John Bullard, Distil Networks

Demo