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

Too many open files, crash when serving static files. #108

Closed
skunkworker opened this issue Jun 11, 2017 · 5 comments
Closed

Too many open files, crash when serving static files. #108

skunkworker opened this issue Jun 11, 2017 · 5 comments

Comments

@skunkworker
Copy link

When running a stress test against the example hello world app I got it to crash when trying to hit /index.html

wrk -d 20 -t 4 -c 1015 http://0.0.0.0:4000/index.html

Params: =index.html
accept: Too many open files (Errno)
0x10defddc5: *CallStack::new:CallStack at ??
0x10df00a6e: *raise<Errno>:NoReturn at ??
0x10dfbb065: *Amber::Server#start:Nil at ??
0x10defbfa2: __crystal_main at ??
0x10df24bdb: main at ??

I'm thinking it could be an open file descriptor issue or something else, but I'll look into see if its a crystal-lang bug or something that we can tackle.
Possibly related - crystal-lang/crystal#780

@skunkworker
Copy link
Author

I may have been running into 10.11's ulimit limit of only 256 open file descriptors.
https://blog.dekstroza.io/ulimit-shenanigans-on-osx-el-capitan/

@elorest
Copy link
Member

elorest commented Jun 11, 2017 via email

@eliasjpr
Copy link
Contributor

Is this still a valid issue. It looks like is more a server config issue. LMK

@akzhan
Copy link

akzhan commented Jun 15, 2017

It's invalid. wrk ran with 1015 of HTTP connections to keep open with each thread and with 4 threads.

So I suppose that 4K connections may be established sometimes. You need approx. limit of 8K+ of descriptor (4K connections and 4K handles to static files).

https://stackoverflow.com/questions/880557/socket-accept-too-many-open-files

@drujensen
Copy link
Member

closing this issue.

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

No branches or pull requests

5 participants