Comments (7)
Hi dracoyang,
I have some question about your report.
-
200 concurrent 'get' and 'set' means 200 TPS? If so, it is not a havery load. If you refer to the wiki https://github.com/gwhalin/Memcached-Java-Client/wiki/PERFORMANCE you will find that our client can handle it easily.
So why you make sure that the performance bottleneck is memcached client? Did you do some performace tuning to your application? -
Our client is synchronized, so it will return immediately even though it encounts some exception. In other words, it will not hang up the child thread.
If I misunderstand your report, couid give me some more information, so that I can figure out a solution to help you.
ps. Are you work for fengxing software? Could you tell me in which city this company located? I am interesting in it.
Thank you.
Meng Lee
from memcached-java-client.
Hi, mengli:
For your questions, below are my answers:
1) 200 concurrent 'get' and 'set' means 200 TPS? If so, it is not a havery load. If you refer to the wiki https://github.com/gwhalin/Memcached-Java-Client/wiki/PERFORMANCE you will find that our client can handle it easily.
So why you make sure that the performance bottleneck is memcached client? Did you do some performace tuning to your application?
I think our load is more than 200TPS, we use a thread for each memcached 'get' and 'set', that means we have more than 200 threads(we're using thread pool) to do this, from our monitor page we see most of these threads are busy at most of time. If a memcached 'get' or 'set' can be done within 100ms in average, then the load will be reach to 2000TPS or more.
we have done performance tuning to our application for more than half a year, we have resolved some bottlenecks such as synchronized lock, infinite loop, dead lock, etc, the clue we think there's a bottleneck in memcached client is: from the thread dump we found many of these memcached 'get'/'set' threads were blocked at 'socket.connect()' of SocketChannel when load is high, we are not sure why here is a bottleneck, we can quickly telnet to any of the memcached server from the server the application runs on, so the network is no problem, but it does not work well in our application. from the source code of 2.5.1, we know it will always create a new connection to memcached server if the connection pool is out of use, if many requests come at the same time, it will be a problem since there's not good synchronization. in new version 2.6.1 it uses apache commons pool to manage the socket connections, I think it will probably resolve this issue, I'm doing more tests for this. Mengli, any suggestion?
2) Our client is synchronized, so it will return immediately even though it encounts some exception. In other words, it will not hang up the child thread.
It looks like the current implementation does will not hang up the child thread, but the best practice is just catching concrete exception or need to process the interrupted exception, here is a reference, hope it can be helpful to explain my suggestion, http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html
ps. Are you work for fengxing software? Could you tell me in which city this company located? I am interesting in it.
Yes, our company is located in San Francisco, and we have branch offices in Changsha, Chengdu, Inner Mongolia. :)
Thanks a lot for your reply!
Draco Yang
from memcached-java-client.
HI dracoyang,
Our client is thread safe, so why not just get rid of the thread pool for memcached client? I think it will improve the performance obviously.
Hey, my hometown is Changsha. Right now, you work in Changsha? I am hunting a job in Changsha, so I just want to know whether there is any technical position in Changsha branch office.
Meng Li
from memcached-java-client.
We need to give up waiting for the cache 'get' if it's timed out(e.g. 500ms or 1 sec), if get rid of the thread pool, do you have better idea to implement this?
Yes, we are looking for new developers, I think there should be technical positions fit for you, I can give you a call for the details, please send your cell number to my email [email protected] when you feel free.
from memcached-java-client.
Hi dracoyang,
It's my pleasure to help you in tuning the performance of memcahced client.
To my understanding, your memcached server is deployed in WAN. So the network latency is very high and you need to set a timeout for get operation. Am I right?
If so, can you deploy your memcached server in LAN?
If your memcached server is already in LAN, and the latency is low, I suggest you call our client directly in application. There is no need to set a timeout for each get. Asynchronized usage of our client will obviously drop the performance of get operation.
Meng Lee
from memcached-java-client.
Shall I close this issue?
Anyway, the exception handling mechanism is not perfect in this client.
from memcached-java-client.
Let's close this issue at this moment.
from memcached-java-client.
Related Issues (20)
- Issue number 35 not fixed properly HOT 1
- Binary and Ascii clients together in one application
- 2.6.3 version:java.lang.OutOfMemoryError: Direct buffer memory
- Update code from maven (versions 3.*)
- Memcached信息过期的问题 HOT 1
- the return value of statsCacheDump() in BinaryClient
- why we dont have getExpiryTime(key) method?
- The flush_all method is working on the wrong way
- Add a license to the repo HOT 1
- nio下超时问题
- when ClassNotFoundException is thrown , a memory leak will happen after many times of get() operation.
- how to confirm a key exit and not to deserialization it
- Memcached client throwing NullPointerException
- java.lang.VerifyError: Bad type on operand stack
- Does this client support auth with password?
- java.io.IOException: Connection timed out HOT 1
- exception thrown while writing bytes to server on set HOT 1
- Memcache Client returns null even when cache is hit.
- Memcached self maintenance
- Cache client not honoring Expiry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memcached-java-client.