how to know if connections is dead? #12715
-
I did thisI pursuit the best performance, which means i want to reuse the connection, and want the connection never close. I tried these options:
I expected the followingi think after i set these options, the CURL* wont build connections more than once(of course no resolving process). in the most request, it will ignore the build connection's process, as the PRETRANSFER_TIME is very short. but there is always about 5% request rebuild the connection, i dont know why. could you help on this? how can i check the connections cache in memory to know if the old connections dead or alive? curl/libcurl versioncurl 8.5.0 operating systemcentos stream 8 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Typically libcurl tells in the verbose output when it deems a connection needs to get closed. If you have connections in the pool for a long time before trying to reuse them, Some reflections on your code:
To never timeout the DNS cache is aggressive, I hope you know what you are doing. |
Beta Was this translation helpful? Give feedback.
-
from verbose, there is some more details:
is this mean tcp_keepidle failed to work? |
Beta Was this translation helpful? Give feedback.
Typically libcurl tells in the verbose output when it deems a connection needs to get closed.
If you have connections in the pool for a long time before trying to reuse them,
CURLOPT_MAXLIFETIME_CONN
will matter.Some reflections on your code:
CURLOPT_ACCEPT_ENCODING
since 7.21.6""
to let libcurl pick among the ones it supportsTo never timeout the DNS cache is aggressive, I hope you know what you are doing.