I run an node.js client which send a lot of requests to my server (which written also in node.js).
The server get a request for a specific file, and upload it to S3.
I get the following error after two minutes that everything goes well:
{ [NetworkingError: getaddrinfo ENOTFOUND]
message: 'getaddrinfo ENOTFOUND',
code: 'NetworkingError',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
region: 'us-east-1',
hostname: 'XXXX.s3.amazonaws.com',
retryable: true,
time: Sun Oct 12 2014 11:27:54 GMT-0400 (EDT),
_willRetry: false }
After I did a small research, i found that it happens probably because I'm trying to open too many file handles, or sockets, which can really only happen after a while.
But as I understand, node.js should encapsulate this issue for me. In other words, node.js should understand the limit of the file descriptor, and open a new one according to this limit. This is the advantages of using one user thread based on event (Where I wrong?)
If node.js doesn't do it, what the best solution for this error, which is not to increase my open file limit (This is a bad idea, because we need a good performance on this machine. This and more, How will I be sure that if I would increase the number, this error would not appear again? How would I know the number the OS should have for this application?)