从MongoDB服务器C#驱动程序或邮递员访问数据时出现504错误的网关错误

时间:2019-04-08 06:37:51

标签: mongodb timeout gateway

在具有MongoDB 4.0社区版的64GB RAM的Windows机器上,观察到缓存中的脏字节高达0.1TB,缓存达到27GB。在此阶段,从MongoDB提取数据的C#API开始引发504错误的网关错误。 mongo服务重新启动后,API就会开始提供结果。请帮助分享此现象的原因并提出解决方案,因为重新启动mongo服务不是最佳解决方案。

C#API引发以下错误:504 Gateway Time-out

mongo日志经常包含以下信息,但日志中没有错误:

I COMMAND  [ftdc] serverStatus was very slow: { after basic: 0, after asserts: 0, after backgroundFlushing: 0, after connections: 0, after dur: 0, after extra_info: 0, after globalLock: 0, after locks: 0, after logicalSessionRecordCache: 0, after network: 0, after opLatencies: 0, after opReadConcernCounters: 0, after opcounters: 0, after opcountersRepl: 0, after repl: 0, after security: 0, after storageEngine: 0, after tcmalloc: 0, after transactions: 0, after transportSecurity: 0, after wiredTiger: 1618, at end: 1618 }
I COMMAND  [ftdc] serverStatus was very slow: { after basic: 0, after asserts: 0, after backgroundFlushing: 0, after connections: 0, after dur: 0, after extra_info: 0, after globalLock: 0, after locks: 0, after logicalSessionRecordCache: 0, after network: 0, after opLatencies: 0, after opReadConcernCounters: 0, after opcounters: 0, after opcountersRepl: 0, after repl: 0, after security: 0, after storageEngine: 0, after tcmalloc: 0, after transactions: 0, after transportSecurity: 0, after wiredTiger: 13190, at end: 13190 }

请帮助分享脏缓存字节增加的原因。另外,请帮助确认是否这是API抛出504错误网关错误的原因。

是否存在可以参考的最佳实践指南,以确保API不会由于上述与数据库相关的问题而引发严重的网关错误?谢谢!

重新启动mongo服务有助于运行查询一段时间,并且MongoDB脏字节和写入缓存的字节逐渐增加。一段时间后,C#API开始再次引发严重的网关错误。

0 个答案:

没有答案