小编Ste*_*hen的帖子

从池中获取连接之前经过的超时时间 - 但池未满

我讨厌甚至提起这个b/c有这么多的几百页报道这个错误可追溯到7 - 8年......但是,我无法想象这一点.

我在服务器A上运行的报表服务连接到服务器B上的SQL Server 2008 R2.两台服务器都运行Windows Server 2008.报表服务是多线程的,每次在自己的线程上运行多达10个报表.
我的连接字符串如下:

Data Source=ServerB;Initial Catalog=DBName;trusted_connection=YES;Connection Timeout=0;Max Pool Size=500;
Run Code Online (Sandbox Code Playgroud)

如您所见,我已将连接超时设置为0以等待连接,直到其可用,并且最大池大小为500 b/c我想确保池对于我的多线程服务来说不是太小.该错误通常仅在服务启动时显示,并且存在等待处理的报告队列.

显然,要做的第一件事就是寻找泄漏的连接..必须有未关闭的连接导致池填满,对吧?没有 - 看起来像池永远不会填满.

我花了最后几个小时在服务器上运行性能监视器,观看".NET数据提供程序为SqlServer",而NumberOfPooledConnections从未超过20左右.我还在SQL服务器上运行perfmon,观看"SQLServer:General Statistics",UserConnections永远不会超过50.在此期间,我通过手动重新启动服务导致此错误报告2或3次.

我还能找到什么?还有什么会导致这个错误?完整的错误消息是:

System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
Run Code Online (Sandbox Code Playgroud)

谢谢,斯蒂芬

.net database sql-server timeout connection-pooling

11
推荐指数
1
解决办法
1万
查看次数

ASP.NET随机丢失会话值

我一直在寻找相关时间的答案,因为它继续困扰着我.我们在会话状态(InProc)中存储用户登录信息和有关用户当前活动的其他数据.我经常尝试使用其中一个会话变量的Null Reference异常.它发生在随机页面上,带有随机的Session变量.我修改了web.config httpRuntime和compliation标签以防止appPool重启:

<httpRuntime requestValidationMode="2.0" waitChangeNotification="86400" maxWaitChangeNotification="86400" />
<compilation debug="False" strict="false" explicit="true" targetFramework="4.0" numRecompilesBeforeAppRestart="1000" />
Run Code Online (Sandbox Code Playgroud)

我已将IIS设置为在凌晨3点重新启动应用程序池,以确保在人们忙于使用服务器时它不会重新启动.我正在事件日志中记录应用程序池重新启动,以确保我知道它何时发生.

Dim runtime As HttpRuntime = GetType(System.Web.HttpRuntime).InvokeMember("_theRuntime", BindingFlags.NonPublic Or BindingFlags.Static Or BindingFlags.GetField, Nothing, Nothing, Nothing)
Dim shutDownMessage As String = runtime.GetType().InvokeMember("_shutDownMessage", BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.GetField, Nothing, runtime, Nothing)

Dim shutDownStack As String = runtime.GetType().InvokeMember("_shutDownStack", BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.GetField, Nothing, runtime, Nothing)
Dim evtSource As String = "ASP.NET"
Dim log As New EventLog
log.Source = evtSource
log.WriteEntry(String.Format("_shutDownMessage={0}{2}_shutDownStack={1}", shutDownMessage, shutDownStack, vbCrLf & vbCrLf), EventLogEntryType.Warning)
Run Code Online (Sandbox Code Playgroud)

应用程序池重新启动时,我会收到事件日志条目.发生这些错误时,应用程序池不会重新启动. …

asp.net session

7
推荐指数
2
解决办法
2万
查看次数

DefaultDocument突然无法在IIS7上运行

我有一个网站已经在IIS7上运行了大约2个月.我们将默认文档设置为在用户转到没有页面的域时加载default.asp页面.突然今天早上,我收到错误,默认文件将无法加载.如果我键入default.asp,文件加载就好了.

错误信息:
模块:DefaultDocumentModule
通知:ExecuteRequestHandler
处理程序:StaticFile
错误代码:0x80070002

这是我的applicationhost.config中的一个部分:

<system.webServer>

    <asp>
        <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" />
    </asp>

    <defaultDocument enabled="true">
        <files>
            <clear />
            <add value="Default.asp" />
            <add value="Default.htm" />
            <add value="index.htm" />
            <add value="index.html" />
            <add value="iisstart.htm" />
        </files>
    </defaultDocument>

    <directoryBrowse enabled="false" />

    <globalModules>
        <add name="UriCacheModule" image="%windir%\System32\inetsrv\cachuri.dll" />
        <add name="FileCacheModule" image="%windir%\System32\inetsrv\cachfile.dll" />
        <add name="TokenCacheModule" image="%windir%\System32\inetsrv\cachtokn.dll" />
        <add name="HttpCacheModule" image="%windir%\System32\inetsrv\cachhttp.dll" />
        <add name="StaticCompressionModule" image="%windir%\System32\inetsrv\compstat.dll" />
        <add name="DefaultDocumentModule" image="%windir%\System32\inetsrv\defdoc.dll" />
        <add name="DirectoryListingModule" image="%windir%\System32\inetsrv\dirlist.dll" />
        <add name="ProtocolSupportModule" image="%windir%\System32\inetsrv\protsup.dll" />
        <add name="HttpRedirectionModule" image="%windir%\System32\inetsrv\redirect.dll" />
        <add name="ServerSideIncludeModule" image="%windir%\System32\inetsrv\iis_ssi.dll" …
Run Code Online (Sandbox Code Playgroud)

iis-7 default document

4
推荐指数
1
解决办法
1万
查看次数

Highcharts在BoxPlot图表中添加Mean线

有没有办法在BoxPlot图表中添加另一条线来表示平均值(平均值)? 这看起来像是在下面的小提琴中为你自动绘制的中位线

http://jsfiddle.net/tLucL6mq/3/
小提琴代码:

$('#container').highcharts({

    chart: {
        type: 'boxplot',
        inverted: true
    },

    title: {
        text: 'Sample Base Salary Range'
    },

    legend: {
        enabled: false
    },

    xAxis: {
        categories: ['4', '3', '2', '1', '0'],
        title: {
            text: 'Job Level'
        }
    },

    yAxis: {
        title: {
            text: 'Base Salary'
        }
    },

    plotOptions: {
        boxplot: {
            fillColor: '#F0F0E0',
            lineWidth: 2,
            medianColor: '#0C5DA5',
            medianWidth: 3
        }
    },

    series: [{
        name: "Observation Data",
        data: [
            ['0', 68, 75, 79, 82, 84, 89],  //level 4 - …
Run Code Online (Sandbox Code Playgroud)

javascript highcharts

1
推荐指数
1
解决办法
1985
查看次数