SlideShare a Scribd company logo
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
HAProxy
By ChinaNetCloud
Pioneers in OaaS – Operations-as-a-Service
January, 2015
www.ChinaNetCloud.com
Copyright 2015 ChinaNetcloud Training Program
ChinaNetCloud Training
2
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Introduction
● HAProxy key part of most large systems
● World's most powerful software load balancer
● A little complex
● Interesting and fun
3
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Load Balancer Overview
● Listen on front-end ports, usually 80/443
● Forwards to a back-end pool of servers
● Has health checks of back-end
● Only send to Healthy & UP servers
● Has sticky sessions, usually using cookies
● Web servers see LB as client, with LB's IP
● Use X-Forwarded-for Header to send real IP
● Important for web server logs
4
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Load Balancer Overview
● Single LB, many web
● Two LB, many web
5
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
High-Avail HAProxy
● Two HAProxy
● Run KeepAlived to manage failover
● Have front-end VIP
● We have standard config, Wiki
● Usually Physical / Private
● On Public Cloud use ELB or Heartbeat
6
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
HA Load Balancer – Public Cloud
● Amazon, Aliyun – Have their ELB/SLB in front
● Use their to help bandwidth and failover
● AWS – Need ELB for HA between zones
● Aliyun – Need SLB for single bandwidth point
● Still use two HAProxy
● HAProxy more powerful, configurable
● HAProxy can be monitored (Nginx can't)
7
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Parts of HAProxy
● Front-End Listeners
● Back-End Pools
● ACLs
● Rewrites
● Logs
● Monitoring
8
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Front-End
● Listening part of HAProxy
● Pretty simple
● Has IP, port to listen on
● Has networking options, like timeouts
● Includes vhost, name to listen on
● Can have several front-ends
● Usually for different domains, www., images., etc.
● Can go to same or different back-ends
9
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Back End Pools
● Part that does the work
● Lots of options
● Also does logging, error handling
● And health checks of backend servers
● Has a backend server list
● Each server has options, weights, health checks
10
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
ACLs – Control & Multi-Pool
● Can split traffic by URL, host
● For vhost split, use second Front-end
● For URL split, use ACLs
● Based on Headers, URL, or Path
● If-then structure
● Also can avoid scans, DDoS
● Example:
● acl is_www_domain_com hdr_end(host) -i domain.com
● use_backend www_ex_com if is_www_example_com
11
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Rewrites
● Has basic rewrites
● Can be useful, especially cross-domain
● Usually better to rewrite on web server
12
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Configuration
● Single file
● Has Global default second, for all Front/Back
● Has section for each Front & Back
● Not much to change, other than pools & URLs
● Sometimes change timeouts
● Sometimes advanced features like keepalive
● Sometimes Tomcat needs more changes
● server srv-example-web1_80 10.9.1.205:80 cookie
srv-example-web1_80 check maxconn 2000
13
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Session Stickiness
● Makes sure same user goes to same server
● Especially in one session
● Very important for Java
● Not very important for PHP if uses shared cache
● Can cause instability on big systems
● Done with separate (not session) cookie
● Remove cookie name in server list to disable
14
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Logs
● Very powerful and useful
● Uses syslog, so /var/log/haproxy …
● Shows disconnect reason/state
● 4 letter code like CRNI, RHEP
● See manual for meaning
● Show is Client or Backend server disconnected
– Also often shows why or how
● Also shows if session/cookie was used
15
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Monitoring
● Very good
● Keeps stats by pool and by servers
● Records status, errors, but not timing
● Unusual words:
● Sessions – Concurrent connections
● Session Rate – Request rate
● Two ways to use (Can also manage servers)
● API called via Socket
● GUI web interface
16
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
GUI Web Monitor
● Lots of good detail
17
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
SSL in HAProxy
● Just got support in June, 2014 – Version 1.5
● Starting to see in production use
● Until now, we had to:
● Have to use Nginx in front
● Set Nginx on port 443 as proxy
● Sends traffic to Haproxy on port 80 or 81
– Use 81 if need to keep SSL traffic separate
● Now we can use directly in version 1.5
● See docs on how to configure
18
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Multi-Process
● HAProxy is single process – use single CPU
● Usually okay, but can limit scaling
● 250,000 connections, but only 2,500 requests/sec
● 50,000+ requests/sec, but only 2,500 concurrent con
● Need special config and discussion to use
● It CAN run multi-process, but monitoring is wrong
● All monitoring by process, so gets confused
● Messy
19
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Summary
● HAProxy important and powerful
● Very configurable
● Has pools
● Great logs
● Good luck !
20
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Lab
● Create VM on AWS
● Install Nginx & Apache
● Configure Nginx on port 81 and Apache on 82
● Install HAProxy from RPM & Wiki
● Create frontend & backend for nginx, test
● Add ACL and Apache backend pool
● Split URLs between Nginx & Apache, test
● Look at monitor page, use CLI tools
● Look at logs, look up status codes
21
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
About ChinaNetCloud
Www.ChinaNetCloud.com – +86-21-6422-1946 – Sales@ChinaNetCloud.com
ChinaNetCloud is a Shanghai-based, full-service Internet managed services provider
(MSP). We architect, build, optimize, and manage large-scale systems for e-commerce,
games, apps, mobile, media, and more.
We deliver Reliability, Performance, Scale, Security, and cost savings via our Operations-
as-a-Service (OaaS) platform, which includes 7x24 operations, deep predcitive
monitoring, networking, security scanning, backups, databases, upgrades,rapid
troubleshooting, configuration changes, and much more.
Our OaaS platform is state-of-the-art with a wide variety of sophisticated tools ranging
from deep design to audit, migration, management, monitoring, backups, CMDB, load
testing, capacity planning, performance analysis, portals, and much more.
Over six years, we've helped hundreds of internet companies improve their systems,
focusing on Reliability, Performance, Scalability, Security, and Cost-Savings.
Let us help you today!
22
ChinaNetCloudRunning the World's Internet Servers 管理全球服务器
Contact ChinaNetCloud
Silicon Valley Office:
440 North Wolfe Road
Sunnyvale, 94085 USA ChinaNetCloud
www.ChinaNetCloud.com
Sales@ChinaNetCloud.com
Shanghai Headquarters:
X2 Space 10601
1238 Xietu Lu
Shanghai, 200032 China
Beijing Office:
Lee World Business Building #305
57 Middl Xingfu Village Rd., Chaoyang
Beijing, 100027 China
T: +86-21-6422-1946

More Related Content

PPTX
HAProxy
PDF
HAProxy tech talk
PDF
HA Deployment Architecture with HAProxy and Keepalived
PDF
ODT
Load Balancing with HAproxy
ODP
HAProxy scale out using open source
PDF
MariaDB Replication manager and HAProxy (HAProxy Paris Meetup)
PPT
Web Server Load Balancer
HAProxy
HAProxy tech talk
HA Deployment Architecture with HAProxy and Keepalived
Load Balancing with HAproxy
HAProxy scale out using open source
MariaDB Replication manager and HAProxy (HAProxy Paris Meetup)
Web Server Load Balancer

What's hot (20)

PPTX
Using HAProxy to Scale MySQL
PPTX
HA Proxy logs - The Art of Logging
PPTX
Introduction to Haproxy
PDF
Load Balancing MySQL with HAProxy - Slides
PDF
Stuart Larsen, attacking http2implementations-rev1
PDF
Attacking http2 implementations (1)
PDF
How To Set Up SQL Load Balancing with HAProxy - Slides
PDF
HTTP2:新的机遇与挑战
PPTX
Choosing A Proxy Server - Apachecon 2014
PDF
Kea DHCP – the new open source DHCP server from ISC
PDF
HTTP 2.0 – What do I need to know?
PDF
ReplacingSquidWithATS
PPTX
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
PPTX
NGINX: High Performance Load Balancing
PDF
Varnish SSL / TLS
PDF
Denser, cooler, faster, stronger: PHP on ARM microservers
PDF
Apache Traffic Server & Lua
PDF
Load balancing at tuenti
PPT
Apache Traffic Server
PPTX
HTTP/2 Introduction
Using HAProxy to Scale MySQL
HA Proxy logs - The Art of Logging
Introduction to Haproxy
Load Balancing MySQL with HAProxy - Slides
Stuart Larsen, attacking http2implementations-rev1
Attacking http2 implementations (1)
How To Set Up SQL Load Balancing with HAProxy - Slides
HTTP2:新的机遇与挑战
Choosing A Proxy Server - Apachecon 2014
Kea DHCP – the new open source DHCP server from ISC
HTTP 2.0 – What do I need to know?
ReplacingSquidWithATS
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
NGINX: High Performance Load Balancing
Varnish SSL / TLS
Denser, cooler, faster, stronger: PHP on ARM microservers
Apache Traffic Server & Lua
Load balancing at tuenti
Apache Traffic Server
HTTP/2 Introduction
Ad

Viewers also liked (9)

PDF
What's New in HAProxy
PDF
Velocity 2011 - Our first DDoS attack
PDF
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
PDF
Aniki - The ORM as our great brother.
PDF
Embracing Open Source: Practice and Experience from Alibaba
PDF
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
PDF
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
PPT
DDoS Attacks
PDF
Multi-Layer DDoS Mitigation Strategies
What's New in HAProxy
Velocity 2011 - Our first DDoS attack
USENIX LISA15: How TubeMogul Handles over One Trillion HTTP Requests a Month
Aniki - The ORM as our great brother.
Embracing Open Source: Practice and Experience from Alibaba
2014 OSDC Talk: Introduction to Percona XtraDB Cluster and HAProxy
Keepalived & HA-Proxy as an alternative to commercial loadbalancer - August 2014
DDoS Attacks
Multi-Layer DDoS Mitigation Strategies
Ad

Similar to ChinaNetCloud Training - HAProxy Intro (20)

PPTX
Basics of NGINX
PDF
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
PDF
Apache Ratis - A High Performance Raft Library
ODP
Zero Downtime JEE Architectures
PDF
Scalable Architecture 101
PDF
Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...
PDF
Best practices of notes traveler deployment
PDF
OpenNebulaConf2018 - Is Hyperconverged Infrastructure what you need? - Boyan ...
PDF
MySQL X protocol - Talking to MySQL Directly over the Wire
PPTX
App Deployment on Cloud
PDF
MySql's NoSQL -- best of both worlds on the same disks
ODP
Drupal Performance and Scaling
ODP
ESB vs API management
PPTX
RedMart Migrating from EC2 to VPC with Chef
PPTX
Maximizing PHP Performance with NGINX
PPTX
WebDev Simplified React.js.pptx
PDF
oVirt – open your virtual datacenter
PDF
23 LAMP Stack #burningkeyboards
PDF
Magento Meetup New Delhi- Magento2 Speed Optimization
PPTX
Dynomite @ RedisConf 2017
Basics of NGINX
How Sysbee Manages Infrastructures and Provides Advanced Monitoring by Using ...
Apache Ratis - A High Performance Raft Library
Zero Downtime JEE Architectures
Scalable Architecture 101
Kaseya Connect 2013: Optimizing Your K Server - Best Practices in Kaseya Infr...
Best practices of notes traveler deployment
OpenNebulaConf2018 - Is Hyperconverged Infrastructure what you need? - Boyan ...
MySQL X protocol - Talking to MySQL Directly over the Wire
App Deployment on Cloud
MySql's NoSQL -- best of both worlds on the same disks
Drupal Performance and Scaling
ESB vs API management
RedMart Migrating from EC2 to VPC with Chef
Maximizing PHP Performance with NGINX
WebDev Simplified React.js.pptx
oVirt – open your virtual datacenter
23 LAMP Stack #burningkeyboards
Magento Meetup New Delhi- Magento2 Speed Optimization
Dynomite @ RedisConf 2017

More from ChinaNetCloud (20)

PPTX
AWS ELB Tips & Best Practices
PPTX
OpsStack--Integrated Operation Platform
PPTX
ChinaNetCloud Online Lecture:Something About Tshark
PPTX
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
PPTX
Steve Mushero on Entrepreneurship - 创业 - 崔牛会
PPTX
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
PPTX
云中漫步 颠覆创新_创业邦春季创新峰会主题演讲 Cloud Innovation in China
PDF
运维安全 抵抗黑客攻击_云络安全沙龙4月上海站主题分享
PPTX
AWS Summit OaaS Talk by ChinaNetCloud
PDF
Running Internet Systems in China - The Details You Need to Succeed in Chines...
PDF
Making Internet Operations Easier
PPTX
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
PPTX
Big Data Security (ChinaNetCloud - Guiyang Conference)
PPTX
Internet System Security Overview
PPTX
Why Work at ChinaNetCloud
PPTX
Cloud Operations Challenges - Talk by ChinaNetCloud at Joint Cisco event
PPTX
Automatically Managing Internet Operations In The Cloud - 云计算平台的自动化运维
PPTX
ChinaNetCloud - Aliyun Joint Event on Cloud Operations
PDF
Clouds in China
PPTX
ChinaNetCloud - Public Clouds in China Overview
AWS ELB Tips & Best Practices
OpsStack--Integrated Operation Platform
ChinaNetCloud Online Lecture:Something About Tshark
ChinaNetCloud Online Lecture: Fight Against External Attacks From Different L...
Steve Mushero on Entrepreneurship - 创业 - 崔牛会
Dev-Ops与Docker的最佳实践 QCon2016 北京站演讲
云中漫步 颠覆创新_创业邦春季创新峰会主题演讲 Cloud Innovation in China
运维安全 抵抗黑客攻击_云络安全沙龙4月上海站主题分享
AWS Summit OaaS Talk by ChinaNetCloud
Running Internet Systems in China - The Details You Need to Succeed in Chines...
Making Internet Operations Easier
Internet Cloud Operations - ChinaNetcloud & AWS Event Beijing
Big Data Security (ChinaNetCloud - Guiyang Conference)
Internet System Security Overview
Why Work at ChinaNetCloud
Cloud Operations Challenges - Talk by ChinaNetCloud at Joint Cisco event
Automatically Managing Internet Operations In The Cloud - 云计算平台的自动化运维
ChinaNetCloud - Aliyun Joint Event on Cloud Operations
Clouds in China
ChinaNetCloud - Public Clouds in China Overview

Recently uploaded (20)

PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
presentation_pfe-universite-molay-seltan.pptx
PPT
tcp ip networks nd ip layering assotred slides
PPTX
Introduction to Information and Communication Technology
PPTX
SAP Ariba Sourcing PPT for learning material
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPTX
Funds Management Learning Material for Beg
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
Digital Literacy And Online Safety on internet
PDF
Triggering QUIC, presented by Geoff Huston at IETF 123
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
Internet___Basics___Styled_ presentation
522797556-Unit-2-Temperature-measurement-1-1.pptx
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Tenda Login Guide: Access Your Router in 5 Easy Steps
presentation_pfe-universite-molay-seltan.pptx
tcp ip networks nd ip layering assotred slides
Introduction to Information and Communication Technology
SAP Ariba Sourcing PPT for learning material
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PptxGenJS_Demo_Chart_20250317130215833.pptx
Paper PDF World Game (s) Great Redesign.pdf
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Funds Management Learning Material for Beg
Sims 4 Historia para lo sims 4 para jugar
Digital Literacy And Online Safety on internet
Triggering QUIC, presented by Geoff Huston at IETF 123
QR Codes Qr codecodecodecodecocodedecodecode
INTERNET------BASICS-------UPDATED PPT PRESENTATION
Introuction about ICD -10 and ICD-11 PPT.pptx
Internet___Basics___Styled_ presentation

ChinaNetCloud Training - HAProxy Intro

  • 1. ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 HAProxy By ChinaNetCloud Pioneers in OaaS – Operations-as-a-Service January, 2015 www.ChinaNetCloud.com Copyright 2015 ChinaNetcloud Training Program ChinaNetCloud Training
  • 2. 2 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Introduction ● HAProxy key part of most large systems ● World's most powerful software load balancer ● A little complex ● Interesting and fun
  • 3. 3 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Load Balancer Overview ● Listen on front-end ports, usually 80/443 ● Forwards to a back-end pool of servers ● Has health checks of back-end ● Only send to Healthy & UP servers ● Has sticky sessions, usually using cookies ● Web servers see LB as client, with LB's IP ● Use X-Forwarded-for Header to send real IP ● Important for web server logs
  • 4. 4 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Load Balancer Overview ● Single LB, many web ● Two LB, many web
  • 5. 5 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 High-Avail HAProxy ● Two HAProxy ● Run KeepAlived to manage failover ● Have front-end VIP ● We have standard config, Wiki ● Usually Physical / Private ● On Public Cloud use ELB or Heartbeat
  • 6. 6 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 HA Load Balancer – Public Cloud ● Amazon, Aliyun – Have their ELB/SLB in front ● Use their to help bandwidth and failover ● AWS – Need ELB for HA between zones ● Aliyun – Need SLB for single bandwidth point ● Still use two HAProxy ● HAProxy more powerful, configurable ● HAProxy can be monitored (Nginx can't)
  • 7. 7 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Parts of HAProxy ● Front-End Listeners ● Back-End Pools ● ACLs ● Rewrites ● Logs ● Monitoring
  • 8. 8 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Front-End ● Listening part of HAProxy ● Pretty simple ● Has IP, port to listen on ● Has networking options, like timeouts ● Includes vhost, name to listen on ● Can have several front-ends ● Usually for different domains, www., images., etc. ● Can go to same or different back-ends
  • 9. 9 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Back End Pools ● Part that does the work ● Lots of options ● Also does logging, error handling ● And health checks of backend servers ● Has a backend server list ● Each server has options, weights, health checks
  • 10. 10 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 ACLs – Control & Multi-Pool ● Can split traffic by URL, host ● For vhost split, use second Front-end ● For URL split, use ACLs ● Based on Headers, URL, or Path ● If-then structure ● Also can avoid scans, DDoS ● Example: ● acl is_www_domain_com hdr_end(host) -i domain.com ● use_backend www_ex_com if is_www_example_com
  • 11. 11 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Rewrites ● Has basic rewrites ● Can be useful, especially cross-domain ● Usually better to rewrite on web server
  • 12. 12 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Configuration ● Single file ● Has Global default second, for all Front/Back ● Has section for each Front & Back ● Not much to change, other than pools & URLs ● Sometimes change timeouts ● Sometimes advanced features like keepalive ● Sometimes Tomcat needs more changes ● server srv-example-web1_80 10.9.1.205:80 cookie srv-example-web1_80 check maxconn 2000
  • 13. 13 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Session Stickiness ● Makes sure same user goes to same server ● Especially in one session ● Very important for Java ● Not very important for PHP if uses shared cache ● Can cause instability on big systems ● Done with separate (not session) cookie ● Remove cookie name in server list to disable
  • 14. 14 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Logs ● Very powerful and useful ● Uses syslog, so /var/log/haproxy … ● Shows disconnect reason/state ● 4 letter code like CRNI, RHEP ● See manual for meaning ● Show is Client or Backend server disconnected – Also often shows why or how ● Also shows if session/cookie was used
  • 15. 15 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Monitoring ● Very good ● Keeps stats by pool and by servers ● Records status, errors, but not timing ● Unusual words: ● Sessions – Concurrent connections ● Session Rate – Request rate ● Two ways to use (Can also manage servers) ● API called via Socket ● GUI web interface
  • 16. 16 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 GUI Web Monitor ● Lots of good detail
  • 17. 17 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 SSL in HAProxy ● Just got support in June, 2014 – Version 1.5 ● Starting to see in production use ● Until now, we had to: ● Have to use Nginx in front ● Set Nginx on port 443 as proxy ● Sends traffic to Haproxy on port 80 or 81 – Use 81 if need to keep SSL traffic separate ● Now we can use directly in version 1.5 ● See docs on how to configure
  • 18. 18 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Multi-Process ● HAProxy is single process – use single CPU ● Usually okay, but can limit scaling ● 250,000 connections, but only 2,500 requests/sec ● 50,000+ requests/sec, but only 2,500 concurrent con ● Need special config and discussion to use ● It CAN run multi-process, but monitoring is wrong ● All monitoring by process, so gets confused ● Messy
  • 19. 19 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Summary ● HAProxy important and powerful ● Very configurable ● Has pools ● Great logs ● Good luck !
  • 20. 20 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Lab ● Create VM on AWS ● Install Nginx & Apache ● Configure Nginx on port 81 and Apache on 82 ● Install HAProxy from RPM & Wiki ● Create frontend & backend for nginx, test ● Add ACL and Apache backend pool ● Split URLs between Nginx & Apache, test ● Look at monitor page, use CLI tools ● Look at logs, look up status codes
  • 21. 21 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 About ChinaNetCloud Www.ChinaNetCloud.com – +86-21-6422-1946 – Sales@ChinaNetCloud.com ChinaNetCloud is a Shanghai-based, full-service Internet managed services provider (MSP). We architect, build, optimize, and manage large-scale systems for e-commerce, games, apps, mobile, media, and more. We deliver Reliability, Performance, Scale, Security, and cost savings via our Operations- as-a-Service (OaaS) platform, which includes 7x24 operations, deep predcitive monitoring, networking, security scanning, backups, databases, upgrades,rapid troubleshooting, configuration changes, and much more. Our OaaS platform is state-of-the-art with a wide variety of sophisticated tools ranging from deep design to audit, migration, management, monitoring, backups, CMDB, load testing, capacity planning, performance analysis, portals, and much more. Over six years, we've helped hundreds of internet companies improve their systems, focusing on Reliability, Performance, Scalability, Security, and Cost-Savings. Let us help you today!
  • 22. 22 ChinaNetCloudRunning the World's Internet Servers 管理全球服务器 Contact ChinaNetCloud Silicon Valley Office: 440 North Wolfe Road Sunnyvale, 94085 USA ChinaNetCloud www.ChinaNetCloud.com Sales@ChinaNetCloud.com Shanghai Headquarters: X2 Space 10601 1238 Xietu Lu Shanghai, 200032 China Beijing Office: Lee World Business Building #305 57 Middl Xingfu Village Rd., Chaoyang Beijing, 100027 China T: +86-21-6422-1946