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

[2019-latest] mssql-conf not works

Open pasztorl opened this issue 7 months ago • 3 comments
trafficstars

Hi I tried to configure mssql memoryi paramters with this command:

/opt/mssql/bin/mssql-conf set memory.memorylimitmb 1024
Warning: could not create log file for mssql-conf at /var/opt/mssql/log/mssql-conf/mssql-conf.log.
This program must be run as superuser or as a user with membership in the mssql
group.

The problem is this by default:

mssql@mssql-0:/$ /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -C -W
Password: 
1> SELECT name,value,value_in_use,description FROM sys.configurations WHERE name LIKE '%memory%';
2> GO
name value value_in_use description
---- ----- ------------ -----------
index create memory (KB) 0 0 Memory for index create sorts (kBytes)
min memory per query (KB) 1024 1024 minimum memory per query (kBytes)
min server memory (MB) 0 16 Minimum size of server memory (MB)
max server memory (MB) 2147483647 2147483647 Maximum size of server memory (MB)
tempdb metadata memory-optimized 0 0 Tempdb metadata memory-optimized is disabled by default.

(5 rows affected)

Any other way? Where can i find what key-values accepted in mssql.conf?

pasztorl avatar Apr 07 '25 10:04 pasztorl

I successfully modified with sql:

EXEC sp_configure 'max server memory', 1024;  -- Set maximum memory to 1024 MB
RECONFIGURE;

But still this container would need working mssql-conf and mssql also needs a proper mssql.conf docs.

pasztorl avatar Apr 07 '25 11:04 pasztorl

Hi I tried to configure mssql memoryi paramters with this command:

/opt/mssql/bin/mssql-conf set memory.memorylimitmb 1024
Warning: could not create log file for mssql-conf at /var/opt/mssql/log/mssql-conf/mssql-conf.log.
This program must be run as superuser or as a user with membership in the mssql
group.

The problem is this by default:

mssql@mssql-0:/$ /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -C -W
Password: 
1> SELECT name,value,value_in_use,description FROM sys.configurations WHERE name LIKE '%memory%';
2> GO
name value value_in_use description
---- ----- ------------ -----------
index create memory (KB) 0 0 Memory for index create sorts (kBytes)
min memory per query (KB) 1024 1024 minimum memory per query (kBytes)
min server memory (MB) 0 16 Minimum size of server memory (MB)
max server memory (MB) 2147483647 2147483647 Maximum size of server memory (MB)
tempdb metadata memory-optimized 0 0 Tempdb metadata memory-optimized is disabled by default.

(5 rows affected)

Any other way? Where can i find what key-values accepted in mssql.conf?

The 'problem' is that you're executing the command as mssql user which has no permissions on changing SQL Server config and most likely on /var/opt/mssql. To use mssql-conf you'll need to run as root or with sudo, even inside of the container.

You can find some configuration values here: https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-configure-mssql-conf?view=sql-server-ver16

stevenobird avatar Apr 09 '25 09:04 stevenobird

understood but i used the mssql docker image and by default it not works. So i think to fix this Dockerfile modification needed.

pasztorl avatar Apr 18 '25 09:04 pasztorl