My solution to the Unexpected CURL error: Timeout was reached: [localhost:54321] Connection timed out

220 views
Skip to first unread message

Zhuoyu Wang

unread,
Dec 21, 2022, 12:48:21 AM12/21/22
to H2O Open Source Scalable Machine Learning - h2ostream
Hello,

I'm new to H2O and when I ran h2o automl in R, I got some errors as attached. I tried hard to find solutions for these errors, including trying different curl packages, upgrading memory size, and some other methods mentioned by others, but none of them worked.

Eventually I figured out the solution and would like to share it here, in case someone else face the same issue.

In my case, I noticed that after h2o.automl() started,  all CPU cores were used by H2O cluster, and the CPU usage was 100%. So I guess because the computer was too busy, the connection request from R to [localhost:54321] was not handled in time, and this led to the timeout and unexpected CURL errors.

 Based on this assumption, I changed the value of nthreads when calling h2o.init(). The default value of nthreads is -1, which means using all CPU cores for H2O cluster. Since my computer has 4 cores, so I changed nthreads to be 3, so that the other CPU core can be used to handle other tasks.

h2o.init(nthreads=3)

With this new setting, h2o.automl() works well.
 
Hope this helps people with the same issue.

----------------------------- Error message --------------------------------------------------------------
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix, : Unexpected CURL error: Timeout was reached: [localhost:54321] Connection timed out after 11651 milliseconds
[1] "Job request failed Unexpected CURL error: Timeout was reached: [localhost:54321] Connection timed out after 11651 milliseconds, will retry after 3s." Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix, :
Unexpected CURL error: Timeout was reached: [localhost:54321] Connection timed out after 11115 milliseconds
[1] "Job request failed Unexpected CURL error: Timeout was reached: [localhost:54321] Connection timed out after 11115 milliseconds, will retry after 3s." Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix, : Unexpected CURL error: Timeout was reached: [localhost:54321] Resolving timed out after 10533 milliseconds
[1] "Job request failed Unexpected CURL error: Timeout was reached: [localhost:54321] Resolving timed out after 10533 milliseconds, will retry after 3s." Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = urlSuffix, : Unexpected CURL error: Timeout was reached: [localhost:54321] Connection time-out
[1] "Job request failed Unexpected CURL error: Timeout was reached: [localhost:54321] Connection time-out, will retry after 3s."

 
Reply all
Reply to author
Forward
0 new messages