Skip to content

net/http, time: Wapper Timer with sync.Pool will improve proformace of transport 20% more. #9170

@gopherbot

Description

@gopherbot

by stormgbs:

go version: go1.3.3 linux/amd64

What does 'go version' print?

I am doing prefomace optimization for gorouter. 
1. The avg qps of gorouter is about 13000 without ResponseHeaderTimeout disabled.
2. The avg qps of gorouter is about 15500 with ResponseHeaderTimeout disabled.
3. I found that time.After() in net/http:tranport.go consumed an unwieldy amount of
memory after finishing pprof.
4. The avg qps of gorouter beccame about 15500 again after I finished wapper Timer wich
sync.Pool.

sync.Pool is prefect.

The patches are attached.

Attachments:

  1. sleep.go.patch (1177 bytes)
  2. transport.go.path (1193 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions