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

Docker for Windows mssql-server-linux:latest fails to run due to memory limit #293

Open
wsmelton opened this Issue Apr 20, 2018 · 17 comments

Comments

Projects
None yet
8 participants
@wsmelton
Copy link

wsmelton commented Apr 20, 2018

I may be doing this wrong...

Docker: 18.04.0-ce-win62 (17151)
image: microsoft/mssql-server-linux:latest

I'm just trying to run the following:

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=supersecret" -p 1417:1433 --name sql17 --platform linux -d microsoft/mssql-server-linux:latest

I can see the container in VS Code created and started, but then immediately stops. I check the logs:

docker logs sql17 --tail 50 -f
sqlservr: This program requires a machine with at least 2000 megabytes of memory.

So I saw mention in another issue about -e "MSSQL_MEMORY_LIMIT_MB=3072" so I tried that but still gets the same error.

Am I doing something wrong?

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented Apr 20, 2018

if you are literally using supersecret as your password it isnt meeting complexity requirements. You can run it without -d to see the output and see if there is anything useful there.

@wsmelton

This comment has been minimized.

Copy link

wsmelton commented Apr 20, 2018

Oh, you twisted my arm...I'll release my super secret password...but all the output I get is the same.

image

@wsmelton

This comment has been minimized.

Copy link

wsmelton commented Apr 20, 2018

I'm pulling down the Ubunut:latest image to just see if I can get it to run. It may be just an issue with trying to run Linux over Windows mode...

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented Apr 20, 2018

Ah ha! You are hitting this issue where Linux Containers on Windows (LCOW) is limited to max 2GB of memory.
Microsoft/opengcs#145

@wsmelton

This comment has been minimized.

Copy link

wsmelton commented Apr 20, 2018

I wonder why the that image is an issue because this works with no issue:

docker run -it --platform linux ubuntu:latest

image

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented Apr 20, 2018

The vanilla ubuntu VM can probably easily run with less than 2GB of RAM. SQL Server requires 2 GB+ of RAM. The error message you see there comes from sqlservr. It's a resource prerequisite check we do on start up of the sqlservr process.

@georgedorn

This comment has been minimized.

Copy link

georgedorn commented Apr 23, 2018

I've read that there are options to reduce the memory usage of SQL Server. Is there a way to set those via the docker env file?

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented Apr 23, 2018

You can control the amount of memory that SQL Server uses by passing the MSSQL_MEMORY_LIMIT_MB environment variable. SQL Server on Linux does need a minimum of 2GB of memory though for now.

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented May 11, 2018

Looks like the option to configure the VM memory is back in the more recent versions of Docker for Windows. Can you please try changing this from the default 2 GB to 4 GB or something and try running SQL Server on Linux again? Should work now.
image

@wsmelton

This comment has been minimized.

Copy link

wsmelton commented May 12, 2018

Those options are not available under Windows Mode. I'm using the platform option to run a Linux container under Windows Mode.

@eric-davis

This comment has been minimized.

Copy link

eric-davis commented Jun 22, 2018

I'm running into the same extremely annoying issue.

@alexandrupascanu

This comment has been minimized.

Copy link

alexandrupascanu commented Oct 4, 2018

Hello,
I am facing the same issue using the latest docker version( 18.09.0-ce-beta1), i can;t start sqlsrv linux contaner: "sqlservr: This program requires a machine with at least 2000 megabytes of memory."
I don't what to to fix it!.Can you help me out with this one,please?
Thank you!

@tomasfejfar

This comment has been minimized.

Copy link

tomasfejfar commented Oct 30, 2018

The 2GB minimum does not seem sensible to me.

Does really empty sqlsrv needs that much memory just to start? I understand there may be some (potentially big) performance degradation for bigger tables and bigger indices, but it does not seem sensible to beef up the machine just to create a table with 20 rows for Travis build. Production (!) and fast enough MySQL/MariaDB for small web can run on 512M DigitalOcean droplet along with httpd and standard Debian.

@twright-msft

This comment has been minimized.

Copy link
Collaborator

twright-msft commented Oct 30, 2018

@tomasfejfar There's a bit more to it than just simply running SQL Server. Keep in mind that SQL Server on Linux runs inside of a platform abstraction layer (PAL). More detailed reading. The additional memory required to run the PAL itself is a big part of the overall memory demands of running SQL Server in as small of a footprint as possible. On a production system with 1 TB of RAM available the extra 512MB-1 GB to run the PAL is negligible, but when you are trying to run some CI tests on as small of a footprint as possible, it's completely understandable to want to minimize the memory consumption. We're working on reducing the memory footprint, but it will take some time. Hope that provides a bit more context.

@tomasfejfar

This comment has been minimized.

Copy link

tomasfejfar commented Oct 30, 2018

That's much more context, thanks. And the link provided me with much deeper understanding. My understanding was pretty much limited to "it's probably just C, so not much different from other RDBMS".

@beaudryj

This comment has been minimized.

Copy link

beaudryj commented Nov 29, 2018

Any Status update on this?

@patoJamriska

This comment has been minimized.

Copy link

patoJamriska commented Dec 7, 2018

Bumping this to see if anyone has looked into it or if there is a roadmap to support this eventually again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment