[erlang-questions] phantom ports in erlang:ports()

Valentin Micic valentin@REDACTED
Fri Nov 16 07:29:21 CET 2012


I am wondering if this may be attributed to CLOSE_WAIT/TIME_WAIT states sockets may be in during the connection shutdown?
By the some token, if the server in question has a higher frequency of short-lived connections,  this may also explain discrepancy between number of file descriptors as reported by lsof and number of active ports reported by emulator.

Just speculating, of course.

V/


On 13 Nov 2012, at 1:35 PM, Tim Watson wrote:

> Hi guys - can anyone answer this (below) please?
> 
> Begin forwarded message:
> 
>> From: Matthias Radestock <matthias@REDACTED>
>> Subject: phantom ports in erlang:ports()
>> Date: 12 November 2012 18:37:47 GMT
>> To: erlang-questions@REDACTED
>> 
>> I've got a customer system, running R15B02, which encountered system_limit errors when accepting tcp connections.
>> 
>> 'lsof' indicates that there are just a few hundred file descriptors in use. However, erlang:ports() returns 1010 entries. For the majority of these ports:
>> - erlang:port_info(Port) returns 'undefined'
>> - port_close(Port) fails with 'badarg'
>> - exit(Port, die) doesn't make them go away
>> 
>> These ports have been in that state for days.
>> 
>> Does anybody have any clue what's going on here?
>> 
>> Is there any way to find out more about these ports? Looks like ctrl-c'ing in the emulator shell would allow me to get more info with the 'o' option. Unfortunately the customer's emulator is running detached, so that won't work.
>> 
>> Regards,
>> 
>> Matthias.
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list