Skip to content

Can't raise "open files" ulimit #1688

@aseering

Description

@aseering

Please use the following bug reporting template to help produce actionable and reproducible issues. Please try to ensure that the reproduction is minimal so that the team can go through more bugs!

  • A brief description

The "open files" ulimit can't currently be increased.

I know of two use cases for setting this ulimit:

  • NodeJS (and therefore lots of common NodeJS tools -- npm, grunt, etc) has a common design idiom of "process all of these files", whose default implementation is to open all of the files asynchronously and process them as the OS gets around to reading them. "All of the files" can be quite a lot :-) So NodeJS users often have to either bump this limit, or modify their own tools to use graceful-js. Modifying existing tools can be hard, so simply bumping the limit is sometimes the preferred workaround. (I think this is the real issue behind Defult ulimit way too low #1679 )

  • Some databases (I personally know that Vertica does this; I think I recall hearing that MySQL can do the same?) can, in certain situations, open very large numbers of file descriptors. The objective is typically to have some clever effect on query performance. Decreasing the number of available file descriptors sacrifices query performance and/or causes errors.

  • Expected results

$ ulimit -n 65536
$

And the actual limit is updated

  • Actual results (with terminal output if applicable)
$ ulimit -n 65536
bash: ulimit: open files: cannot modify limit: Operation not permitted
  • Your Windows build number

15031

  • Steps / All commands required to reproduce the error from a brand new installation

See above

  • Strace of the failing command

If you really want an strace of bash -c 'ulimit -n 65536', I can post one. It's going to be long, though, and I bet y'all already know what the important part is :-)

  • Required packages and commands to install

None -- bash builtin.

See our contributing instructions for assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions