Closed gnuvince closed 7 years ago
Thanks for the report @gnuvince - we've got a note in the docs about setting open file limits, and if you run ulimit -n 262144
in the terminal right before you run Pilosa, that will probably solve your immediate issue, but this keeps coming up, and I think I have a better solution.
We can use Go's syscall
package like so:
lim := &syscall.Rlimit{}
syscall.Getrlimit(syscall.RLIMIT_NOFILE, lim)
fmt.Printf("lim: %v\n", lim)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &syscall.Rlimit{Cur: 10000, Max: 10000})
fmt.Println("sycall.Setrlimit: ", err)
lim = &syscall.Rlimit{}
syscall.Getrlimit(syscall.RLIMIT_NOFILE, lim)
fmt.Printf("lim: %v\n", lim)
to set open file limits from within Pilosa. This will have to be tested on multiple platforms since syscall is OS specific, although the above works on my mac. If we can't set the limit very high, we should log a warning so that the user knows she'll need to get privileges to set the limit higher or whatever.
I created https://github.com/pilosa/pilosa/issues/722 for implementation of the long term fix. @gnuvince if the ulimit
fix I described works for you, please go ahead and close this ticket - if not, let us know and we'll dig in further.
Yep, the ulimit
workaround fixes the immediate issue, thanks!
Use ulimit -a
to list the current configurations. And under some versions of OS X ulimit -n 262144
just produces error: cannot modify limit: Invalid argument
. Find a solution here: How to persist ulimit settings in OSX Mavericks?.
For bugs, please provide the following:
Expected behavior
The
pilosa import
command give in the tutorial (https://www.pilosa.com/docs/getting-started/#sample-project) completes correctly.Actual behavior
The import command fails to complete and gives an error message saying that there are too many files opened. Attempting to re-execute the command gives the same error.
lsof | grep stargazer | wc -l
reports 20,280 files opened by Pilosa. Afterwards, Pilosa fails to start with the same error message.Steps to reproduce the behavior
Install Pilosa v0.4.0 and follow the tutorial.
Information about your environment (OS/architecture, CPU, RAM, cluster/solo, configuration, etc.)