Powering Your Uptime HAProxy Technologies HAProxy and web performance EMEA Headquarters 3, rue du petit Robinson ZAC des Metz 78350 Jouy en Josas France http://www.haproxy.com Powering Your Uptime HAProxy Technologies - HAProxy and web performance Private document
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Powering Your Uptime
HAProxy Technologies
HAProxy and web performance
EMEA Headquarters3, rue du petit RobinsonZAC des Metz78350 Jouy en JosasFrancehttp://www.haproxy.com
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
frontend fe http-request set-log-level silent unless { path_end .php }
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
Information logged• path followed in HAProxy: frontend, backend, server
• client information: IP and port
• timers: client request, server connection, server response, queue, total time
• bytes read and written
• termination state
• number of connections on the process, frontend, backend, server
• number of connections in the server's or backend queue
• HTTP information:
• HTTP status code
• captured request and response information: cookie and header fields
• URL
• not only: Thanks to log-format directive, we can also log any information available through afetch: IE session rate on the frontend, any TLS information (cipher, SNI, CN, etc...), and muchmore
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
• halog output for server response time, pct_ok report the percentage of responses which aren't errors,avg_ct is the average connection time (TCP) and avg_rt is the average application response time:
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
Queueing in HAProxy demistified• HAProxy can queue requests to protect weak applications and servers
• HAProxy prevents the application server to run too many requests in parallel (remember slide 4 andHAProxy's frontend/backend architecture)
• Queueing allows the following benefits:
• the server never crashes
• the application remains fast
• response time remains good
• no (or almost none) errors are reported to the clients
• saving resources
• Simply setup maxconn parameters on the server line statement in HAProxy's backend
• there are no magic values. Benchmarking the application is the only way. Benchmarking with highconcurency is the key
• From our experience, a good maxconn value is from 50 to 300 (as seen in the previous example...)
• coupled with HAProxy's TCP/HTTP buffering, queueing hides the client side latency and allows quicklyrecycling connection slots for an other client while carry on delivering response to a first one
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
What about the performance metricsWe saw the log line contains the URL and the server response time amongst many other information.So I want to:
• sort URLs by response time
• sort app server by response time
• much more
• this is when halog enters in the party and demo #3 as well!!!
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
Demo #3: measuring performance1. run the lab: make run LAB=demo3 EX=1
2. perform an HTTP request: GET http://haproxy.local/
3. inject some traffic
4. Check status on the HTTP stats page: HTML content
For the same set of requests, the server responded much faster when it runs behind HAProxy!
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document
Conclusion• HAProxy protects weak application and servers
• HAProxy reduce time when troubleshooting issues
•
All the tips introduced in those slides are available in both HAProxy Community and Enterpriseversion, use them, abuse them, call us if you need expertise!
• HAProxy doesn't lie
• I'm not a laundry detergent seller!
•
During this presentation, only HAProxy did not lie!
Powering Your Uptime
• NON EXHAUSTIVE presentation !!!! HAProxy can do much more for your safety
Powering Your UptimeHAProxy Technologies - HAProxy and web performance Private document