socket timeout

194 views
Skip to first unread message

Oded Maimon

unread,
Jan 31, 2011, 5:29:35 AM1/31/11
to mongodb-user
how should we handle the following error when using mongos:
Jan 31, 2011 10:02:54 AM com.mongodb.DBTCPConnector$MyPort error
SEVERE: MyPort.error called
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
?

should we ignore and retry? or there is a better connection pooling
solution in mongodb java driver that we need to configure?

thanks?

Oded Maimon

unread,
Jan 31, 2011, 5:34:31 AM1/31/11
to mongod...@googlegroups.com
Hm,
at the same time we got the following error from a mongo shell (connects through mongos):
> db.users.count();
Mon Jan 31 10:15:59 trying reconnect to localhost:5555
Mon Jan 31 10:15:59 reconnect localhost:5555 ok
120000
 

Nat

unread,
Jan 31, 2011, 5:34:53 AM1/31/11
to mongod...@googlegroups.com
What kind of query and load do you do? In general, you shouldn't get that unless the query is really slow. How long did the query take?
--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Oded Maimon

unread,
Jan 31, 2011, 5:56:31 AM1/31/11
to mongod...@googlegroups.com
we are generating data for testing.. around 1M rows totally in all collections together... no queries are done, only db.coll.save()..


the slowest command i see in the mongodb logs are:
Mon Jan 31 06:55:24 [conn12] query admin.$cmd ntoreturn:1 command: { writebacklisten: ObjectId('4d417390d793c9855b8d5c5a') } reslen:13179 321829460ms
Mon Jan 31 07:30:01 [conn12] query admin.$cmd ntoreturn:1 command: { writebacklisten: ObjectId('4d417390d793c9855b8d5c5a') } reslen:1483 2076262ms
Mon Jan 31 06:55:24 [conn64] query admin.$cmd ntoreturn:1 command: { moveChunk: "mydb.users", from: "server1:5555", to: "server2:5555", min: { _id: MinKey }, max: { _id: 1 }, shardId: "mydb.users-_id_MinKey", configdb: "server1:6666,server2:6666,server3:6666" } reslen:53 5026ms

and some other move chunks that took between 1000-3000ms...

what are the writebacklisten commands that takes so long?

Nat

unread,
Jan 31, 2011, 5:59:35 AM1/31/11
to mongod...@googlegroups.com
- how many threads do you use?
- what is your shard setup? Shard key?
- is the server overloaded? Do you have mongostat/iostat?
From: Oded Maimon <oded....@gmail.com>
Date: Mon, 31 Jan 2011 02:56:31 -0800 (PST)
Subject: Re: [mongodb-user] socket timeout

Oded Maimon

unread,
Jan 31, 2011, 7:21:53 AM1/31/11
to mongod...@googlegroups.com
- the data load is single threaded
- two shards, 3 config servers, 5 mongos (one on each application server), each collection is sharded by _id, in most cases (almost all) the _id value is a numeric sequence..
- the servers are not overloaded, but are busy with around 70%...

I'm Unable to reproduce it :)

Eliot Horowitz

unread,
Jan 31, 2011, 8:29:53 AM1/31/11
to mongod...@googlegroups.com
What did you set the java socket timeout to?

Maimon Oded

unread,
Jan 31, 2011, 10:23:59 AM1/31/11
to mongod...@googlegroups.com

10000

On Jan 31, 2011 3:30 PM, "Eliot Horowitz" <elioth...@gmail.com> wrote:

What did you set the java socket timeout to?


On Mon, Jan 31, 2011 at 5:29 AM, Oded Maimon <oded....@gmail.com> wrote:

> how should we handle ...

> You received this message because you are subscribed to the Google Groups "mongodb-user" group.

> ...

Eliot Horowitz

unread,
Jan 31, 2011, 10:25:35 AM1/31/11
to mongod...@googlegroups.com
Ok, so something just took more than 10 seconds.
Can you turn on query profiling on all the shards so we can figure out what?

> --


> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.

Maimon Oded

unread,
Jan 31, 2011, 10:30:16 AM1/31/11
to mongod...@googlegroups.com
i will...
--


Oded.
Reply all
Reply to author
Forward
0 new messages