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

is there a way to increase ulimit ? #38

Open
happysalada opened this issue Dec 21, 2022 · 10 comments
Open

is there a way to increase ulimit ? #38

happysalada opened this issue Dec 21, 2022 · 10 comments

Comments

@happysalada
Copy link

I get the following failures when trying to update my system.

building the system configuration...
error (ignored): error: opening directory '/tmp/nix-build-perl-5.36.0-env.drv-4': Too many open files
error (ignored): error: opening directory '/nix/store/lkpm61x3fsckk4cniy4clsgp62wg9xn6-perl-5.36.0-env.drv.chroot': Too many open files
error (ignored): error: opening directory '/nix/store/kqwhbsypilb7g7sky5a6v1l1r1cr89vi-perl-5.36.0-env.drv.chroot/nix/store/0h17z31z87cfggv77bakfk7cdk1r06fr-perl-5.36.0-env/lib/perl5/5.36.0': Too many open files
error: creating pipe: Too many open files

is there an attribute to increase the ulimit ?

@MatthewCroughan
Copy link
Owner

MatthewCroughan commented Dec 21, 2022

This error is awesome, I love macOS. (maybe I'm speaking too soon.) Maybe we should make an issue label for macOS specific issues.
https://apple.stackexchange.com/questions/32235/how-to-properly-increase-a-ulimit-n-limits

If you do find a solution you can prepend to the command, let me know and I'll implement a fix. With the new Nixinate I'm working on, you'd be able to add this to your preDeployScript, so hang tight!

@MatthewCroughan
Copy link
Owner

And thank you for making these issue reports, it's really interesting to see the edge cases that you are hitting.

@happysalada
Copy link
Author

ulimit -n 8196
should do it.
looking forward to the new nixinate!

@happysalada
Copy link
Author

did you see my previous comment, I've just ran into the error again. (it's for a deployment that needs a lot of derivations built).

@happysalada
Copy link
Author

hey @MatthewCroughan , let me know if there is anything I can do more to help on this one.

@iFreilicht
Copy link

@happysalada can't you just run ulimit -n 8196 on your machine? That should fix the issue, right? Alternatively, it seems like buildOn = "remote" could solve this as well (if the target is powerful enough, of course).

Are you proposing that the nixinate script should set the ulimit? Is that even possible inside a sandboxed shell?

@happysalada
Copy link
Author

Im using remote already
The ulimit looks like it doesnt persist between different shells, ive tried setting it in another shell and it didnt affect my deployment

I dont feel too strongly about this issue, as my workaround is just to build less things

@iFreilicht
Copy link

Ah got you. Just to clarify, are you deploying from a MacOS host to a remote Linux machine or from a Linux host to a remote MacOS machine? I do have one of each so could try to replicate and integrate a workaround, it seems straightforward enough.

@happysalada
Copy link
Author

Macos host to a linux machine.
My current workaround is to build less stuff at first then to rebuild the rest on the second deploy.
I havent found another way around this problem yet.

@nixinator
Copy link
Contributor

nixinator commented Nov 23, 2023

https://unix.stackexchange.com/questions/108174/how-to-persistently-control-maximum-system-resource-consumption-on-mac

now thats a weird and wonderful way to set ulimit!!! Apple , how do make setting a simple configuration option like ulimit so mind numbing difficult.... it's so overly convoluted, it's pure genius!

Anyway, that think apple has a future over 'just running photoshop'... is greatly mistaken.

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

4 participants