[SERVER-40454] 504 bad gateway error while accessing data from MongoDB server C# driver or postman Created: 03/Apr/19  Updated: 08/Apr/19  Resolved: 04/Apr/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 4.0.6
Fix Version/s: None

Type: Question Priority: Major - P3
Reporter: Krati Singh Assignee: Eric Sedor
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

On a Windows machine having 64GB RAM with MongoDB 4.0 community edition, it is observed that the dirty bytes in cache reach upto .1TB and cache reaches 27GB. At this stage the C# API fetching data from MongoDB starts throwing 504 bad gateway error. As soon as the mongo service is restarted, the API starts giving results. Please help share the reason for this behavior and suggested solution for same as restarting mongo service is not an optimal solution.



 Comments   
Comment by Krati Singh [ 08/Apr/19 ]

Please help share the reason of increase in the dirty cache bytes. Also, please help confirm if that is the reason for API throwing 504 bad gateway error.

Is there a best practice guide that could be referred to ensure that the API never throws bad gateway errors due to database related issues like above. Thank you!! 

Comment by Eric Sedor [ 04/Apr/19 ]

krati,

For assistance troubleshooting, I encourage you to ask our community by posting on the mongodb-user group or on Stack Overflow with the mongodb tag. Our Technical Support page provides information about additional resources.

The SERVER project is for reporting bugs and submitting feature requests for the MongoDB server. We don't see anything here to help us reason about possible bugs, so we are closing this ticket.

Comment by Krati Singh [ 04/Apr/19 ]

The C# API throws following error: 504 Gateway Time-out

The mongo logs have frequent entries of below information but there is no error in the logs:
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 }

Comment by Eric Sedor [ 03/Apr/19 ]

Are you able to share any errors or responses provided by the MongoDB server to the C# driver backing the API service?

Comment by Krati Singh [ 03/Apr/19 ]

Sharing additional information - The bytes currently in use reaches 27 GB and maximum bytes configured is 33.8 GB which is MongoDB default for that 64 GB machine.

Generated at Thu Feb 08 04:55:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.