java memcached client

André Cruz andre.cruz at co.sapo.pt
Wed Jan 2 10:38:05 UTC 2008


Hello Greg.

On 2007/12/28, at 21:02, Greg Whalin wrote:

> Sorry for not responding sooner.  I have been out of town for the  
> holidays.  This does not correspond to any known or reported bug in  
> the Java client I am maintaining and it is in heavy use at quite a  
> few heavy installations.  Not saying that it is out of the question,  
> but definitely not something I am aware of.  Looking at the debug,  
> the client is simply spitting out the response it received from the  
> server.  How have you configured your client install (did you follow  
> the HOWTO document from the site)?
>

Yes I did. Here is some code:

		String serverList = ctx.getInitParameter(MEMCACHE_SERVERS_INIT_PARAM);
		timeout = 1000 *  
Long.parseLong(ctx.getInitParameter(TIMEOUT_INIT_PARAM));

		pool = SockIOPool.getInstance();

		if (serverList != null) {
			String[] memcaches = serverList.split(" ");
			if (memcaches.length > 0) {
				pool.setServers(memcaches);

			}
		}
		
		pool.setInitConn(5);
		pool.setMinConn(5);
		pool.setMaxConn(50);
		pool.setMaintSleep(1000);

		pool.setHashingAlg(SockIOPool.NEW_COMPAT_HASH);
		pool.setNagle(false);
		pool.initialize();
		


I then use SockIOPool.getInstance() in various places in my code to  
access memcache. Are there threading issues I should be aware of?

Also, I got an email from hanson.char at gmail.com saying:

> Hi André,
>
> I am using the java memecached client 1.6.1 with the SockIOPool
> replaced with ketama for consistent hashing.  I did find some
> threading issue and fixed them.  So currently the one I have seems to
> be running fine.  Are you interested to try out my version of the java
> memcached client to see if it still has the same problem ?


I don't know why he didn't submit them but maybe it would be  
productive if you two synched?

Thanks for the help,
André Cruz


More information about the memcached mailing list