简体   繁体   English

如何管理sql server的内存使用?

[英]How To manage Memory Usage of sql server?

I have a sql srever 2008 instance , a development server. 我有一个sql srever 2008实例,一个开发服务器。 All the developers work simultaneously on the server on different databases. 所有开发人员在不同数据库上的服务器上同时工作。 The memory usage of RAM goes more than 2GB and total RAM of the server is 4GB . RAM的内存使用量超过2GB,服务器的总RAM为4GB。 There is no blocked processes in the sys.sysprocesses list. sys.sysprocesses列表中没有阻塞的进程。 The sum(memusage) is only 190 and total current process connected ie count(*) is 111 from sys.sysprocesses. 总和(memusage)仅为190并且当前进程总连接,即count(*)是来自sys.sysprocesses的111。 I have configured a powershell script which gives alert on the process sql server more than 2000 MB usage. 我已经配置了一个powershell脚本,它在进程sql server上提供超过2000 MB的警报。 I am getting alert continuously. 我一直在警觉。 I don`t find any solution for this that what to do on this condition. 我没有找到任何解决方案,在这种情况下该怎么做。

I am confused in sum(memusage) =190 and RAM usage 2000+MB . 我很困惑总和(memusage)= 190和RAM使用2000 + MB。 Where does the rest processes consuming the RAM. 其余的进程在哪里消耗RAM。

Please help me out. 请帮帮我。

Thanks 谢谢

Nitesh Kumar Nitesh Kumar

Check in the Memory pane of the Server Properties window (in Server Management Studio right click the database server icon in the Object Explorer and choose Properties ) that value for Maximum server memory. 检查“ 服务器属性”窗口的“ 内存”窗格(在Server Management Studio中右键单击对象资源管理器中的数据库服务器图标,然后选择“ 属性” ),以获取“最大服务器内存”的值。 We've found that allocating slightly less than the total memory in the machine works well. 我们发现分配略少于机器总内存的效果很好。

Slightly less than the total memory because we don't want the OS forced into virtual memory. 略低于总内存,因为我们不希望操作系统被强制进入虚拟内存。

SQL Server will take as much memory as it requires, up to this limit. SQL Server将根据需要占用尽可能多的内存,达到此限制。 Limiting this to the amount of physical memory forces SQL Server to optimise queries to use tempdb rather than using virtual memory. 将此限制为物理内存量会强制SQL Server优化查询以使用tempdb而不是使用虚拟内存。 We've found this to be better. 我们发现这更好。

If SQL Server isn't using all the memory then it may simply not need it. 如果SQL Server没有使用所有内存,那么它可能根本不需要它。 This has been our experience with some of our servers. 这是我们对部分服务器的体验。 Bottlenecks may lie elsewhere---probably disc IO---so the next steps are to start to understand what queries are running and why the're slow... 瓶颈可能在其他地方 - 可能是盘IO ---所以接下来的步骤是开始了解正在运行的查询以及为什么这么慢......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM