How to set the maximum request rate for algod?

I have an application where I need to fetch a lot of requests from algod every X seconds.
Algod sometimes returns me an error (Error: connect ECONNRESET in node.js) because I query it “too much”.

The thing is, this is my node, I want to query it as much as I want.
I tried to change the MaxConnectionsPerIP and ConnectionsRateLimitingCount to a high number, and ConnectionsRateLimitingWindowSeconds to 0, but I still get the same error.

Just so you know, when I lower my requests interval, everything works great so it’s only a matter of a connection rate to change. Do you guys have any idea how I could change this parameter? Thank you!

The config parameters you mentioned above would affect the gossip server endpoint ( i.e. on relays ), and would not affect the REST endpoint.

I’m unaware of request restrictions on the REST endpoint. I have three suggestions -

  1. Try to verify that you’re using the same http connection for all the request. You can verify that with wireshark.
  2. Try to use http 1.0 to avoid the keep-alive.
  3. Try Increase the number of file descriptors.

I hope that one of these would solve the issue you’re seeing.

1 Like