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

Do not use keep-alive or reuse them across requests #109

Closed
Slind14 opened this issue Feb 11, 2019 · 3 comments
Closed

Do not use keep-alive or reuse them across requests #109

Slind14 opened this issue Feb 11, 2019 · 3 comments
Labels

Comments

@Slind14
Copy link

Slind14 commented Feb 11, 2019

Hi there,
the current implementation of curl is keeping connections open and not reusing them across requests. This is clocking up connections with TIME_WAIT:

netstat -tan | awk '$5 ~ /:813/ {print $6}' | sort | uniq -c | sort -n
      1 FIN_WAIT2
      2 ESTABLISHED
  92272 TIME_WAIT

I would suggest to avoid using keep-alive or switching to something like pecl-http which is using a shared pool of connections across requests according to this: https://stackoverflow.com/questions/41623271/php-and-persistent-http-connections/41643667#41643667

@isublimity
Copy link
Contributor

isublimity commented Feb 11, 2019

I think, i disable keepAlive by default.

$new->connectTimeOut($this->_connectTimeOut)->keepAlive(); // one sec

public function keepAlive($sec = 60)

@Slind14
Copy link
Author

Slind14 commented Feb 11, 2019

We migrated to pecl_http with custom post requests.

@isublimity
Copy link
Contributor

build 1.3.2

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

No branches or pull requests

2 participants