We are poking around and looking for the following "cannot allocate memory" error message:
Failed to open TCP connection to elasticloadbalancing.us-west-2.amazonaws.com:443 (Cannot allocate memory - connect(2) for \"elasticloadbalancing.us-west-2.amazonaws.com\" port 443)
Target testing Ruby 3.2's TCPSocket.open call here: https://github.com/ruby/net-http/blob/v0.3.2/lib/net/http.rb#L1271-L1273. (Ruby TCPSocket implementation: https://github.com/ruby/ruby/blob/master/ext/socket/tcpsocket.c)
Also test specifically against elasticloadbalancing.us-west-2.amazonaws.com:443
as the target connection in case that's causing the issue.
- Run
ruby tcp-server.rb
. Leave it running. - Run clients
ruby tcp-client-loop.rb
. Leave it running. Run as many simultaneous clients as you want to stress the server-client connections over the port. For example, run 5 clients simultaneously. - Any errors/exceptions will crash the client script, allowing you to simply run and wait until you see something interesting.
Results: No error when running 5x TCP clients at full blast on loop. Ran for about 10-20 minutes. Observed until an accumulated 500k connections without any error (about 10 minutes). Noticed that there would be some pauses and then bursts of progress, probably due to timeouts and deadlocks for resources, but there were no errors.
TODO - Probably not going to firehose AWS like I did to my localhost, so I'll investigate the output from the TCPSocket in-depth in case the output is too large and causing the "cannot allocate memory" error.