I am getting connection reset error when trying execute two queries at the same time?

25 views
Skip to first unread message

Syam

unread,
Sep 28, 2020, 7:38:59 AM9/28/20
to ArangoDB
I am using arangojs v6.14.1 and arangodb version 3.6.4.

I have nodejs express app which intended to serve client requests.

I am experiencing an issue while executing concurrent requests. The database connection hangup when I concurrently process client requests:

What the app will do when it receives a request?

Open a database connection -

db = new Database(dbConfig.url); db.useDatabase(dbConfig.name); db.useBasicAuth(dbConfig.username, dbConfig.password);

There are multiple middleware functions that need to access to perform various functions and accessibility checks. And for each middleware I tried to

  • open a new database connection ->
  • perform the action ->
  • close the connection ->
  • return the result to next middleware.

This works fine with single request at a time. But if I tried to call two APIs at same time, I am getting CONNECTIONRESET error. And also throwing socket hangup error.

I tried to commend out the close connection method and it started working fine for a while. But when I increased the number of connections, it again showing the same error as "CONNECTIONRESET".

I have searched the documentation of arangojs regarding the connection manipulation. But I havent found any information regarding the same.

I hope to get some help from the community here.

Any help would be deeply appreciated.

Thanks Syam


Reply all
Reply to author
Forward
0 new messages