Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Merge requests
  • !573

Issue #570: Disable keep-alive if no agent.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/jwalton/alternate-fix into master Feb 03, 2014
  • Overview 6
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: jwalton

This is an alternative fix for #570 (closed) (see my other pr #572).

The idea here is that if no agent is specified, we explicitly set keepAlive to false.

If keepAlive is true, then every time we proxy a request we will create a new connection (because there is no agent managing a pool of connections), but with keepAlive set, node.js will not kill the connection after we make a request. The connection will stay open (potentially for several minutes) eating up a file descriptor.

With keepAlive set false, node.js will close the connection for us after the request is made, cleaning up the resources immediately. Under heavy load, this will result in far more connections than in PR #572, but may or may not result in better performance overall. When heavy load clears, however, the connection count will drop back down immediately.

Note that, with or without this fix, connections are not being reused - all this does is clean up connections after we're done with them. Also not that in node v0.11.11, this option is implicitly set for us when node assigns us an agent.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jwalton/alternate-fix