microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources
MIT License
1.74k stars 759 forks source link

SQL container image size is 10x bigger for Windows than Linux. #186

Open sungwook-moon opened 7 years ago

sungwook-moon commented 7 years ago

Hi,

SQL server express image is 6GBs for Windows but the latest SQL server image for Linux is only 479MBs. I understand we are comparing two different versions (express vs regular) but I am wondering if there is a plan to release a smaller image for Windows.

Thanks!

PS: There is a link to mssql container on Windows at Docker hub but it is broken (404 not found): https://hub.docker.com/r/microsoft/mssql-server-linux/

twright-msft commented 7 years ago

Not in the short term. Right now the Linux image is built by just copying the minimum runtime files into the image. The Windows image is built by running setup.exe install. It's not ideal, but for now our focus is on making the docker experience for SQL on Linux containers great. Pull and usage telemetry tells us that SQL on Linux containers is much more widely used right now.

sungwook-moon commented 7 years ago

Thanks for quick reply. I don't have much hope for this question but: is there a reference to create a similar smaller image for SQL server in Windows? (i.e., list of run-time binaries I should copy). Please feel free to close the thread.

twright-msft commented 7 years ago

No sorry, there's not. We'll keep this issue open to track improving this in the future.

AndrewSav commented 7 years ago

Pull and usage telemetry tells us that SQL on Linux containers is much more widely used right now.

Could it be because the team has a focus on making the docker experience for SQL on Linux containers great and putting Windows containers experience on the back seat (to the point where there is not much appeal at all in choosing it)?

Cause and effect, no? I mean come on: ten. times. bigger. ;)

twright-msft commented 6 years ago

@AndrewSav Fair point. :) It's just a matter of time/resources/priorities right now. Can't do everything at once, but we are constantly keeping an eye on this and making incremental progress behind the scenes. Stay tuned...

CindyXing commented 6 years ago

Didn't mean to divert the conversation topic. Do we have any benchmark performance data for the linux sql container? If I want to compare mssql linux container with a VM, what can be the pros/cons? Thanks!

twright-msft commented 6 years ago

In our lab testing SQL Server on a Linux container on bare metal performs better than SQL Server on a Linux VM. Not surprising really. SQL Server in a Linux container in a Linux VM is likely going to be slower than just SQL in a VM. YMMV though depending on your hardware, drivers, hypervisor, container engine, etc.

CindyXing commented 6 years ago

Thanks for the reply. For the upper perf measurement, what's the VM vs container resource configuration setting? I meant whether they are configured to use the same resource (core & memory). In my test, when not setting limit against container and applying load, the sql container can consume quite some CPU. With it, I am not quite sure how to evaluate the resource usage of container vs VM. If expecting the same sql performance & workload, can one deploy more containers than vms on the same baremetal? Any thoughts on how to proof it.

twright-msft commented 6 years ago

Yes, same resources for all tests - bare metal, VM, container, container in VM. We try to do apples:apples comparisons when doing these perf benchmarks. :)

The SQL container should be able to drive all the CPUs on a host unless the container is limited to a certain number or specific cores using the -c parameter to docker run.

Generally speaking one of the benefits of containers vs. VMs is that because containers share a common host OS kernel then there is less resource consumption spent on operating system processes. If you have a bunch of VMs running on a given host, each of those VMs has OS processes running inside of it in addition to the actual application. With containers there is only the one set of OS processes running on the host.

You could prove this by using a benchmarking tool like hammer db to generate a load on a bunch of containers vs. a bunch of VMs on a given host and see what your overall performance and resource utilization looks like.

CindyXing commented 6 years ago

I see. Thanks for the info. !

wasif-balol commented 6 years ago

why the the size of images for windows is much greater than the size of images for windows??? can you guide me please i'm just a beginner??

AndrewSav commented 6 years ago

@wasif-balol It's explained in the first comment in this thread.

activebiz commented 6 years ago

The latest mssql-server-linux image is showing 1.43GB size. Is there anything changed?

Ideally it would nice to have lightweight image (prob 300-500MG) of SQL Express 2017 on linux.

twright-msft commented 6 years ago

The :2017-GA image is 1.41 GB on disk so no not much changed here. We are in general working on making the SQL footprint smaller and smaller as we go - disk, memory, etc.