Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High TTFB #83

Closed
igorescobar opened this issue May 24, 2020 · 1 comment
Closed

High TTFB #83

igorescobar opened this issue May 24, 2020 · 1 comment

Comments

@igorescobar
Copy link

Hi,

It's me again :)

I'm pretty new to HAProxy + Nuster and I was wondering if there is anything I could do to reduce the TTFB:
Screenshot 2020-05-24 at 12 46 54

Worth mentioning that Nuster is Behind an AWS ELB and the TTFB seems pretty high for a file that is cached on disk.

I get a pretty similar TTFB even for non-cached JSON requests:
Screenshot 2020-05-24 at 12 50 43

This is my configuration at the moment:

defaults
  log global
  mode http

  log-format     '{"time":{"tr":%Tr,"tq":%Tq,"tw":%Tw,"tc":%Tc,"tt":%Tt},"haproxy":{"retries":%rc,"request":{"method":"%HM","uri":"%[capture.req.uri]","protocol":"%HV","header":{"host":"%[capture.req.hdr(0),json(utf8s)]","xforwardfor":"%[capture.req.hdr(1),json(utf8s)]","referer":"%[capture.req.hdr(2),json(utf8s)]"}},"name":{"server":"%s"},"response":{"status_code":%ST,"header":{"xrequestid":"%[capture.res.hdr(0),json(utf8s)]"}},"bytes":{"uploaded":%U,"read":%B}}}'
  option          http-keep-alive
  option          dontlognull
  option          tcp-smart-accept
  option          tcp-smart-connect

  retries 1
  option redispatch
  timeout http-keep-alive  72s
  timeout client           72s
  timeout connect          72s
  timeout server           72s

frontend fe
  bind *:3001
  option forwardfor
  default_backend be

backend be
  nuster cache on
  nuster rule r0 memory off disk on key method.scheme.host.path ttl 12d if { res.hdr(Content-Type) -m beg image/ }
  http-response set-header x-cache HIT if { nuster.cache.hit }
  server s1 localhost:3000
@jiangwenyuan
Copy link
Owner

@igorescobar There are some general advices regarding performance tuning on haproxy.org. For this specific TTFB on your specific environment, it's very hard to tell. Does all requests suffer such long ttfb? How does ELB perform? What if remove nuster? what happens if use memory on? etc.
I look forward to your investigation and tuning report:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants