【问题标题】:Postgres timing out 20-30 seconds despite connection string?尽管连接字符串,Postgres 超时 20-30 秒?
【发布时间】:2014-09-16 20:12:47
【问题描述】:

我正在尝试使用名为 AutoTag 的产品进行一些非常基本的查询。

我的 PostgreSQL 安装在本地(非常强大的机器、SSD、16GB RAM,等等)。

其中一张表有 4000 万多条记录(并且会不断增长)。我正在尝试做一个简单的查询,当从 Postgres 管理工具完成时,它需要 4-5 分钟才能运行。

我的连接字符串尝试有以下几种变化:

PORT=5432;CommandTimeout=5000;TIMEOUT=1024;POOLING=True;MINPOOLSIZE=1;MAXPOOLSIZE=20;COMMANDTIMEOUT=20;COMPATIBLE=2.2.0.0 ;HOST=localhost;DATABASE=HistoricalData;USER ID=postgres;PASSWORD=密码这里

连接器(Windows 环境)是:NpgsqlDdexProvider-2.2.0-VS2013 ...位于:https://github.com/npgsql/Npgsql/releases(由于 AutoTag 制造商的“程序集”烦恼,使用某人在同一站点提供的“可安装”版本WINdward无法绕过)

每次使用 AutoTag 从 Excel 中进行查询的尝试都会导致 appx 20-30 秒内的明显超时,尽管我在上面的连接字符串(尝试 TIMEOUT=0,赢了'不连接.. 尝试不超时,没关系)。

帮助?!我显然受限于连接 - 我必须将 64 位 Excel 与 64 位版本的 AutoTag 一起使用,而我可以将 FINE 与 Crystal Reports 一起使用的另一个连接器将不起作用(文件名 psqlodbc_08_04_0200)。


异常堆栈:
错误:57014:由于语句超时而取消语句 (DataSourceException)
错误:57014:由于语句超时(NpgsqlException)而取消语句

自动标记版本:13.1.12.0
办公室:15(64 位),EXCEL
Windows:Microsoft Windows NT 6.1.7601 Service Pack 1(64位),GC内存:53,792,440

堆栈跟踪:

异常:net.windward.env.DataSourceException

消息:错误:57014:由于语句超时而取消语句

Stack:  at net.windward.xmlreport.a.a(ArrayList A_0, e A_1, ArrayList A_2, ProcessReportAPI A_3)        

        at net.windward.xmlreport.ProcessReport.processData(Map dataProviders)

        at net.windward.xmlreport.ProcessReport.processData(DataSourceProvider datasourceProvider, String datasourceName)

        at WindwardArrow.net.windward.arrow.tools.d.a(b A_0, a A_1, a A_2, DrillDownInfo A_3, String A_4, Stream A_5, Stream A_6)

        at AutoTagCore.net.windward.autotag.controls.reports.c.a()

异常:Npgsql.NpgsqlException

消息:错误:57014:由于语句超时而取消语句

Stack:  at Npgsql.NpgsqlState.<ProcessBackendResponses>d__0.MoveNext()      

        at Npgsql.ForwardsOnlyDataReader.GetNextResponseObject(Boolean cleanup)

        at Npgsql.ForwardsOnlyDataReader.GetNextRow(Boolean clearPending)

        at Npgsql.ForwardsOnlyDataReader.Read()

        at System.Data.Common.DbEnumerator.MoveNext()

        at WindwardReportsDrivers.net.windward.datasource.ado.AdoDataSource.AdoNode.AdoIterator.next()

最终更新:根据提供的解决方案,突出显示上述连接字符串中的问题。

【问题讨论】:

    标签: postgresql timeout connection-string postgresql-9.3


    【解决方案1】:

    我会说正好 20 秒,因为您的连接字符串中有两次 COMMANDTIMEOUT,而第二次设置为 20 秒。

    【讨论】:

    • 天哪。我添加了第一个 CommandTimeout,因为我没有看到第二个。我现在很伤心。去看看删除第二个时会发生什么......谢谢。 (头撞墙)
    • ....而且,是的,当然就是这样。感谢您指出...问题(咳嗽)。天哪。
    • 哦,别担心。这发生在我们最好的人身上。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 2018-08-16
    • 1970-01-01
    • 2015-11-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多