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

Pixi eats all my memory and then dies #2458

Closed
2 tasks done
flying-sheep opened this issue Nov 11, 2024 · 11 comments
Closed
2 tasks done

Pixi eats all my memory and then dies #2458

flying-sheep opened this issue Nov 11, 2024 · 11 comments

Comments

@flying-sheep
Copy link

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

git clone https://github.com/holoviz/holoviews.git
git checkout 1f534a1b777bd87a8dc3ddbf299a7cae44159540
pixi install

it gets further than that, but it’s always a race against time to be able to copy it:

⠚ updating lock-file   [00:00:03] [━━━━━━━─────────────────────────────────]   14/82                                                                                                                                                                                                                      
  ⠉ test-311:linux-64    [00:00:03] resolving conda
  ⠉ test-311:win-64      [00:00:03] resolving conda
  ⠉ test-311:osx-64      [00:00:03] resolving conda
  ⠉ test-312:linux-64    [00:00:03] resolving conda
  ⠉ test-312:win-64      [00:00:03] resolving conda
  ⠉ test-ui:linux-64     [00:00:03] resolving conda
  ⠉ test-312:osx-64      [00:00:03] resolving conda
  ⠉ test-ui:osx-64       [00:00:03] resolving conda
  ⠉ test-ui:win-64       [00:00:03] resolving conda
  ⠉ test-gpu:linux-64    [00:00:03] resolving conda
  ⠉ test-core:linux-64   [00:00:03] resolving conda
  ⠤ default:linux-64     [00:00:01] resolving conda
  ⠲ default:win-64       [00:00:00] resolving conda
  ⠲ default:osx-64       [00:00:00] resolving conda
  ⠚ build:linux-64       [00:00:00] loading repodata
  ⠙ build:osx-64         [00:00:00] loading repodata                                                                                                                                                                                                                                                      

Issue description

I have 16GB of memory, and pixi doesn’t seem to have a setting to reduce the number of threads/processes it uses.

I’m pretty sure the OOM killer kills it.

Expected behavior

not that.

@ruben-arts
Copy link
Contributor

Thanks for reporting!

@ruben-arts ruben-arts added the 🐞 bug Something isn't working label Nov 11, 2024
@flying-sheep
Copy link
Author

No problem! Some more details:

  • I’m on Arch Linux
  • I did witness the memory climbing until it almost filled up, so the OOM killer hypothesis is is a very informed guess

@AvishekMondalQC
Copy link

Implementing a memory limit as suggested here #2214 (comment) would be super helpful!

@ruben-arts
Copy link
Contributor

I discussed that with @baszalmstra the other day but it doesn't seem like a memory limit is something we can technically do. But we do need to find a solution for this. Turning off/limiting concurrency should be doable.

@bollwyvl
Copy link
Contributor

On the main, having robust parallelism for "things pixi does" (be they project-defined tasks, or "system" things that impact the graph like locking and installing envs) is a big limitation. Always needing a make-like -j, but only for solves, would be unsatisfying, as installing envs in parallel, running tests in parallel, or starting multiple long-running processes would all benefit from some resource-aware scheduling.

@MarcSkovMadsen
Copy link

+1. I experience the same issues. See panel-extensions/copier-template-panel-extension#4 (comment).

@baszalmstra
Copy link
Contributor

I investigated this further and confirm that the solver is using a lot of memory due to a very high number of possible candidates for some packages. Specifically pyarrow and arrow-cpp.

We will fix this in the solver but its a relatively large refactor that will take some time.

ruben-arts added a commit that referenced this issue Nov 28, 2024
### Why
Pixi can possibly use a big amount of memory during the solve or network
requests during the repodata fetching. While we search for a
better/automated solution we want to let the user escape the issue by
forcing the amount of concurrent jobs.
The related issue is: #2458

### What this PR adds
As a user you can now define the max concurrent solves and max network
requests in two ways
**CLI**
```
pixi install --concurrent-solves 3
pixi install --concurrent-downloads 12
```
**configuration**
```
pixi config set concurrency.solves 1
pixi config set concurrency.downloads 12
```
`config.toml`
```toml
[concurrency]
solves = 2
downloads = 12
```
### TODO:
After initial approval of design I'll add the following:
- [x] : Add documentation
- [x] : Add basic cli and configuration test to the integration tests
jjjermiah pushed a commit to jjjermiah/pixi that referenced this issue Nov 30, 2024
### Why
Pixi can possibly use a big amount of memory during the solve or network
requests during the repodata fetching. While we search for a
better/automated solution we want to let the user escape the issue by
forcing the amount of concurrent jobs.
The related issue is: prefix-dev#2458

### What this PR adds
As a user you can now define the max concurrent solves and max network
requests in two ways
**CLI**
```
pixi install --concurrent-solves 3
pixi install --concurrent-downloads 12
```
**configuration**
```
pixi config set concurrency.solves 1
pixi config set concurrency.downloads 12
```
`config.toml`
```toml
[concurrency]
solves = 2
downloads = 12
```
### TODO:
After initial approval of design I'll add the following:
- [x] : Add documentation
- [x] : Add basic cli and configuration test to the integration tests
@ruben-arts
Copy link
Contributor

In #2569 we implemented an escape hatch so you can define a max set of --concurrent-solves so you can tell pixi to stress the system less.

@ruben-arts
Copy link
Contributor

As an update, huge improvements are on it's way. @baszalmstra had some fun over Christmas:

@ruben-arts
Copy link
Contributor

We're currently not actively searching for more solutions to this problem. If you encounter this, please share the environment and on what machine you are running this.

@ruben-arts ruben-arts removed the 🐞 bug Something isn't working label Jan 16, 2025
@flying-sheep
Copy link
Author

OK, this seems good now!

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

6 participants