Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to open multiple ports to the Statsd UDP port #48

Closed
sneako opened this issue Feb 20, 2020 · 1 comment · Fixed by #51
Closed

Ability to open multiple ports to the Statsd UDP port #48

sneako opened this issue Feb 20, 2020 · 1 comment · Fixed by #51

Comments

@sneako
Copy link
Contributor

sneako commented Feb 20, 2020

First off, thanks for this great library! It is one of a few libraries that I usually include in a new Elixir application by default.

In one of my higher throughput applications, we started noticing a high number of :busy_port notifications, which turned out to be coming from the Statix port.

I tried out #35 to see if perhaps we could reduce the number of notifications by connecting to the unix socket directly, and also tried #42, switching the Port.command/2 to :gen_udp.send/4, but I am still seeing many busy port notifications.

So I tried another strategy which I have used in this application to reduce pressure, which is to start multiple processes, and choose one randomly.

In my testing I was able to completely eliminate all :busy_port notifications using this strategy.

I am very interested to hear your thoughts on the matter and whether a PR would be accepted.

Here is my fork master...sneako:rand-pool.

Thanks again!

@lexmag
Copy link
Owner

lexmag commented Mar 5, 2020

Hi @sneako, I think your strategy is definitely reasonable and if it solves your problem we should get it merged. 👍
I've just added an outer struct (6470472) that should help keeping Conn struct cleaner.
Can you please base your implementation on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants