File tree Expand file tree Collapse file tree
src/main/java/net/rubyeye/xmemcached/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5757 */
5858public class MemcachedHandler extends HandlerAdapter {
5959
60+ private static final int MAX_HEARTBEAT_THREADS = Integer .parseInt (System .getProperty ("xmemcached.heartbeat.max_threads" , String .valueOf (Runtime .getRuntime ().availableProcessors ())));
61+
6062 private final StatisticsHandler statisticsHandler ;
6163
6264 private ExecutorService heartBeatThreadPool ;
@@ -295,7 +297,7 @@ public void start() {
295297
296298 long keepAliveTime = client .getConnector ().getSessionIdleTimeout () * 3 / 2 ;
297299
298- this .heartBeatThreadPool = new ThreadPoolExecutor (0 , Runtime . getRuntime (). availableProcessors () ,
300+ this .heartBeatThreadPool = new ThreadPoolExecutor (1 , MAX_HEARTBEAT_THREADS ,
299301 keepAliveTime , TimeUnit .MILLISECONDS ,
300302 new SynchronousQueue <Runnable >(),
301303 new ThreadFactory () {
You can’t perform that action at this time.
0 commit comments