mssql-docker
mssql-docker copied to clipboard
Reduce minimum memory requirement
Is there any technical limitation to reducing the memory requirements? I appreciate more memory is great for a production instance, but running several dev instances is really straining resources for no benefit.
Yes, currently there is a reason for this. We are working on reducing the footprint requirements over the next couple of releases. Stay tuned....
any progress on this? i'd like to be able to deploy small servers to virtual machines but 4GB memory is a pretty hefty requirement for a database that might be < 100MB big.
We are actively working on it. No ETA for release just yet.
Also a problem for Bitbucket Pipeline CI users, since each service is only given 1GB of memory: https://confluence.atlassian.com/bitbucket/use-services-and-databases-in-bitbucket-pipelines-874786688.html
However, we have been able to get MSSQL to run on BitBucket Pipelines. It will crash/terminate connections if you try to load too much data, though
Just a quick update on this issue - we are down to a 2GB minimum requirement now as of CU2.
@herecydev , I made a docker image that works around this memory limitation (policy): https://github.com/justin2004/mssql_server_tiny
I think this is a major issue!!!! Thanks for trying this workaround @justin2004 but it didn't work on a bitbucket pipeline.
is there an estimate to lower the minimal requirements?
@juliomfreitas what error message did you get from the pipeline?
i was able to run (idling) sqlservr on a VM with 256MB of RAM and 1.5GB of swapspace
@justin2004 It didn't work for me either. I don't think I can specify the swapspace in Bitbucket Pipelines.
@amcsi can you share the relevant portion of the log (with the error)?
@justin2004 It happened a while back, so there's not that much I can share.
SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]There is insufficient system memory in resource pool 'default' to run this query.
https://gist.github.com/amcsi/81a838a911746c1cbdba3230d760eef5
@amcsi given that log it actually looks like there just isn't enough virtual memory to run your query.
the docker image i wrote just bypasses a restrictive policy it doesn't make queries require less virtual memory.
from your log:
Detected 820 MB of RAM
Regular steps have 4096 MB of memory in total
https://confluence.atlassian.com/bitbucket/use-services-and-databases-in-bitbucket-pipelines-874786688.html
are you getting all the memory bitbucket promised?
@justin2004 I'm just working with the 1GB that I get for Bitbucket services...
and I was going to say that's all that services get, and I could swear that was true 4 months ago, but now I see that apparently I could give more memory to services: https://confluence.atlassian.com/bitbucket/use-services-and-databases-in-bitbucket-pipelines-874786688.html#UseservicesanddatabasesinBitbucketPipelines-Servicememorylimits
So I guess I could try again, but this time doing memory: 2048.
Seems like it worked :)
This is increasingly frustrating as Azure's B1ms VM SKU, which reports 1 CPU and 2 GB of memory, is not valid for hosting MSSQL -- which requires 2 GB of memory. 🤦
Standard B1ms (1 vcpu, 2 GiB memory)
Enter the SQL Server system administrator password:
Confirm the SQL Server system administrator password:
Configuring SQL Server...
sqlservr: This program requires a machine with at least 2000 megabytes of memory.
/opt/mssql/bin/sqlservr: This program requires a machine with at least 2000 megabytes of memory.
@Kokotewa perhaps this will help? https://github.com/justin2004/mssql_server_tiny
@Kokotewa perhaps this will help? https://github.com/justin2004/mssql_server_tiny
It does, or rather it did. I greatly appreciate the post, I used it when it was new. I since adopted the Microsoft SQL Edge Solution, https://hub.docker.com/r/microsoft/azure-sql-edge which promised a 1 GB memory footprint due to another issue.
However, it is being retired in Sept 2025 with an attempt to migrate users back to Express. The retirement notice mentioned a 1.4 GB footprint, but I've yet to find a release which supports such.
To ensure a smooth transition, we highly recommend migrating to one of the following services: ... SQL Server Express edition: SQL Server Express edition utilizes the same database engine as Azure SQL Edge. This free version can run in containers, just like SQL Edge. SQL Server Express edition is also fully supported for 5 years and there’re 5 years of extended support. This is the best option for database workloads that can run on the lesser of 1 socket/4 cores, 1,410 MB RAM, and a maximum of 10 GB per database. See here to learn more about the editions and supported features of SQL Server.
... which lands me back here. :)