high speed insert with java.net.SocketTimeoutException: Read timed out

259 views
Skip to first unread message

zhiping xiao

unread,
Mar 1, 2012, 10:59:48 PM3/1/12
to mongodb-user
hi
my woker is insert a big data with a high speed,I opened 16 threads
to bathinsert data,1000 at a time,

/** my server configuration :
* Linux CentOS release 5.4 (Final)
* cpu 16
* mem 32G
The aplication throws some Exception sometimes later, I hava set the
numactl --interleave and the rote of mem was
not very highly.

the exception is :

com.mongodb.MongoException$Network: can't call something : /
10.10.224.140:27017/trace
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
at com.mongodb.DBCollection.findOne(DBCollection.java:647)
at com.mongodb.DBCollection.findOne(DBCollection.java:626)
at
com.jd.wms.trace.service.init.TraceConsumer.findById(TraceConsumer.java:
55)
at
com.jd.wms.trace.service.init.BinarySearch.search(BinarySearch.java:
43)
at
com.jd.wms.trace.service.init.BinarySearch.search(BinarySearch.java:
44)
at
com.jd.wms.trace.service.init.BinarySearch.search(BinarySearch.java:
46)
at
com.jd.wms.trace.service.init.BinarySearch.search(BinarySearch.java:
46)
at
com.jd.wms.trace.service.init.BinarySearch.search(BinarySearch.java:
44)
at
com.jd.wms.trace.service.init.BinarySearch.serchRealIndex(BinarySearch.java:
58)
at
com.jd.wms.trace.service.init.FileConsumerThread.run(FileConsumerThread.java:
52)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at org.bson.io.Bits.readFully(Bits.java:35)
at org.bson.io.Bits.readFully(Bits.java:28)
at com.mongodb.Response.<init>(Response.java:39)
at com.mongodb.DBPort.go(DBPort.java:128)
at com.mongodb.DBPort.call(DBPort.java:79)
at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
... 14 more

Nat

unread,
Mar 2, 2012, 12:11:06 AM3/2/12
to mongod...@googlegroups.com
Can you post your mongostat when there is load? Did you set MongoOptions.sockettimeout? If so, try to set it to higher value or 0.

zhiping xiao

unread,
Mar 2, 2012, 3:07:40 AM3/2/12
to mongodb-user

I have set MongoOptions.sockettimeou=20000

Nat

unread,
Mar 2, 2012, 3:43:43 AM3/2/12
to mongod...@googlegroups.com
It's not enough then. You have to use higher value or lower your insert rate/threads.
-----Original Message-----
From: zhiping xiao <pingqu...@gmail.com>
Sender: mongod...@googlegroups.com
Date: Fri, 2 Mar 2012 00:07:40
To: mongodb-user<mongod...@googlegroups.com>
Reply-To: mongod...@googlegroups.com
Subject: [mongodb-user] Re: high speed insert with java.net.SocketTimeoutException:
Read timed out


I have set MongoOptions.sockettimeou=20000

--
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.

Reply all
Reply to author
Forward
0 new messages