Under heavy load of my Node.JS server, I'm getting ECONNRESET socket error?

So I have an API server and a Web server. The web server is basically a client that talks to the API server. They both use Node.js wit REST endpoints.

When my web server hits the API server, sometimes I get {"err":{"code":"ECONNRESET"}} ...it's really random and sometimes I get it, sometimes in different places.

It's really hard to figure out what's going on, because I get it at different places.

How can I resolve this? I already increased "ulimit -n" to 99999.

What can I do? It freezes everything and the server can't move on when this happens.

ECONNRESET means the other side of the TCP conversation abruptly closed its end of the connection. File descriptor limit is not related here. This is most probably due to some application protocol errors. Look through that API server logs, it probably complains about something.