Mongodb - error when several processes perform updates simultaneously on same collection
Mongodb - error when several processes perform updates simultaneously on same collection
I have written a C program using the mongoc API and I'm running several instances of this program simultaneously. These processes do an update of the same collection from time to time. My problem seems to be that when too many of these try to do updates at the same time, I tend do (although not always) get this error:
Failed to send "update" command with database "test": Failed to read 4
bytes: socket error or timeout
It seems quite clear that I'm overloading the hardware somehow. Is there some way to know in advance whether the db is too busy to allow another process doing updates, so that it is queued for an update later? Or some way of limiting the use of hardware for each process? Or how does one usually deal with this situation?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment