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
How many concurrent queries per connection can arangodb execute? #379
Comments
Since it uses HTTP 1.1 so there must be 1 query at a time per connection |
Connection.agentDefaults = { i found the above in the source code https://github.com/arangodb/arangojs/blob/5387a6e560418380a99fc6dc3c59b433b2570bdf/src/connection.js |
@p30arena you can also create multiple database instances. Or you create a simple pool. // create new connection
db = new Arangojs.Database(arangoOptions)
// fill pool
pool[databaseName] = { connections: [], max: maxConnections }
pool[databaseName].connections.push(db)
but I agree after some research its good practice to increase the |
but +1 for native connection pool support. Use case:
|
arangojs automatically pools connections and uses keep-alive to reuse existing connections until they time out. There's no point in additionally maintaining a pool of arangojs database objects yourself. For best results you should set |
Hi @pluma when I change my database with Arangojs() is equal with When I have 100 clients and 100 databases. I have to create 100 database, 100 connections. |
I'm talking about the connection pool we have implemented in arangojs: https://github.com/arangodb/arangojs/blob/v5.4.2/src/util/request.js -- the node.js request pool is actually not very good for arangojs's use case (i.e. keep-alive with many potentially very small requests). There's currently no way to share connection pools between multiple database objects because database objects and connection objects are closely tied to support use cases where a specific database is exposed via a proxy (i.e. we can't just assume the database name will always be part of the URL). If you see a way to refactor the connection object in a way that allows us to support a |
I'm closing this on the assumption that the question has been answered. Feel free to reopen this issue if there's anything missing in the answer. |
I'm making connections to my Foxx service using nodejs http client. Whats happening????
|
That looks like you're using the node version of the driver in the browser (at least that's what "AJAX" suggests). In that case you should keep in mind that the socket limits as well as the driver's connection pool will be per client, or more specifically per context (multiple tabs = multiple contexts). Also it looks like you're making direct requests to the server using |
@pluma Can I send Foxx requests using the driver? I didn't find anything in the docs. |
@p30arena Check the section on arbitrary routes, it includes an example. If you have more questions please consider using the public ArangoDB Slack community. |
I think the issue was with the OS's 7200 sec delay of keep alive probing. |
Do I need to create multiple connections and do connection pooling?
The text was updated successfully, but these errors were encountered: