quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.8k stars 310 forks source link

limited environments run into deno memory issues #4197

Open cscheid opened 1 year ago

cscheid commented 1 year ago

Some part of v8's startup process mmaps an 8GB chunk of memory. We need to allow users to configure that.

statik commented 1 year ago

thank you!

cscheid commented 1 year ago

@statik I just asked the deno folks during deno office hours, and unfortunately they didn't have a ready answer for me. The best advice they had was for us to look at the v8 flags available. I went over them (there's 500+) and I couldn't find anything that jumped at me. I'll follow up with you directly for next steps.

statik commented 1 year ago

@cscheid thank you!

lachlansimpson commented 1 year ago

Seen in Posit's internal customer ticket 88813. Reporting that, within Posit Workbench,

when setting max-memory-mb =7000 (which is not a ridicul amount), we can't launch any quarto

cscheid commented 1 year ago

Hey @datakid - can you add some context to your message for the non-posit folks that read this repo? Thanks!

VincentGuyader commented 1 year ago

Hey @datakid - can you add some context to your message for the non-posit folks that read this repo? Thanks!

I'am the "Posit's internal customer ticket" author :)

In posit workbench, I can choose to restrict the RAM available to users. This is done in the /etc/rstudio/profile file. (see : https://docs.posit.co/ide/server-pro/latest/rstudio_pro_sessions/user_and_group_profiles.html)

On shared servers, even powerful ones, we will often restrict the ram to allow everyone to work properly.

Here if I put less than 8Gb of ram each, the users can't initiate a quarto anymore...

cscheid commented 1 year ago

@VincentGuyader got it. Unfortunately I haven't been able to figure out the v8 option to reduce the amount of address space it requests. I can see through a profile that it never actually allocates that much ram. The strace log shows a call to mmap that "sets aside" 8GB of virtual memory addressing, but doesn't actually allocate it. In our experience, the latest version quarto doesn't allocate more than ~1.5GB of RAM. Is it possible to configure different rules for different processes?

tnederlof commented 1 year ago

A Posit Workbench customer also encountered this on one of their QA servers where the user profile was set below 8gb and were getting v8 errors in the terminal. Setting the limit > 8gb fixed it.

cscheid commented 1 year ago

@tnederlof that's good to know, thanks. If you figure out a way to separate the allocation of virtual memory space vs actual virtual memory, we could document that as well.

tnederlof commented 1 year ago

@cscheid I cross-referenced the issue I opened on rstudio-pro repo, I figured out how to reproduce it at least. It seems on the Workbench side it occurs only when an explicit max-memory-mb is set below 8gb. The absence of any max setting or setting it above 8gb it works fine (even on a VM that only has 4gb of RAM. Hope this helps somehow!

statik commented 1 month ago

I'm hitting this problem again with quarto 1.5, but with 1.5 I have to set workbench memory limits much higher. 18gb didn't work, but 24gb did. This effectively prevents me from using workbench session memory limits.

cscheid commented 1 month ago

That's strange, because we didn't change anything in Deno this time around...

mtkapp277 commented 3 days ago

We were encountering a similar quarto / new project hanging issue. In short, we changed to a different container: rstudio/rstudio-workbench:ubuntu2204-2023.12.1-402.pro1 And We unmounted, deleted, then recreated the nfs share /home directory with 755 permissions and remounted. The /etc/fstab was updated to match posit docs 100%.

We did try to deploy with the container we have been using against the new NFS changes, but we still encountered problems. This leads us to believe the container was bad. It had multiple paths for quarto for some reason.

cscheid commented 3 days ago

@mtkapp277 It sounds like you're describing a situation with one of Posit's commercial offerings. In that case, would you mind reaching out directly to our support staff? They should be able to help and they will have more context.