memcached for win32, new java api

Greg Whalin gwhalin at meetup.com
Mon Nov 29 15:12:14 PST 2004


Gregory Block wrote:
> On 29 Nov 2004, at 17:20, Evan Martin wrote:
> 
>> I randomly stumbled across this:
>>   http://www.ctoforaday.com/archives/000039.html
>> which indicates they've almost got memcached building on win32 (why? not
>> sure...), as well as a "more adventurous" Java client that uses
>> connection pools, worker threads, etc. for better performance.
> 
> 
> Oh, yes.  I did quite a bit of work on it.  Then it got utterly stomped 
> on, performance-wise, by the work done by meetup.

Glad to hear this.

> Mind you, I'm not using it as-is; the Meetup client has one of the same 
> problems I had in the beginning, which is with the assumption that 
> get-multi will only be used in a single-threaded manner.

Here I am confused?  We don't make any assumption about this running in 
a single thread.  Since we are pulling all sockets from a pool, this 
method should be as easily parallelized as any other method in the 
client.  Are you saying you have found a case where our client is not 
thread safe?  If so, please, by all means let me know. I can say that we 
run the client in a pretty heavily parallelized environment with a 
single instance and have had no problems, but tracking threading bugs 
can always be a bit tricky, so if you know something we don't, share the 
love.  :)

A nice thing about using a connection pool and a parallelized 
environment, is that there is much less of a benefit to using getMulti() 
  (you save a bit in network bandwidth at the cost of more 
parallelization).  This is of course, assuming no optimizations on the 
server side to using getMulti(), which I honestly have to profess my 
ignorance.  Anyhoo, this is a bit off topic.

> However, the easiest way I've found of managing this is to actually just 
> go ahead and create an object pool of memcached clients, and grab one 
> out of the pool every time I need one in order to supply myself with the 
> level of parallelism required.


Again, we only ever have one instance of the client, which uses a pool 
of sockets.  If you are only ever gonna have one connection open to the 
server, then a pool of clients should work as well.

Greg
--
Greg Whalin
greg at meetup.com


More information about the memcached mailing list