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

Serialized and blocking connection #566

Open
awerlang opened this issue Jul 14, 2023 · 0 comments
Open

Serialized and blocking connection #566

awerlang opened this issue Jul 14, 2023 · 0 comments

Comments

@awerlang
Copy link

As I was verifying how a connection failure is experienced, I found the following about connections:

  • Client waits for 4-5s for each host to connect;
  • On failure, it tries the next ones, serially;
  • It blocks event loop (no await)
  • connTimeoutMs doesn't seem to work

Can this experience be improved?

Sample program and output:

import Aerospike from "aerospike";

const start = Date.now();
const client = Aerospike.client({
    "connTimeoutMs": 500,
    "hosts": "aerospike,aerospike2",
});
client.connect()
    .finally(() => {
        client.close();
    });
console.log(`Connection took ${Date.now() - start}ms`);
node@1f3bf2734242:/app$ node connect.mjs 
Jul 13 2023 17:22:54 GMT: WARN (9170) [as_pipe.c:208] [read_file] - Failed to open /proc/sys/net/core/wmem_max for reading
Jul 13 2023 17:22:54 GMT: WARN (9170) [as_pipe.c:267] [get_buffer_size] - Failed to read /proc/sys/net/core/wmem_max; should be at least 5242880. Please verify.
Jul 13 2023 17:22:54 GMT: WARN (9170) [as_pipe.c:208] [read_file] - Failed to open /proc/sys/net/core/rmem_max for reading
Jul 13 2023 17:22:54 GMT: WARN (9170) [as_pipe.c:267] [get_buffer_size] - Failed to read /proc/sys/net/core/rmem_max; should be at least 15728640. Please verify.
Jul 13 2023 17:22:58 GMT: WARN (9170) [as_cluster.c:281] [as_cluster_seed_node] - Failed to lookup aerospike1 3000. AEROSPIKE_ERR_INVALID_HOST Invalid hostname aerospike: Name or service not known
Jul 13 2023 17:23:02 GMT: WARN (9170) [as_cluster.c:281] [as_cluster_seed_node] - Failed to lookup aerospike2 3000. AEROSPIKE_ERR_INVALID_HOST Invalid hostname aerospike2: Name or service not known
Jul 13 2023 17:23:02 GMT: ERROR(9170) [command.cc:84] [ErrorCallback] - Client error in Connect command: Failed to connect [-1]
Connection took 7943 ms

node:18 container
aerospike client v5.6.0
runtime AWS Lambda

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

No branches or pull requests

1 participant