Closed GoogleCodeExporter closed 8 years ago
Ya i have the same issue.
We have 25 threads which make requests to memcached. And they are works slowly,
after
profiling i found this:
_______________________________
Name,"Time (ms)","Count"
sun.nio.ch.WindowsSelectorImpl.wakeup(),"74771","11664"
net.spy.memcached.MemcachedConnection.addOperation(MemcachedNode,
Operation),"",""
net.spy.memcached.MemcachedConnection.addOperation(String, Operation),"",""
net.spy.memcached.MemcachedClient.addOp(String, Operation),"",""
net.spy.memcached.MemcachedClient.asyncGet(String, Transcoder),"",""
net.spy.memcached.MemcachedClient.asyncGet(String),"",""
_______________________________
So every thread spend 74 sec of total 300 sec for waiting...
Is there any way to fix this, could be add some connection pooling?
Original comment by alexkhim...@gmail.com
on 30 Oct 2009 at 9:20
All this is really telling me is that there's a lot of time spent on the
network.
Do these ever complete or do they hang indefinitely.
The specific behavior of the windows wakeup seems to be another issue. That's
saying
it takes about 6 milliseconds every time I tell the connection to wake up
because
there's more local work to do. I'd consider that a bug in Windows and/or Java.
Original comment by dsalli...@gmail.com
on 11 Nov 2009 at 7:23
Is there any way to increase connections count to memcached? Some type of
connections
pooling like in Xmemcached?
I think i have that blocking/waiting issue because all threads use 1
spymemecached
connection to communicate with server.
Original comment by alexkhim...@gmail.com
on 11 Nov 2009 at 7:55
Why do you feel more connections would help?
The only theoretical advantage multiple connections will get you would be to
cheat
the TCP congestion avoidance algorithm in certain cases. It's otherwise the
same two
processes talking.
There's no reported congestion on the thread. The closest I see is Windows
being
slow to handle wakeup events on a selector. The same selector would be used
for more
connections, so if anything, I'd expect it to be worse.
Adding more connections means reducing multiget/multiset escalations and
deduplication optimizations, so it could very well make things worse.
It's possibly worth testing, but it's not intuitive to me that more connections
would
help this issue.
Original comment by dsalli...@gmail.com
on 11 Nov 2009 at 8:17
Original issue reported on code.google.com by
hoga...@gmail.com
on 15 Sep 2009 at 1:30