48

峰回路转:去掉 DbContextPool 后 Windows 上的 .NET Core 版博客表现出色团队

 4 years ago
source link: https://www.cnblogs.com/cmt/p/11355978.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

峰回路转:去掉 DbContextPool 后 Windows 上的 .NET Core 版博客表现出色

今天早上,我们修改了博客程序中的1行代码,将 services.AddDbContextPool 改为 services.AddDbContext ,去掉 DbContextPool 。

35695-20190815091412848-1072630057.png

然后奇迹出现了 ——

35695-20190815091910098-65405838.png

单台4个8G的服务器,800 左右的 QPS 不在话下,CPU 的稳健与 .NET Framework 版有的一拼。

到发布博文时间为止,最高可以撑住 1300 的 QPS 。

我们评估一下,如果没有其他问题,我们今天会全面部署 Windows 上的 .NET Core 版博客站点。

注:这次遇到的了 DbContextPool 问题,与下面的博文链接中“连接池连接耗尽”不是同一个问题,博客系统的数据库连接字符串设置的是 max pool size=300 。

更新:

问题比较诡异,即使现在去掉 DbContextPool 后恢复了正常,也不能确定一定是 DbContextPool 的原因。

DbContextPool 相关链接:

Powered by .NET Core 系列博文:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK