okeuday / uuid

Erlang Native UUID Generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running out of file descriptors...

lpgauth opened this issue · comments

Hi,
It seems that in 0.1.4 generating a UUID v1 uses an fd? Is that possible? I had to revert to 0.1.0 because my box kept running out of file descriptors and coudn't keep my network connections open.

This is how I call it:
uuid:uuid_to_string(uuid:get_v1(uuid:new(self())))

I don't think this is possible with the uuid code in this repository, since it is native Erlang. You should see no difference between the versions, since the same basic function calls are taking place. Other uuid Erlang libraries use a port/port_driver/NIF for integration with C uuid code, and those libraries would be more prone to consume file descriptors. If you are using CloudI, it might be using lots of file descriptors based on the configuration, but that would not be related to this uuid code.

I think the Crypto library is a port...

crypto is not used by the v1 uuid. Also, recent versions of Erlang use a port driver for crypto functionality and it is not implemented in a way that would just accumulate file descriptors.

But new() does use crypto since this since commit 9f3e86a.

9f3e86a

Anyways, I reverted to 0.1.0 and my app is stable again. I'm not sure what the cause of the problem is...

Ok, you are right, new() does use crypto. However, usage of crypto should not be consuming tons of file descriptors. If crypto is doing so, then it should be reported to the erlang-questions mailing list. I really don't think crypto is the problem though, since it has been in Erlang for a long period of time.