Linux 上的 SqlServer 变得非常慢

Linux 上的 SqlServer 变得非常慢

我有一个 Ubuntu 16.04 VPS,并开始在上面测试 SQL Server。安装过程非常顺利,我使用了大约一个月,没有任何问题。然后我进行了 apt 更新,但它没有启动。说实话,它启动时出现了这种错误(不记得确切的错误代码了):

服务器处于脚本升级模式。目前只有管理员可以连接。

我当时很着急,设法用我在某处找到的一个开关启动了它,它又运行了一个星期。但今天它占用了 100% 的 CPU 时间,速度非常慢,甚至本地主机上的应用程序都因超时错误而无法运行。这只是一个测试服务器,所以我想再次删除并安装 sql server。我这样做了,但这也没有帮助。我已经安装了 express 版本,但即使 mssql-conf 设置在启动前也运行了大约 1 个小时,我仍然无法远程连接到管理工作室,广告本地主机连接也很慢。它现在占用了 1% 的 CPU 时间。

在重新安装之前,我已经从 /opt/mssql 中删除了所有内容。甚至从 /var/opt/mssql 中删除了所有内容,现在它可以正常工作了。为什么我无法连接?(超时)自从第一次运行良好以来,可能发生了什么变化?

我的 VPS 是一台带有 KVM 主机的廉价虚拟服务器。该 VPS 具有 4GB RAM 和 4CPU“vCore”。最后一条日志如下所示,但我认为它没有说明任何有趣的内容。我如何才能恢复以前的良好配置和反应时间?或者我如何才能确定是什么原因导致了它的问题?

2019-04-08 12:55:50.40 Server      Microsoft SQL Server 2017 (RTM-CU14) (KB4484710) - 14.0.3076.1 (X64)
        Mar 12 2019 19:29:19
        Copyright (C) 2017 Microsoft Corporation
        Express Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS)
2019-04-08 12:55:50.40 Server      UTC adjustment: 0:00
2019-04-08 12:55:50.41 Server      (c) Microsoft Corporation.
2019-04-08 12:55:50.41 Server      All rights reserved.
2019-04-08 12:55:50.41 Server      Server process ID is 28.
2019-04-08 12:55:50.41 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.
2019-04-08 12:55:50.41 Server      Registry startup parameters:
         -d /var/opt/mssql/data/master.mdf
         -l /var/opt/mssql/data/mastlog.ldf
         -e /var/opt/mssql/log/errorlog
2019-04-08 12:55:50.42 Server      SQL Server detected 1 sockets with 2 cores per socket and 2 logical processors per socket, 2 total logical processors; using 2 logical processors
based on SQL Server licensing. This is an informational message; no user action is required.
2019-04-08 12:55:50.42 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2019-04-08 12:55:50.43 Server      Detected 3277 MB of RAM. This is an informational message; no user action is required.
2019-04-08 12:55:50.43 Server      Using conventional memory in the memory manager.
2019-04-08 12:55:50.54 Server      Buffer pool extension is already disabled. No action is necessary.
2019-04-08 12:55:50.64 Server      InitializeExternalUserGroupSid failed. Implied authentication will be disabled.
2019-04-08 12:55:50.64 Server      Implied authentication manager initialization failed. Implied authentication will be disabled.
2019-04-08 12:55:50.65 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].
2019-04-08 12:55:50.69 Server      The maximum number of dedicated administrator connections for this instance is '1'
2019-04-08 12:55:50.69 Server      Node configuration: node 0: CPU mask: 0x0000000000000003:0 Active CPU mask: 0x0000000000000003:0. This message provides a description of the NUMA
configuration for this computer. This is an informational message only. No user action is required.
2019-04-08 12:55:50.70 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.
2019-04-08 12:55:50.71 Server      In-Memory OLTP initialized on lowend machine.
2019-04-08 12:55:50.75 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
2019-04-08 12:55:50.76 Server      Query Store settings initialized with enabled = 1,
2019-04-08 12:55:50.77 spid7s      Starting up database 'master'.
2019-04-08 12:55:50.77 Server      Software Usage Metrics is disabled.
2019-04-08 12:55:51.00 spid7s      10 transactions rolled forward in database 'master' (1:0). This is an informational message only. No user action is required.
2019-04-08 12:55:51.03 spid7s      1 transactions rolled back in database 'master' (1:0). This is an informational message only. No user action is required.
2019-04-08 12:55:51.04 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2019-04-08 12:55:51.45 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2019-04-08 12:55:51.45 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2019-04-08 12:55:51.51 Server      Failed to verify the Authenticode signature of 'C:\binn\secforwarder.dll'. Signature verification of SQL Server DLLs will be skipped. Genuine copies of SQL Server are signed. Failure to verify the Authenticode signature might indicate that this is not an authentic release of SQL Server. Install a genuine copy of SQL Server or contact customer support.
2019-04-08 12:55:51.58 spid7s      SQL Trace ID 1 was started by login "sa".
2019-04-08 12:55:51.82 spid7s      Server name is 'vs2558'. This is an informational message only. No user action is required.
2019-04-08 12:55:51.83 spid22s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.
2019-04-08 12:55:51.84 spid22s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.
2019-04-08 12:55:51.84 spid7s      Starting up database 'msdb'.
2019-04-08 12:55:51.84 spid10s     Starting up database 'mssqlsystemresource'.
2019-04-08 12:55:51.84 spid10s     The resource database build version is 14.00.3076. This is an informational message only. No user action is required.
2019-04-08 12:55:51.87 spid10s     Starting up database 'model'.
2019-04-08 12:55:52.19 spid18s     A self-generated certificate was successfully loaded for encryption.
2019-04-08 12:55:52.19 spid10s     Polybase feature disabled.
2019-04-08 12:55:52.19 spid10s     Clearing tempdb database.
2019-04-08 12:55:52.20 spid18s     Server is listening on [ 'any' <ipv6> 1433].
2019-04-08 12:55:52.20 spid18s     Server is listening on [ 'any' <ipv4> 1433].
2019-04-08 12:55:52.21 spid18s     Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated ad
ministrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.
2019-04-08 12:55:52.22 spid18s     SQL Server is now ready for client connections. This is an informational message; no user action is required.
2019-04-08 12:55:52.40 spid10s     Starting up database 'tempdb'.
2019-04-08 12:55:52.60 spid22s     The Service Broker endpoint is in disabled or stopped state.
2019-04-08 12:55:52.60 spid22s     The Database Mirroring endpoint is in disabled or stopped state.
2019-04-08 12:55:52.61 spid22s     Service Broker manager has started.
2019-04-08 12:55:52.90 spid7s      Recovery is complete. This is an informational message only. No user action is required.
2019-04-08 13:01:45.81 spid52      Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.
2019-04-08 13:01:45.85 spid52      Using 'xplog70.dll' version '2017.140.3076' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.

答案1

升级我的 Ubuntu 16.04.6 的软件包后,我发现了类似的行为。

安装/升级 mssql-server 到当前 14.0.3192.2-2 或其他版本没有任何问题。所以我没有得到任何你拥有的脚本升级模式。但我意识到性能下降明显。日志中没有发现任何异常,但使用分析器我发现,mssql 服务器建立 tcp/ip 连接有 2 秒的延迟。DNS 很好,我的 web 服务器在同一台服务器上运行并通过 ip/localhost 连接。

对我来说唯一的解决方法是坚持使用版本 14.0.3048.4-1

14.0.3076.1-2 / CU14 及更高版本似乎出了问题 :-/

相关内容