Bài đăng

Đang hiển thị bài đăng từ Tháng 8, 2017

Guidlene dành cho haproxy, một số cấu hình hay

1. HAProxy Logging Haproxy hỗ trợ custom log, bằng cách thêm cấu hình logformat như sau: log-format [%pid]\ [%Ts.%ms]\ %ac/%fc/%bc/%bq/%sc/%sq/%rc\ %Tq/%Tw/%Tc/%Tr/%Tt\ %tsc\ %ci:%cp\ %fi:%fp\ %si:%sp\ %ft\ %sslc\ %sslv\ %{+Q}r\ %ST\ %b:%s\ "%CC"\ "%hr"\ "%CS"\ "%hs"\ req_size=%U\ resp_size=%B --> ví dụ: Mar 14 17:14:51 localhost haproxy[14887]: [14887] [1394817291.250] 10/5/2/0/3/0/0 48/0/0/624/672 ---- 1.10.2.10:35701 10.151.122.228:443 127.0.0.1:8000 logger - - "GET /v1/ HTTP/1.0" 404 fxa-nodejs:nodejs1 "-" "{||ApacheBench/2.3|over-100-active-connections,over-100-connections-in-10-seconds,high-error-rate,high-request-rate,|47B4176E:8B75_0A977AE4:01BB_5323390B_31E0:3A27}" "-" "" ireq_size=592 resp_size=787 Các tham số: %pid: process ID của HAProxy %Ts.%ms: unix timestamp + milliseconds %ac: tổng số connection hiện tại %fc: tổng số connection hiện tại của frontend %bc: tổng số