对SQL Server的Ajax请求打开了太多的池化连接 [英] Ajax request to SQL server opens too many pooled connections

查看:74
本文介绍了对SQL Server的Ajax请求打开了太多的池化连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在asp.net应用程序中实现类似Google的搜索框.框中的每个按键都会向IIS Web方法发送一个Ajax请求,以查询txt并返回匹配项-工作非常酷.但是,在加载活动(例如300个用户)时,我收到100个池化连接已用完的错误消息.现在,我重新考虑一下,也许在每个按键上打开/关闭数据库连接可能太多了.一位架构师将如何对此做出不同的选择,或者确保真正快速地收回连接.我有用于连接的正在使用"构造,以确保它已关闭.令人担心的是,GC可能没有足够快地回收它们?

I'm implementing a Google like search box in my asp.net application. Each keypress in the box sends an Ajax request to IIS webmethod that queries the txt and return matches - works pretty cool. However, on loading up activity (e.g. 300 users), I'm getting errors that my 100 Pooled connections are used up. Now I'm rethinking that perhaps opening/closing a db connection on each keystroke may be too much. How would one architect this differently, or insure that the connections are reclaimed really fast. I'm have the 'using' construct for connections to insure it is closed. The concern is GC may not be reclaiming them fast enough?

Google如何处理如此大的打开/关闭周期.

How would google handle such a large open/close cycle.

推荐答案

您可能已经这样做了,但为了您的最大利益,也要求始终在自动完成"开始前要求最少字符数检索项目的top(x).

You might be already doing so but it is also in your best interest to require a minimum number of characters before the "autocomplete" kicks in, as well as always retrieve top(x) of items.

这篇关于对SQL Server的Ajax请求打开了太多的池化连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆