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

Falcon running out of file descriptors #17

Closed
ClearlyClaire opened this issue Sep 26, 2018 · 3 comments
Closed

Falcon running out of file descriptors #17

ClearlyClaire opened this issue Sep 26, 2018 · 3 comments
Assignees
Labels

Comments

@ClearlyClaire
Copy link

In my quest of having Mastodon handle requests asynchronously, I have toyed with using Falcon instead of Puma, and making HTTP.rb use wrappers provided by async-io.
This seems to work reasonably well except the falcon processes eventually crash because it ran out of file descriptors. This may due to HTTP.rb leaking sockets, as hinted by socketry/async-io#13, but stopping the process because it couldn't accept one connection doesn't seem right.

Traceback (most recent call last):
	7: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-1.10.3/lib/async/task.rb:74:in `block in initialize'
	6: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-io-1.15.5/lib/async/io/shared_endpoint.rb:74:in `block (2 levels) in bind'
	5: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-io-1.15.5/lib/async/io/shared_endpoint.rb:102:in `block in accept'
	4: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-io-1.15.5/lib/async/io/socket.rb:61:in `accept_each'
	3: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-io-1.15.5/lib/async/io/socket.rb:86:in `accept'
	2: from /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/async-io-1.15.5/lib/async/io/generic.rb:128:in `async_send'
	1: from /usr/lib/ruby/2.5.0/socket.rb:593:in `accept_nonblock'
/usr/lib/ruby/2.5.0/socket.rb:593:in `__accept_nonblock': Too many open files - accept(2) (Errno::EMFILE)
@ioquatix
Copy link
Member

That seems like a reasonable request. I will take a look.

@ioquatix
Copy link
Member

ioquatix commented Oct 1, 2018

Okay, so I'm just wondering, what is the correct behaviour?

If the process crash, should we restart it?

Should we detect file descriptor exhaustion and try to do something?

@ioquatix ioquatix self-assigned this Jan 26, 2019
@ioquatix ioquatix added the bug label Jan 26, 2019
@ioquatix
Copy link
Member

If a child process crashes, it will be restarted. That is the default now. So at least in the case of badly behaving code, this should be less of an issue. Also, use Async::HTTP::Internet as a replacement for http.rb. It's going to scale way better.

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

No branches or pull requests

2 participants