globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 231 forks source link

Cause of IO timeout #333

Closed smaheshs closed 5 years ago

smaheshs commented 5 years ago

I am frequently getting IO timeouts while reading and writing data to Mongo DB. The post here gives an idea about how to avoid this error but solution doesn't look convincing.

I couldn't find any information about what causes this error in the first place. I mean is it due to too much load, wrong index key etc. This information could help to make changes to avoid/fix this problem in a better way.

So if someone could please throw some light about this, it would help to understand and fix this issue in a better way.


What version of MongoDB are you using (mongod --version)?

db version v3.6.6-1.4

What version of Go are you using (go version)?

go version go1.11.4 linux/amd64

What operating system and processor architecture are you using (go env)?

GOHOSTARCH="amd64" GOHOSTOS="linux"

What did you do?

There are no known ways to see this error. Sometimes it comes in non peak time as well.

Can you reproduce the issue on the latest development branch?

Yes

maitesin commented 5 years ago

Hi @smaheshs

Can you provide some code to reproduce this behaviour?

Best regards, Oscar

domodwyer commented 5 years ago

Hi @smaheshs

This is normal - you're likely overloading your client/server/network or your timeouts are too low for your workload. Indexes will help if your queries are taking a long time, and limiting load will help in general.

Sorry, we can't really help! Dom