mssql-docker icon indicating copy to clipboard operation
mssql-docker copied to clipboard

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

Open wsmelton opened this issue 7 years ago • 51 comments

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?

wsmelton avatar Apr 20 '18 20:04 wsmelton

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.

twright-msft avatar Apr 20 '18 20:04 twright-msft

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

image

wsmelton avatar Apr 20 '18 21:04 wsmelton

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...

wsmelton avatar Apr 20 '18 21:04 wsmelton

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

twright-msft avatar Apr 20 '18 21:04 twright-msft

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

docker run -it --platform linux ubuntu:latest

image

wsmelton avatar Apr 20 '18 21:04 wsmelton

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.

twright-msft avatar Apr 20 '18 21:04 twright-msft

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?

georgedorn avatar Apr 23 '18 22:04 georgedorn

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 avatar Apr 23 '18 22:04 twright-msft

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

twright-msft avatar May 11 '18 18:05 twright-msft

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

wsmelton avatar May 12 '18 17:05 wsmelton

I'm running into the same extremely annoying issue.

eric-davis avatar Jun 22 '18 12:06 eric-davis

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!

alexandrupascanu avatar Oct 04 '18 15:10 alexandrupascanu

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.

tomasfejfar avatar Oct 30 '18 09:10 tomasfejfar

@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.

twright-msft avatar Oct 30 '18 21:10 twright-msft

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".

tomasfejfar avatar Oct 30 '18 22:10 tomasfejfar

Any Status update on this?

beaudryj avatar Nov 29 '18 17:11 beaudryj

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

patoJamriska avatar Dec 07 '18 18:12 patoJamriska

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

beaudryj avatar Feb 01 '19 19:02 beaudryj

We don't have anything to share at the moment. We are actively investigating how we can support this in production. Once we have support for the same, we will make a formal announcement and also update this thread.

banerjeeamit avatar Feb 02 '19 03:02 banerjeeamit

I have the following environment within my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm

Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false

Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -p 1401:1433 microsoft/mssql-server-linux

I have set the limit on virtualbox for base memory to 2048 mb and it works properly

Fatlonder avatar Feb 11 '19 19:02 Fatlonder

Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where On Mon, Feb 11, 2019 at 2:02 PM Fatlonder [email protected] wrote:

I have the following environment withing my windows 10: **Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm

Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false**

Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux

I have set the limit on virtualbox for base memory to 2048 mb and it works properly

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-462451734, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .

beaudryj avatar Feb 11 '19 21:02 beaudryj

Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where On Mon, Feb 11, 2019 at 2:02 PM Fatlonder @.***> wrote: I have the following environment withing my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux I have set the limit on virtualbox for base memory to 2048 mb and it works properly — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#293 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .

Can't you change the memory limit on hyper-v as well? I guess there should be an option

Fatlonder avatar Feb 15 '19 21:02 Fatlonder

You have to change them using docker flags with Linux containers but when you are using mixed mode containers I.e. windows containers along side Linux containers

Docker throws an error saying that memory resource allocation is not supported On Fri, Feb 15, 2019 at 4:27 PM Fatlonder [email protected] wrote:

Not using vbox, using hyper-v default docker machine and will not be able to setup or push for vbox every where … <#m_-636101805999469629_> On Mon, Feb 11, 2019 at 2:02 PM Fatlonder @.***> wrote: I have the following environment withing my windows 10: Client: Version: 18.03.0-ce API version: 1.37 Go version: go1.9.4 Git commit: 0520e24302 Built: Fri Mar 23 08:31:36 2018 OS/Arch: windows/amd64 Experimental: false Orchestrator: swarm Server: Docker Engine - Community Engine: Version: 18.09.1 API version: 1.39 (minimum version 1.12) Go version: go1.10.6 Git commit: 4c52b90 Built: Wed Jan 9 19:41:57 2019 OS/Arch: linux/amd64 Experimental: false Before running the following command: docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=password' -e 'MSSQL_MEMORY_LIMIT_MB = 4000m' -p 1401:1433 microsoft/mssql-server-linux I have set the limit on virtualbox for base memory to 2048 mb and it works properly — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#293 (comment) https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-462451734>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXOQntV2dSj_ocMPh-XcXVOTSVWk3ks5vMb5CgaJpZM4TeDRZ .

Can't you change the memory limit on hyper-v as well? I guess there should be an option

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-464206740, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXHB9OKTivoryK7NMrFc3obfqIhKgks5vNyZTgaJpZM4TeDRZ .

beaudryj avatar Feb 15 '19 23:02 beaudryj

Hi,

Any updates on this issue with Windows mixed containers?

jpiquot avatar Mar 20 '19 18:03 jpiquot

👍 on not working in mixed mode Windows containers, no (apparent) way of increasing the Docker VM memory

simonpinn avatar Mar 22 '19 04:03 simonpinn

Got tired of waiting and refocused effort in getting kubernetes cluster in azure working :/ On Fri, Mar 22, 2019 at 12:41 AM Simon [email protected] wrote:

+1 on not working in mixed mode Windows containers, no (apparent) way of increasing the Docker VM memory

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Microsoft/mssql-docker/issues/293#issuecomment-475491989, or mute the thread https://github.com/notifications/unsubscribe-auth/ACgvXKsR8B8bhUR0JsXq5ZnxbbaaMDzJks5vZF7-gaJpZM4TeDRZ .

beaudryj avatar Mar 23 '19 20:03 beaudryj

@wsmelton

I made a docker image that works around this memory (limitation) policy: https://github.com/justin2004/mssql_server_tiny

justin2004 avatar May 19 '19 02:05 justin2004

ı waste lots of time about this issue and ı couldnt find any solution. maybe @justin2004 ' image can solve this problem .. Does anyone try this ?

dnzhnshn avatar May 24 '19 19:05 dnzhnshn

I had the same issue. Here is what I did to solve it:

  1. In the Windows Docker app right click and switch to Linux container image

  2. Open Settings and select Advanced (make it 3g) image

  3. then just run in bash or powershell: docker run --name demoSQLServer
    -p 1431:1433
    -e "ACCEPT_EULA=Y"
    -e "SA_PASSWORD=1qaz.@WSX"
    -d microsoft/mssql-server-linux:latest

dougloyo avatar May 29 '19 20:05 dougloyo

@justin2004 I just came back to see if there was any status changes on this since my post last year and I see your branch as a viable Option. Again a lot of people do not realize that the issue is when they are trying to run mixed containers (linux containers running in windows mode with LCOW). Anyways, Justin I am going to pull your branch and see if I can implement your solution as one viable way to get it running in a container in linux running in mixed mode for windows

patoJamriska avatar Jun 19 '19 12:06 patoJamriska