-
Notifications
You must be signed in to change notification settings - Fork 180
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
Reduced CStack limit in Built Image #712
Comments
Thanks for explaining the problem. But is this a problem with the Rocker project? This seems to be the default value for Linux. If this is coming from Linux, I think the change should be made carefully. @eddelbuettel @cboettig Any thoughts? |
Can you start from a bash shell and then try |
Also, for what it is worth, on my Linux host I see the same value outside of Docker and inside: $ ulimit -s
8192
$ docker run --rm -ti rocker/r2u bash -c 'ulimit -s'
8192
$ |
Hello @eddelbuettel!:-) It makes sense in your system you see the same size both inside and outside docker, since you are on Linux, and the container would look a lot like your environment.
However, this did not increase the stack limit, which still remained at less that half that amount. But, I did manage to fix the code by splitting the more wider data frames used as arguments in the UDF that I was having issues with column wise, so that I have two "leaner" data frames, calling the same UDF on each set of the leaner data frames, and then combining the results.
Perhaps not the best approach, but this is holding up for all of my tests so far. I should still argue, though, that ideally, the limit should be increased in the base image. I'd leave that decision up to the developers. |
Got a solution for you @Ramachandran-CHEENIYIL It seems docker allows you to set ulimits on run. If you are using docker-compose:
if you are using just the standard docker run from CLI, its:
I have tested it, and works beautifully. |
@CoolShades thanks, that's awesome. (I've occasionally been bitten on the n open file limits) |
@CoolShades Thank you for the idea :-) However, it is not the run that I need to set the limit on. I am not very familiar with Docker Compose, but with what I have read, I understand that it is not recommended for the Production environments. Is there a justification to the contrary here? If so, I'd try it. And the image will not be run via CLI. It will be pushed on to a container registry from where a web application would pick it up and host it. |
Container image name
rocker/shiny-verse:4.1.3
Container image digest
rocker/shiny-verse@sha256:cef2c8eb1202797a224dfad9cd01312ce13041dee43d542a57a5e7c67c9e753f
What operating system are you seeing the problem on?
Linux
System information
-Docker version 20.10.13, build a224086
Bug description
The CStack limit in the images built using this base image is half of what is available in local, Windows, system. This is causing certain resource intensive processes in our engine to break down with the error message:
Warning: Error in : C stack usage 7969508 is too close to the limit
These processes differ from working cases in something as little as going through a 50 column csv input file to a 100 column csv input file.
It is not possible to change this limit from within R, and the environment where the image is being hosted have security measures preventing us from tampering with the base image by writing custom commands in the dockerfile.
How to reproduce this bug?
Run the following function in R console in local
Afterwards, run the same function in any image built with rocker/shiny-verse or even the base image, as shown below
docker run -ti rocker/shiny-verse:4.1.3 R -q -e "Cstack_info()".
Chances are that you will see the Cstack_info()$size value to be half of what you have in your local Windows system.
The text was updated successfully, but these errors were encountered: