sql 2008 Express 在第一次请求时速度很慢?去睡觉了吗?

发布于 2024-09-30 06:10:45 字数 362 浏览 2 评论 0原文

我在某处读过有关 SQL Express 作为用户实例运行或其他内容的内容..因此,如果不使用 x 时间,实例/服务“就会进入睡眠状态”..(不知道实际的计时等)

所以场景是:

  1. 如果我的网站(在本例中)在“几个小时”内没有人使用它,SQL Express“似乎”会进入睡眠状态。

  2. 下次有人出现时(在停顿多长时间之后),最初的响应需要多花几秒钟的时间才能采取行动。

  3. 在第一个请求之后的后续请求似乎非常快..再次直到有“几个小时”的暂停或无论什么时间?

有什么想法吗?如果是这样,有什么例子/指示可以做什么?

谢谢!

大卫.

I have read somewhere about SQL express running as a user instance or something.. and as such, the instance/service "goes to sleep" if not used for x time.. (don't know the actual timings etc)

So the scenario is:

  1. If my website (in this case) doesn't have anyone using it for "a few hours", SQL Express "seems" to go to sleep.

  2. The next time someone comes along (after the pause for however long), the initial response takes quite a few seconds more to action.

  3. Subsequent requests directly after the initial one seem very fast.. again until there is a pause "for a few hours" or whatever the timing is?

Any ideas? if so, any examples/directions of what to do?

Thanks!

David.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

柒夜笙歌凉 2024-10-07 06:10:46

您确定是数据库进入睡眠状态而不是 IIS 吗? IIS 将在一段时间不活动后卸载网站,并且重新加载速度可能非常慢。

Are you sure it's the database going to sleep and not IIS? IIS will unload websites after a certain period of inactivity, and they can be very slow to reload.

夏の忆 2024-10-07 06:10:45

是的,有所谓的 RANU 实例,这是您在连接字符串中指定 User Instance=True 时获得的。有关详细信息,请参阅SQL Server 2005 Express Edition 用户实例< /a>.我建议您尽可能远离与用户实例相关的任何事物。当出现问题时,它们无法进行调试和故障排除,有时需要花费分钟的启动时间来创建新实例,而且它们在现实世界中确实没有提供任何优势。此外,它们在 SQL Server Express 2008 中已被弃用。

如果您使用 SQL Express 2008 并且未在连接字符串中指定 User Instance=True,那么您将无法获得用户实例,因此可能正如其他人所建议的,第一个请求时间来自 IIS 应用程序池预热。它也可能是由于普通进程工作集消耗而导致 SQL 缓冲池变冷而发生的。通过监视系统上适当的性能计数器,您可以轻松识别它是 IIS 还是 SQL。

Yes, there is the so called RANU instance, which is what you get when you specify User Instance=True in the connection string. Read more about this in SQL Server 2005 Express Edition User Instances. I would recommend you stay as far away as possible from anything related to User Instances. They are impossible to debug and troubleshoot when things go wrong, they sometimes have a ramp up time to create the new instance of minutes, and they really offer no advantage in the real world. Besides, they are deprecated in SQL Server Express 2008.

If you're using SQL Express 2008 and you do not specify User Instance=True in your connection string then you do no get an user instance, so probably the first request time comes from the IIS app pool warm up, as other have suggested. It may also occur due to ordinary process workingset attrition that would cause the SQL buffer pools to go cold. You can easily identify whether it is IIS or SQL by monitoring appropriate performance counters on your system.

何处潇湘 2024-10-07 06:10:45

这不是数据库要休眠,而是 IIS 中的应用程序池。如果没有用户连接/使用该网站,则应用程序池将重置并且会话将关闭。然后,当用户访问该网站时,必须重新启动网站。

This isn't the database going to sleep, this is the Application Pool in IIS. If no users are connected/using the website, then the application pool will reset and the session(s) will shutdown. Then, when a user comes to the website, it has to restart the website.

倥絔 2024-10-07 06:10:45

有一个术语叫Database Warmup pal,你可以了解更多这里 这可能是你的解决方案

There is a term called Database Warmup pal, you can find out more here and probably this is your solution

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文