Re: [libmemcached/libmemcached] Clarify source of truth and maintenance status for libmemcached development (#13)

2021-04-23 Thread 'Brian Aker' via memcached
Hi!

Launchpad is the canonical source. There are some patches I have pushed 
recently and there will probably be a release in the near future. 

— Brian

乌



> On Apr 22, 2021, at 11:26 AM, Dylan Thacker-Smith  
> wrote:
> 
> 
> Is this supposed to be the source of truth for libmemcached development? The 
> README says project information is on https://libmemcached.org/ 
>  but "Source Code" link on that page links to 
> https://code.launchpad.net/libmemcached 
>  which doesn't mention this repo. 
> The launchpad project also has its own bug tracking 
> (https://bugs.launchpad.net/libmemcached 
> ) which is linked to from the "Bug 
> Tracking" link on https://libmemcached.org/  . The 
> README refers contributors to README.FIRST which also references launchpad 
> and the bazaar repo.
> 
> There is also a mention of a mailing list on the README which I didn't find.
> 
> On the other hand, the README says to report bugs here 
> (https://github.com/libmemcached/libmemcached/issues 
> ), so it does look like 
> there was an intention of moving development here.
> 
> It looks like there was some work somewhat recently to keep this project 
> building, which seemed to previously be a blocker for development (#3 
> (comment) 
> ).
>  However, there is still no CI setup and tests aren't passing locally with 
> the latest memcached server version (e.g. #12 
> ), which should be 
> prioritized to more confidently make and accept changes.
> 
> Ubuntu had also decided this library wasn't being maintained when trying to 
> address https://bugs.launchpad.net/libmemcached/+bug/1381160 
>  as seen from the 
> discussion on 
> https://bugs.launchpad.net/ubuntu/+source/libmemcached/+bug/1573594 
> 
> Upstream seems pretty quiet since 2014
> Unfortunately, because the project seems more or less dead ... it seems like 
> we won't be able submit anything upstream and go straight to fixing Debian 
> and Ubuntu.
> 
> It looks like that security bug still hasn't been fixed here. That means that 
> distributions are having to maintain their own set of patches. For instance, 
> it looks like Ubuntu focal has 8 patches for libmemcached.
> 
> @BrianAker  are you looking for help 
> maintaining the library? If so, there is a more actively maintained fork made 
> by @m6w6  at https://github.com/m6w6/libmemcached 
>  which is supposed to be a 
> "Resurrection of libmemcached https://launchpad.net/libmemcached 
> ". Were you aware of that fork? The fact 
> that the fork started from the code on launchpad (first commit after forking 
> )
>  after development started in git (commit that introduced .gitignore 
> )
>  is another indication that it should be clearer if this github repo should 
> be the source of truth.
> 
> Note that https://github.com/m6w6/libmemcached 
>  has a test suite that passes with the 
> latest memcached, it has CI setup to test PRs and has fixed the above 
> mentioned security issue. I would like to help (e.g. #12 
> ) but it seems like 
> doing the work here is redundant when I see the same issue already fixed 
> there. @BrianAker  do you have any concerns 
> with the direction that the fork is taking? Since ideally we could align our 
> efforts and work together in a single clear official repo of libmemcached 
> development.
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub 
> , or unsubscribe 
> .
> 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/memcached/75DEE970-26AB-4D75-9FA7-1A50C0B77F62%40tangent.org.


Re: Python Memcached

2017-08-25 Thread Brian Aker
I am not really sure where to go with libmemcached right now.

Its design shows the age in which it was built.

> On Aug 25, 2017, at 00:52, dormando  wrote:
> 
> Pretty sure Frank was asking about server implementations of memcached in
> python.
> 
> As per that, I've only ever seen people create those for eduational
> purposes. Not aware of something anyone runs in production. What do you
> need it for?
> 
> As per libmemcached being idle; I've noticed and am hoping to be able to
> work on it this year.
> 
> -Dormando
> 
> On Thu, 24 Aug 2017, Min-Zhong "John" Lu wrote:
> 
>> We use pylibmc. Fairly stable and built-in handling of multi-server key 
>> distribution. The disadvantage of pylibmc (and many other client libraries) 
>> lies
>> in its dependency on libmemcached, which has seen little activity for quite 
>> some while, which in turn hinders utilization of new memcached commands; IIRC
>> one example is the GAT command.
>> Frankly the situation is the same for any python client library depending on 
>> libmemcached for the actual underlying protocol/network communication. I
>> believe there's essentially no way to work around it except for 
>> patching/building your own libmemcached.
>> 
>> Cheers,
>> - Mnjul
>> 
>> On Thursday, August 24, 2017 at 2:55:13 PM UTC-7, Frank Wang wrote:
>>  Hi,
>> I know there are a bunch of Python versions of memcached clients. Does 
>> anyone know of any good/stable Python implementations of the memcached
>> server?
>> 
>> Thanks,
>> Frank
>> 
>> --
>> 
>> ---
>> You received this message because you are subscribed to the Google Groups 
>> "memcached" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to memcached+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>> 
>> 
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to memcached+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


libmemcached version 1.0.18 released

2014-02-09 Thread Brian Aker
Hi!

* MEMCACHED_BEHAVIOR_RETRY_TIMEOUT can now be set to zero.
* Numerous bug fixes.
* Had kid, which caused delay in release

Find it here: https://launchpad.net/libmemcached

Cheers,
-Brian

-- 

--- 
You received this message because you are subscribed to the Google Groups 
memcached group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Strange behaviour on get-multi over binary protocol

2013-02-19 Thread Brian Aker
Hi,

On Feb 18, 2013, at 7:11 PM, dormando dorma...@rydia.net wrote:

 1) libmemcached requests 2 keys
 2) memcached responds with 1 key
 3) libmemcached sends no-op packet
 4) memcached responds with 2nd key, no-op packet

Assuming one server and binary protocol... a single write to the socket would 
be made for both keys under both the binary and ascii server (assuming the keys 
are small enough to fit into the default buffer, which is the case assuming 
trunk version of memcached). 

The code bunches up as many requests as can be made into the buffer before 
flushing. When looking through the code I didn't find anything that should be 
fouling that up (though I did find that we were incrementing the packet counter 
more then what we should, but that won't really effect anything). 

Anyway, everything looks to be ok.

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Re: Strange behaviour on get-multi over binary protocol

2013-02-19 Thread Brian Aker
Hi,

On Feb 19, 2013, at 12:14 AM, dormando dorma...@rydia.net wrote:

 Both keys go out okay, but the no-op at the end seems to go out in a
 separate packet. I've noticed this on several installs using libmemcached,
 verified with tcpdump/etc.

I didn't write this part of the  binary code, Trond did. I am not sure why the 
NOOP is required. I would think that a simple flush of the buffer would be fine.

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Re: Strange behaviour on get-multi over binary protocol

2013-02-19 Thread Brian Aker
Agreed, I'll take a look and see why that is happening.

From looking at the code I can see where it is happening, I just need to find 
out if there was a reason for it. The default value for io_key_prefetch is 
zero, which is what is causing the flush to happen:

http://docs.libmemcached.org/memcached_behavior.html?highlight=memcached_behavior_io_key_prefetch#MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH

It would be interesting to see what would happen if the original reporter of 
this issue modified that value upward.

Cheers,
-Brian

On Feb 19, 2013, at 12:28 PM, dormando dorma...@rydia.net wrote:

 
 
 On Tue, 19 Feb 2013, Trond Norbye wrote:
 
 Its been a while since I looked at that code but if my memory is correct 
 we're using the quiet' mode of the get requests so that it won't send not 
 found results. The noop is then used as an internal marker so that you know 
 on the receiving side that you've
 received all of the responses from the server..
 But I might remember this wrong.. after all its been a few years since I 
 last looked at the code.
 
 Trond
 
 
 
 On Tue, Feb 19, 2013 at 5:07 PM, Brian Aker br...@tangent.org wrote:
  Hi,
 
  On Feb 19, 2013, at 12:14 AM, dormando dorma...@rydia.net wrote:
 
 Both keys go out okay, but the no-op at the end seems to go out in a
 separate packet. I've noticed this on several installs using libmemcached,
 verified with tcpdump/etc.
 
 I didn't write this part of the  binary code, Trond did. I am not sure why 
 the NOOP is required. I would think that a simple flush of the buffer would 
 be fine.
 
 Cheers,
 -Brian
 
 
 
 
 --
 Trond Norbye
 
 --
  
 ---
 You received this message because you are subscribed to the Google Groups 
 memcached group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to memcached+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  
 
 
 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
memcached group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Strange behaviour on get-multi over binary protocol

2013-02-18 Thread Brian Aker
Hi,

On Feb 18, 2013, at 6:03 PM, Diogo Baeder diogobae...@gmail.com wrote:

 I have no clue why libmemcached does that switch in the middle, but I 
 understood what you said about not expecting things to happen in an exact 
 order 

Are you sure the data is on the same server? Libmemcached responds back with 
whatever returned first, which when spread across a number of servers,... well 
who knows who might respond back the quickest.

If you want order, then issue a single blocking get (one after another).

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Version 1.0.14 of Libmemcached Released

2012-11-15 Thread Brian Aker
Hi!

From the Changelog:
* CLIENT_ERROR fixed to not be treated as a fatal error.
* Compiler fixes for older Ubuntu releases.

https://launchpad.net/libmemcached/1.0

More information at:

http://libmemcachd.org/

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Version 1.0.12 Released

2012-10-10 Thread Brian Aker
Hi,

From the change log:
Added memcached_result_take_value(). 
Added ax_libmemcached.m4.
Minor bug fixes.

You can find it here:
https://launchpad.net/libmemcached

Cheers,
-Brian

Version 1.0.11 of Libmemcached Released

2012-09-19 Thread Brian Aker
Hi!

* Removed custom version of memcached.
* Updated hardening rules.
* Fixed a case where the return error from a socket connection differred from 
that of a TCP/IP socket.

http://launchpad.net/libmemcached/

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Re: Does libmemcached Have MYSQL Support

2012-08-24 Thread Brian Aker
Hi,

You can write callback functions in libmemcached so that upon cache miss it 
will fetch data/populate Memcached.

Cheers,
-Brian

On Aug 24, 2012, at 1:53 PM, Xun TANG tangxun.al...@gmail.com wrote:

 Thanks for the fast reply. 
 
 I understand that memcached is a cache server, and mysql is a db server.
 In my case, the flow is like this: 
 for read, if cache hits, great, pass the value back directly; if miss, read 
 from mysql server.
 for write, if hits, write both cache and sql server; if miss, write only sql 
 server.
 
 I personally do not care about how mysql caches queries, or how mysql batches 
 writes.
 I trust it to do its job efficiently. 
 
 So it doesn't seem like memcached server could talk to mysql server directly.
 It has to be memcached server reply memcached client about the miss, 
 while the client takes care of the remote connection with mysql server.
 Is this correct?
 
 Any comment welcome.
 
 Thanks,
 Xun
 
 On Fri, Aug 24, 2012 at 11:02 AM, Roberto Spadim robe...@spadim.com.br 
 wrote:
 check this: 
 http://dev.mysql.com/tech-resources/articles/nosql-to-mysql-with-memcached.html
 
 2012/8/24 Roberto Spadim robe...@spadim.com.br:
  well, two different things...
  one is a database server - mysql (that have a query cache, and others 
  caches)
  other is a cache server - memcached (that doesnt matter about losing
  data, since it´s a cache)
 
 
  mysql have some tools that you can set/get values in a innodb or ndb
  table, but it´s a feature of mysql, you should search at dev mysql
  site...
 
  i think this will help you :)
  bye
 
  2012/8/24 Xun TANG tangxun.al...@gmail.com:
  This is probably a silly question, but I am not able to find the answer
  googling.
 
  I know libmemcached is great in setting and getting key/value pair to and
  from the memcached server.
  Also our service engine is written in C++. This makes libmemcached a great
  fit for us.
 
  I looked through http://docs.libmemcached.org/ ,
  but can't find anything about how memcached client should interact with the
  database (MYSQL server in my case)
  when cache miss happened.
 
  Questions:
  1. Is there a way to interact with MYSQL server in C++ with decent
  performance?
 
  2. If no to question 1, which would you recommend?
  I see Perl, Python, PHP, Java, and even User-Defined Functions.
  If I do not have particular preference on the language, what are the pros
  and cons for each?
 
 
  Thanks ahead guys,
  Xun
 
 
 
 
  --
  Roberto Spadim
  Spadim Technology / SPAEmpresarial
 
 
 
 --
 Roberto Spadim
 Spadim Technology / SPAEmpresarial
 



Re: [URGENT][HELP] Need help with libmemcached

2012-08-04 Thread Brian Aker
Hi!

On Aug 4, 2012, at 7:56 AM, Sourabh Chandak sourabh3...@gmail.com wrote:

 I am trying to build a standalone program to connect to memcached server and 
 use the key-value technology of it. I want to code STRICTLY in C. I get a 
 undefined reference error when I use the method memcached(memcache_st *, int).

You need to provide information on how you are compiling your program.

Cheers,
-Brian

smime.p7s
Description: S/MIME cryptographic signature


Re: Issue 281 in memcached: Cant store \Memcached objects in global variables

2012-07-22 Thread Brian Aker
Hi,

This is fixed in trunk (possibly 1.0.10 as well).

Cheers,
-Brian

On Jul 22, 2012, at 11:21 AM, memcac...@googlecode.com wrote:

 Status: New
 Owner: 
 Labels: Type-Defect Priority-Medium
 
 New issue 281 by sma...@gmail.com: Cant store \Memcached objects in global 
 variables
 http://code.google.com/p/memcached/issues/detail?id=281
 
 What steps will reproduce the problem?
 1. construct a \Memcached object, call addServer, and save the variable in a 
 global
 2. define a global in a separate namespace, in a class later during runtime
 3. call any \Memcached method
 
 What is the expected output? What do you see instead?
 Call to the instance's Memcached::getStats() method throws Memcached 
 constructor was not called even though the constructor was called.  It 
 appears that the global no longer has a valid \Memcached instance
 
 What version of the product are you using? On what operating system?
 
 Ubuntu 11,
 libmemcached version = 0.40
 latest from apt package php-memcached
 
 



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [Memcached][Replica] First get after a node failure

2012-06-08 Thread Brian Aker
Hi,

Does this happen if you are not using binary mode? 

I would also look at the latest version, 0.51 is a bit old.

Cheers,
-Brian

On Jun 6, 2012, at 6:05 PM, Nicolas Motte wrote:

 Hi,
 
 I went through all the libmemcached code (v0.51).
 I wrote down a simple test to check I understood correctly the
 behavior of the lib.
 
 Here is my test case :
 
 I start 3 memcached nodes. The settings are : binary protocol, ketama,
 connect_timeout=100, retry_timeout=1, number_of_replica=1, no_block=0
 I try to get an item on this empty farm. It tries the first node, the
 replica, and return false - ok
 Then, I saw in the code that in case of a set, we set the key to the
 first node, and then we buffer the set to the replica. So I call set
 enough to flush this buffer. At that point, I have
 
 first node - 368 keys
 second node - 364 keys
 third node - 0 keys
 
 My keys are Key1 and Key2, always stored with the same value
 I try to get my item, it finds it in the first node - ok
 Then I kill the first node, and try to get Key1. As NO_BLOCK is set to
 0, it first flushes the remaining call in the buffer, which means we
 now have 368 keys in the second node.
 At that point, I expect my get to return the correct value (it should
 try on the first node, see that the connection is down, put it in
 timeout state, and try on the replica).
 But in practice, it returns false, and the second node didn t receive
 any query.
 If I call get a second time on this same key, this time it finds it in
 the replicaI really don t get why...
 
 Then I start again the first node, auto_ejecct is set to false, so I m
 sure it has not been removed from the ketama continuum. At that point,
 if I try to get the key, it should try to find it on the first node
 (and fail since this node is empty). But in fact, it directly goes to
 the second node, the first node doesn t receive queries anymore even
 if I send a lot of them...I don t understand why neither.
 
 I hope someone will be able to help me..
 Cheers
 Nico



signature.asc
Description: Message signed with OpenPGP using GPGMail


Version 1.0.8 of libmemcached released

2012-05-23 Thread Brian Aker
Hi!

Added support for setting options via ENV variable LIBMEMCACHED. Fix corner 
case on last used result. Bug fixes.
http://launchpad.net/libmemcached

Cheers,
-Brian

signature.asc
Description: Message signed with OpenPGP using GPGMail


Version 1.06 of libmemcached released

2012-04-10 Thread Brian Aker
Hi,

You can find new versions at http://launchpad.net/libmemcached

From the Changelog:
* Fixes for gcc 4.7, lp:961812
* Fix for restart issue that happens under testing.
* Fix for lp:962815.
* Support for transparent AES encryption.

Cheers,
-Brian

signature.asc
Description: Message signed with OpenPGP using GPGMail


Libmemcached 0.28 Released

2012-01-27 Thread Brian Aker
Hi!

* Fix for memcached_dump().
* Additional testing for memcached_stat_execute().

Minor release for most. 
http://libmemcached.org/

Cheers,
-Brian

signature.asc
Description: Message signed with OpenPGP using GPGMail


Libmemcached Version 1.0.3 Released

2012-01-10 Thread Brian Aker
Hi!

* Increased size of sort buffer used during Ketama.
* Added support for new behavior to handle dead servers.
* Overall haul of UDP IO.
* Fixed C compile issue with memcached_exist()
* Numerous bug fixes.
* Clang support for OSX.
* All commands now using vector send support.

http://libmemcached.org/
https://launchpad.net/libmemcached/+download

Cheers,
-Brian

signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: benchmarking memcached / low performance

2011-12-14 Thread Brian Aker
Hi,

On Dec 14, 2011, at 8:11 PM, dormando wrote:

 Unless your application *needs* to run a single thread and hit memcached
 in a loop without issuing multigets or multisets (no_reply), your test

To elaborate on this. 

While batch all of the SET/GET/MGET will be packed up while being sent. A 
GET/MGET operation will force a flush on the socket for the Memcache instance 
that data is being retrieved for.

A SET operation in batch mode does not force a flush of the socket. 

Just to point this out, a MGET is better then a GET, since a GET will force a 
request for each operation.  

Cheers,
-Brian

signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: benchmarking memcached / low performance

2011-12-13 Thread Brian Aker
Out of the box the default settings for the library may not be what
you want.

What is the size of the workload you are sending?

Sent from my TI85

On Dec 13, 2011, at 13:10, dormando dorma...@rydia.net wrote:

 I'm running: Linux AS292 2.6.38-13-generic #52-Ubuntu SMP Tue Nov 8
 16:53:51 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux Ubuntu 11.04

 My CPU is Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz with 2 cores.
 Pretty high end laptop.

 I've compiled and installed memcached 1.4.10. I've also compiled and
 installed libmemcached-1.0.2. I've started memchached without any
 additional options.

 I'm running a simple c++ program to benchmark memcached sets per
 second. I can only get ~22k sets per second which I think is quite
 low? I would be expecting at least 50k and even 300k with latest
 memcached optimizations?

 However maybe I'm completely off with my expectations. Here's the
 program that I'm running. Is there anything that I'm doing wrong?

 Thanks!

 Run two or three more of your applications, or adjust it to run many
 connections in parallel, or to use binary protocol and stack SET's.

 memcached will go much faster, but a single process with a single
 connection will be limited by the roundtrip latency.

 Using mc-crusher and multigets or multisets over localhost I can hit
 millions: https://github.com/dormando/mc-crusher - but it's not a full
 featured client. If I wanted a real client to go that fast, I would
 have
 to run many more of them as they'd use a bit more CPU.


1.0.2 Release of Libmemcached

2011-10-26 Thread Brian Aker
Hi,

1.0.2 Mon Oct 24 08:00:48 PDT 2011
* Dropped libmemcached/memcached_util.h (undocumented header file)
* Added memcached_touch() and memcached_touch_by_key()
* UDP support restructured to toggle on a complete memcached_st structure.

http://libmemcached.org/

Cheers,
-Brian



Re: libmemcached C library and key expiration

2011-10-07 Thread Brian Aker
Hi!

On Oct 7, 2011, at 4:14 AM, Vladut Paiu wrote:

 Thanks very much for the answers.
 Any idea when this feature will make it in an official release of
 libmemcached ?

I'd say next week. We are going to roll out the 1.0 RC and this will be in it.

Cheers,
-Brian

Version 0.53 of libmemcached released

2011-09-29 Thread Brian Aker
Hi!

* Fix for FreeBSD/OpenBSD and -lm  
* Added memcached_exist()
* Fix for memory when using config test.  
* CLI gained --quiet

http://libmemcached.org/

Blog post on memcached_exist()  -  http://blog.krow.net/post/10549707127

Cheers,
-Brian


Re: Multi-get getting stuck

2011-09-29 Thread Brian Aker
Hi!


On Thu, Sep 29, 2011 at 7:47 AM, Prasad pspha...@gmail.com wrote:

 I am trying to use mget() to get multiple data pieces using the C++
 API. When it works the performance difference is great.


Is this the one in libmemcached? If so use the C API. The C++ API is just
there for a couple of folks who wanted to have one. Its a wrapper around the
C api and it wouldn't surprise me if it was slower. In version 2.0 we are
likely to completely rewrite it.

Cheers,
   -Brian


Re: Multi-get getting stuck

2011-09-29 Thread Brian Aker
Hi!


On Sep 29, 2011, at 2:07 PM, dormando dorma...@rydia.net wrote:

 Still, I thought this was fixed already. As a workaround you can chunk
 your multigets into smaller sections, but I thought that the client did
 support it

It does, so I would wonder how many total key requests are being sent.

Cheers,
  -Brian


Re: Multi-get getting stuck

2011-09-29 Thread Brian Aker
Hi!

On Sep 29, 2011, at 2:30 PM, Prasad wrote:

 And so with this fix does the client call a fetch after a small chunk
 of multigets are reached inherently? Since I don't call the fetch till
 I return from the mget API call.

There is a water mark that causes the mget to go multi if it is too long. The 
specific watermark is not something I recall (i.e. I would need to pull up the 
code).

Could you provide for me a sample set of keys? I'd like to create a test case 
for this.

Cheers,
-Brian

Re: How to identify by name memcached instances?

2011-09-20 Thread Brian Aker
Inside of libmemcached we server:port 

Unless you are doing some bind trickery that should work for you.

Sent from my C64

On Sep 16, 2011, at 3:41 PM, Claudio Redi claudior...@gmail.com wrote:

 What if I have several instances running on the same machine?
 
 On Sep 16, 4:40 pm, Boris Partensky boris.parten...@gmail.com wrote:
 Use CNAME?
 
 
 
 
 
 
 
 On Fri, Sep 16, 2011 at 2:37 PM, Claudio Redi claudior...@gmail.com wrote:
 Hi,
 I'll have several applications using memcached and I want to know if
 the is a way to identify a memcached instance using a friendly text
 description.
 Something like executing a command against the instance to set/get a
 cache name or description. Otherwise I'd need to mantain a list of
 instances in a doc, obviously It can be done but I'd like to have a
 built-in alternative to this.
 Thanks!
 
 Claudio


Re: memory release problem of memcached_get

2011-09-15 Thread Brian Aker
Hi!

You should look at the manpage on memcached_get() to understand its behavior 
(and it does allocate memory and you are expected to deallocate it).

http://docs.libmemcached.org/memcached_get.html

Look at memcached_fetch_result() if you are wanting to use an interface that 
will handle the cleanup of memory allocation.

Cheers, 
-Brian

On Sep 13, 2011, at 2:04 AM, 然 安 wrote:

 memcached_get



Libmemcached Version 0.52 Released

2011-09-13 Thread Brian Aker
Hi!

Version 0.52 released.
  * Build fixes for Ubuntu/Suse.
  * Fixes for OSX Lion.
  * Bug fix for looping back through dns lookups under certain failures.
  * Fixes related to dead server failures.

http://launchpad.net/libmemcached/1.0/0.52/+download/libmemcached-0.52.tar.gz

Cheers,
-Brian


Re: libmemcached's memcached_error_t struct

2011-09-09 Thread Brian Aker
Hi!

On Sep 5, 2011, at 10:05 AM, lericson wrote:

 But there is to my knowledge no documentation of this API, and in fact the 
 author copy-pasted code from internals, so am wondering what the state of 
 this feature is?

I'll push up a doc to the docs site for memcached_last_error_message() tonight.

It retrieves the last error message generated (with host/port if appropriate).

Cheers,
-Brian

Re: Can't connect to memcached when it is restarted!

2011-08-30 Thread Brian Aker
You can modify behaviors around reconnect, look at behaviors on 
docs.libmemcached.org

Calling memcached_quit on the _St will cause a reset.


Sent from my C64

On Aug 29, 2011, at 11:33 PM, 然 安 nuanran...@yahoo.com.cn wrote:

  Hi,all:
 I use libmemcached as the client and create a memcached_st instance 
 to transfer datas. The problem is that the memcached_st instance can't 
 connect to the memcached server after the server is stopped and restarted. 
 How can I resolve this problem except restarting the client? Thank you for 
 your reply.
  
  


Re: Libmemcached 0.51 Released

2011-07-26 Thread Brian Aker
Hi!

I just upgraded to Lion on my laptop as well and hit the same issues. I believe 
I have all of them resolved now. If that is the case I'll post a .52 for Lion.

Cheers,
-Brian

On Jul 26, 2011, at 6:10 AM, lericson wrote:

 Hi Brian,
 
 I'm the author of pylibmc and I had some issues building libmemcached 0.51's 
 tests under Mac OS X 10.7 (Lion), relating to 64-bit compilation issues.
 
 What seems to be the trouble is that test_compare() is a template that 
 accepts T_comparable twice; this means the two types must match exactly. This 
 however is not the case in some places, so I took the liberty of fixing it. 
 http://pb.lericson.se/p/bkeZnR/
 
 HTH and thank you for this release,
 -Ludvig



Libmemcached 0.51 Released

2011-07-24 Thread Brian Aker
Hi!

0.51 has been released. 
  * memcached_callback_set() now takes its data argument as const
  * Update to tests.
  * Fix in parser for port number.

You can find out more about libmemcached at http://libmemcached.org
You can find a tarball here: https://launchpad.net/libmemcached/+download

Cheers,
-Brian


Re: Memcached in different regions

2011-07-04 Thread Brian Aker
Hi!

On Jul 4, 2011, at 3:41 AM, TV Ganesh wrote:

 Hi,
   I am using a set of 4 memcached servers with libmemcached. I am
 finding that when memcached gets are across regions then the latency
 increases significantly. Is there a way out of this?
 


Here is a couple of things you can try to do:

1) Use memcached_mget() operations, this will batch keys together (and this is 
signicantly faster).

2) Look at using MEMCACHED_BEHAVIOR_BUFFER_REQUESTS 
(http://docs.libmemcached.org/memcached_behavior.html), it will buffer requests 
up which will also save some lag.

We have compression as a feature in the commercial version (i.e. the version we 
just haven't merged into the public version). Its on our list to move this over 
to the public version, but I am not sure when we will get to it.

Do you have the hardware to have both a local memcached, and a remote memcached?

Cheers,
-Brian

Version 0.50 of libmemcached Released

2011-06-20 Thread Brian Aker
Hi!

The highlights:
 * Updates to C++ interface .
 * Custom free allocators need to now check for value before calling free.
 * memcached_fetch_result() now uses the internal result when available (about 
25 to 50% faster).
 * Fix for stats structure.
 * Updates to documentation.

You can find the version, additional information, here:

http://libmemcached.org/

Cheers,
-Brian

Re: where to store server list

2011-05-19 Thread Brian Aker
Hi!

On May 5, 2011, at 4:20 PM, Offspring2099 wrote:

 The problem I ran into was how to keep the server list homogeneous,
 which leads into where to store server list?  I've seen a few

If your client is based on libmemcached you can specify a file that it will 
load. Currently the only strategy is to check the file and trigger a reload 
from it, but very soon now we should have the configuration server ready to 
ship and it can be used to coordinate all of your clients.

Cheers,
-Brian

0.49 libmemcached Released

2011-04-18 Thread Brian Aker
Hi!

We have released version 0.49 of libmemcached. This version has part one of two 
of the new configuration work. You can find an example of it here:
http://docs.libmemcached.org/libmemcached_examples.html

There has been a lot of updates to the documentation, 
http://docs.libmemcached.org/, and there was a big improvement made to the code 
and we are finding that we better performance for large objects on Linux. 

Configuration now is much simpler, and is no longer different on a per language 
basis (ie once the downstream drivers pick up this version you can configure 
any language in the same manner).  There is native virtual bucket support, and 
I have a developer assigned to looking through the changes in 1.6 so that we 
can support it based on server responses. From talking to Alan (ie Dormando) he 
has some ideas on how this will work in the server, and I am excited to see 
what will happen here. 

On the microcontroller side we will be publishing a port of the micro client to 
the ARM STM32 (which follows on the work we did for the ATmega328). 

memslap has been split off into the older, very portable, version, and the less 
portable memaslap. 

There is a new error message system which first goes into this version which 
will give you a lot better info on what is going wrong if something is going 
wrong.  

The pool interface has been updated as well, which means if you don't want to 
run a proxy, you don't need to. This was an idea Trond had a couple of years 
ago, and we have updated it so that you ran reduce the complexity of your 
environments. 

Cheers,
-Brian

Memcached Tutorial in Santa Clara at the MySQL User's Conference

2011-03-30 Thread Brian Aker
Hi!

If you find yourself interested in scaling Memcached and want to know a bit 
more about scaling and working with it, Alan and I will be giving a tutorial on 
it at the MySQL User's Conference:

http://en.oreilly.com/mysql2011/public/schedule/detail/17957

Hope to see you there,
-Brian

Re: Setting and getting values

2011-03-24 Thread Brian Aker
Hi!

On Mar 22, 2011, at 4:44 AM, TV Ganesh wrote:

  rc= memcached_server_push(memc, servers);
 rc= memcached_flush(memc, 0);

There is no need to call flush here unless you mean to remove all of the data 
from the servers.

  test_true(rc == MEMCACHED_SUCCESS);
 
  rc= memcached_set(memc, key, strlen(key),
in_value, strlen(in_value),
(time_t)0, (uint32_t)0);
  test_true(rc == MEMCACHED_SUCCESS);
 
 Assertion Fails here. Should I call server_startup before this?

What is the actual error messages?  But yes, the server you are connecting to 
needs to be running before you call this.

Cheers,
-Brian

Re: Compile error with string.h

2011-03-23 Thread Brian Aker
Hi!

What header files did you require?

Cheers,
-Brian

On Mar 22, 2011, at 12:01 AM, TV Ganesh wrote:

 Hi,
   I am getting a compile error in string.h. I think the problem is
 with LIBMEMCACHED_LOCAL and the way it needs to be set using
 visibility.h.  Could any tell me if I need to use -D if I wanted to
 compile for example memcached_light.c
 
 cc -c -std=c99 -I.../libmemcached - D??
 
 Thanks
 Ganesh



Re: list command

2011-03-21 Thread Brian Aker
Hi!

On Mar 20, 2011, at 8:19 PM, Roberto Spadim wrote:

 there's a list command to return all 'keys names' in cache?

memdump --help

Cheers,
-Brian


Re: php_memcached.dll for PHP 5.3.5

2011-03-19 Thread Brian Aker
Hi!

On Mar 19, 2011, at 6:14 PM, Ren wrote:

 I don't think libmemcached has been ported to windows and/or Visual C

If you look around you will find a binary. It has been made to work several 
times, and I believe the current version will compile via mingw.

Cheers,
-Brian

0.48 Release of Libmemcached

2011-03-16 Thread Brian Aker
Hi!

Minor release:
  * Fix memory leak in server parse.
  * Move test framework out to be its own library (easier to work with Gearman).


The next version coming out will most likely be 1.0. Yes, it is hard to imagine 
but the interface will be frozen. I am going to be working on a 2.0 version 
after this is out.

Cheers,
-Brian

Re: libmemcache: memcached_behavior_number_of_replicas working?

2011-03-03 Thread Brian Aker
Hi!

On Mar 3, 2011, at 5:12 PM, Bill Moseley wrote:

 But, then when I exit the program (closing the connection) the LAST key I 
 wrote gets written to the replicant(s).

I explained this on the libmemcached mailing list but I will comment do a short 
comment on it here as well.

Libmemcached with replica set to 2 libmemcached will write to the hashed node 
and additionally to the next node in the list.

The replicated key+pair is buffered on the client, so it is not sent out 
immediately, which is why you might not see it if you immediately go looking 
(it also means that a client crash could leave you with just the not replicated 
value in the cache).

There are no lets vote to see if they both arrive and ordering could be 
thrown off to the replica under a number of different circumstances. There are 
no split brain solutions.

This is far from bullet proof, buyer beware. Frankly though? It is probably 
good enough for the vast majority of problems. If you have greater needs? Go 
use a database. 

Cheers,
-Brian





Re: libmemcache: memcached_behavior_number_of_replicas working?

2011-03-03 Thread Brian Aker
Hi!

On Mar 3, 2011, at 11:18 AM, Felipe Cerqueira wrote:

 About your question, its really wont replicate the data if fails on
 first server. You can see it on the source code of libmemcached:
 
 See: http://goo.gl/JSSro
 
 I dont like this behaivor too.

I'd take a patch to change this behavior (well, add an additional mode). Write 
up a bug at http://bugs.launchpad.net/libmemcached and I will probably get to 
it sooner then later.

Cheers,
-Brian

0.47 Released

2011-02-28 Thread Brian Aker
0.47 Wed Feb 23 18:46:48 PST 2011
  * Additional fixes for OpenBSD.
  * Bug fix 677609, 456080.
  * SIGPIPE fix for Linux send(). 
  * memcapable can now test ascii or binary based on flags.
  * Additional build fixes for SASL.


http://launchpad.net/libmemcached/1.0/0.47/+download/libmemcached-0.47.tar.gz


Version 0.46 of libmemcached Released

2011-02-15 Thread Brian Aker
Hi!

0.46 has been released.

It fixes a number of corner case bugs. It fixes related to OpenBSD. Better 
testing for protocol version. Removes special case infinite wait on blocking 
setup. This also includes support for systemtap which was added in unpublished 
0.45 release.

http://launchpad.net/libmemcached/1.0/0.46/+download/libmemcached-0.46.tar.gz

Cheers,
-Brian

Version 0.43 Release for libmemcached

2010-07-29 Thread Brian Aker
Hi!

  * Added --args to memstat so that a greater range of values can be returned.
  * Prelimanary support for Windows.
  * memcached_stat_execute() merged. 

http://download.tangent.org/libmemcached-0.43.tar.gz

Cheers,
-Brian

Re: Force memcached to write to all servers in Pool for reliability

2010-05-23 Thread Brian Aker
Hi!

On May 23, 2010, at 3:11 PM, Jay wrote:

 What is common sense to do in this case, when certain keys need to be
 stored on ALL servers for reliability

For libmemcached turn on replica, and set it to the number of hosts you have.

Cheers,
-Brian


Re: Sample C code for beginner

2010-05-19 Thread Brian Aker
Hi!

I would suggest to look at tests/mem_function.c in the source tarsal. You may 
also want to look at the code in memcpy.c 

There is also the man page libmemcached_examples

Cheers,
-Brian

On May 17, 2010, at 8:23 AM, ram wrote:

 I am an absolute beginner with memcached  libmemcached ( a perl
 programmer by profession)
 I am trying to write a simple c  code that will do the foll algorithm
 
 
 n = search_value_from_memcache(username);
 if(n) {
 increment_value_memcache(username)
 } else {
   set_value_memcache(username,1);
 }
 ---
 
 I am trying functions from
 http://docs.tangent.org/libmemcached/index.html
 
 but I couldnt functions simple enough to just get  put
 
 
 
 
 
 
 
 
 
 



Libmemcached 0.39 Released

2010-04-06 Thread Brian Aker

Hi!

http://libmemcached.org/
http://download.tangent.org/libmemcached-0.39.tar.gz

 * Add support for prefix keys to binary protocol.
 * Remove the undocumented call memcached_server_remove().
 * The undocumented call memcached_server_by_key() now returns const.
 * memcached_server_error_reset() has been deprecated.
 * memcached_server_list() has been deprecated. Use  
memcached_server_cursor() to walk the servers found in a memcached_st 
() structure.
 * memcached_verbosity() can now be run concurrently with other  
operations.

 * SASL support.
 * Fixes memory leak found in EJECT HOSTS.

A number of the changes are based on some best practices I have been  
developing while doing some consulting for sites using Memached/ 
libmemcached. If anyone wants to come find me to talk about what is  
coming up next in the library I'll be presenting a couple of talks at  
the MySQL User's Conference next week in San Jose (including a  
Memcached tutorial). I will also be giving a talk at OSCON on  
libmemcached/memcached (http://www.oscon.com/oscon2010).


Cheers,
  -Brian


--
To unsubscribe, reply using remove me as the subject.


Re: Release 0.38 of libmemcached

2010-02-12 Thread Brian Aker
Hi!

On Feb 12, 2010, at 3:10 AM, diegomsana wrote:

 Is this a libmemcached or PHP's memcached bug?

That was a macro which is now an inline. Which version of gcc is that from?

Cheers,
-Brian





Re: stats in Cache::Memcached::libmemcached giving corrupted data / crash

2009-12-15 Thread Brian Aker
Hi!

In the C library we don't have any reported bugs against that interface. I'm 
not sure what would be up with the Perl version.

Is the only thing required to set this off a call for stats on multiple hosts?

Cheers,
-Brian

On Dec 15, 2009, at 10:41 AM, Jonathan Swartz wrote:

 I'm trying to use the stats() method of Cache::Memcached::libmemcached:
 
  #!/usr/local/bin/perl
  use Data::Dumper;
  use Cache::Memcached::libmemcached;
  use strict;
  use warnings;
 
  my $cache = Cache::Memcached::libmemcached-new(
  { servers = [ 'host8:11211', 'host7:11211', ] } );
  print Dumper($cache-stats);
 
 and getting corrupted results when there is more than one server - see below. 
 The result for host 8 seems fine, the result for host7 is clearly corrupted 
 (e.g. look at 'version').
 
 Other times I get a seg fault or other kind of crash, though I can't generate 
 one right now.
 
 Is this supported? The docs say this method is still half-baked, but I 
 figured that meant that only some of the stats are reported, not corruption 
 or crashing.
 
 The crash worried me as we're about to deploy Cache::Memcached::libmemcached 
 in a large production system. I haven't seen any problems except from the 
 stats call, but it still sets off alarm bells. Is this production ready? 
 Should I be using another client like Cache::Memcached::Fast instead?
 
 Thanks
 Jon
 
 -
 
 $VAR1 = {
 'hosts' = {
  'host8:11211' = {
   'misc' = {
   'bytes' = '620653',
   'curr_connections' = 
 '13',
   'connection_structures' 
 = '29',
   'pointer_size' = '32',
   'time' = '1260901728',
   'total_items' = 
 '245026',
   'cmd_set' = '245028',
   'bytes_written' = 
 '620653',
   'evictions' = '0',
   'curr_items' = '3340',
   'pid' = '13291',
   'limit_maxbytes' = '0',
   'uptime' = '1184691',
   'rusage_user' = 
 '54.922650',
   'cmd_get' = '5936308',
   'rusage_system' = 
 '170.842028',
   'version' = '1.4.4',
   'get_hits' = '933419',
   'bytes_read' = 
 '620653',
   'threads' = '4',
   'total_connections' = 
 '10021',
   'get_misses' = 
 '5002889'
 },
   'sizes' = {
'bytes' = '0',
'curr_connections' = 
 '0',

 'connection_structures' = '0',
'pointer_size' = '0',
'time' = '0',
'total_items' = '0',
'cmd_set' = '0',
'bytes_written' = '0',
'evictions' = '0',
'curr_items' = '0',
'pid' = '0',
'limit_maxbytes' = 
 '0',
'uptime' = '0',
'rusage_user' = '0.0',
'cmd_get' = '0',
'rusage_system' = 
 '0.0',
'version' = '',
'get_hits' = '0',
'bytes_read' = '0',
'threads' = '0',
'total_connections' = 

Re: Regarding SASL

2009-10-26 Thread Brian Aker


Hi!

On Oct 27, 2009, at 12:09 AM, Dustin wrote:


As a bonus, the code already existed.  We'd talked about it a long
time ago and I built some stuff that worked then, but just got around
to cleaning it up enough to go (you can see the commits are from early


I had someone ask me about this at the conference I am at currently.  
Are you all likely to release this soon?


Cheers,
-Brian


Version 0.32 Release of Libmemcached

2009-09-16 Thread Brian Aker


Hi!

I've released the 0.32 version of libmemcached, and the highlights are:

•  Change of behavior where linger is only modified for no-block and  
then it is set to zero.

•  Added Twitter's memcached_server_error() functions.
•  Fix for OSX compiles in development builds.
•  Updated C++ interface.
•  Updated memcached_mget and memcached_mget_by_key to take a size_t  
as a parameter instead of an unsigned int for number_of_keys.


http://tangent.org/552/libmemcached.html

Cheers,
-Brian

Re: Range Spec Posted to Wiki

2009-09-16 Thread Brian Aker


Hi!

On Sep 16, 2009, at 3:22 PM, Dustin wrote:


 That's a neat idea.  Any objections to having the well-defined
protocols live there?


I think it is for the best. I believe that we will have to have  
something on the website, but for the main description we can keep  
it there.


Cheers,
-Brian


Re: web cleanup request for danga.com

2009-07-16 Thread Brian Aker


Hi!

Why not just update the wiki on code.google.com? A greater number of  
people can access/keep that up to date.


Cheers, 
-Brian

On Jul 16, 2009, at 9:53 AM, Matt Ingenthron wrote:



Based on a discussion on the IRC channel and the mailing list, it  
seems people aren't finding the release notes.  I believe (partially  
because one guy told me it was the case)  this is because the  
release notes are not linked from the danga.com/memcached/news.bml  
page


When walking around, danga.com/memcached/apis.bml also seems to  
point to only the old protocol.txt in subversion.  It's not up to  
date with the 1.4.0 release and it doesn't mention the protocol- 
binary.xml which should probably be cooked and hosted somewhere.   
Perhaps I'll do that for 1.4.0 and put it on the wiki for a  
danga.com pointer.



- Matt




Vendors, the project

2009-07-15 Thread Brian Aker


Hi!

There has been a lot recently brought up about vendor interaction with  
the project, and I wanted to add a few thoughts.


My personal take is that seeing vendors show up and offer support/ 
hardware/services is a good thing. It is a sign of both the growth and  
health of the project.


The thing about growth is that it is not always comfortable and there  
can be more the a few sore points that happen along the way.  
Personally? I'd like to find a way to have as much of this smoothed  
over as possible.


No one should be penalized for their efforts. There are a lot of hours  
spent on memcached per week, hundreds of when you consider bug  
testing, code, promotion, etc... all of this has value. There is no  
one entity for this project, it is pretty mutli-company/person (which  
I personally think adds to the value of it).


All of the growth in the project should be to the benefit of everyone.  
This really is a all boats rise in water.


So how do we get everyone participating in a manner that achieves the  
end goal, which is the promotion, adoption, spread of Memcached?


Let me throw out some material to read:

http://wiki.postgresql.org/wiki/AdvocacyGuides
http://wiki.postgresql.org/wiki/BoothCheckList

Postgres has a long history of being many vendor and when I look  
around I see them as one community we can learn from.  I suspect there  
are others as well but having a common license and a common  
distributed identity I am wondering whether we could follow their  
model (or better improve on it).


So what should be the plan? How do we encourage people and at the same  
time set a level of what is appropriate for the community at large?


On the same token, we really need to realize and accept that people  
feed their families from the use of memcached, and we shouldn't be  
creating barriers which harms this.


Cheers,
-Brian



Re: ANNOUNCE: moxi, a memcached proxy

2009-06-27 Thread Brian Aker


Hi!

For a geographical cache the proxy makes sence because latency for the  
proxy is less then that of the wan.


In house? The l1 could be significant (this is part of the reason I am  
doing the embedded work in libmemcached).


Cheers,
   --Brian

On Jun 27, 2009, at 11:17 AM, Michael Shadle mike...@gmail.com wrote:



I hate to say it but I think the words that came out of Brian or
Eric's mouth were something like ... so you don't need something like
a proxy ... when describing either gearman or memcached (and both are
conceptually the same from a scaling methodology)

There may be a usage model for this but it is fundamentally against
the point of the application's shared-nothing design. I will say
though that protocol conversion and some other things might be
interesting and useful but treating it like a traditional proxy is
basically against the point.

However, if each memcached client has its own moxi client, moxi must
have its own hashing algorithm then etc. I am wondering though how
much of the L1 cache functionality could be pushed to the application
layer instead of a middle-man to the memcached servers?

Calling this a proxy initially threw me off, reading the post a little
further it -is- a proxy but proxy makes people think what I
initially thought - something like MySQL proxy, etc...



On Jun 27, 4:25 am, steve.yen steve@gmail.com wrote:

Hi!

I saw some talk about memcached proxies on the list today, so  
figured

it'd be good to let you all know about moxi, a new open-source
memcached proxy.  Dustin Sallings, Matt Ingenthron and I have been
working on it, where moxi fits together the latest memcached  
(1.4) and

libmemcached projects.  License is BSD, and more info's at...

 http://labs.northscale.com/moxi

We needed something that spoke memcached binary protocol,  
initially on
the proxy-to-memcached side of things, and wanted something that  
could
be kept up to date with the latest memcached + libmemcached  
features.


The idea with moxi is that webapp processes and scripts connect  
to it
running at localhost:11211.  Then, moxi multiplexes traffic to a  
pool

of memcached servers.

On compatibility, moxi passes the same test suite as memcached,  
except

for the ones that don't make sense for a proxy, eg testing dash-M
command-line flags.  There are also new test cases to exercise
proxy-only features and topologies.

moxi also supports protocol conversions, so webapp processes and
scripts can still speak ascii protocol, while moxi can optionally  
use

binary protocol to speak to memcached servers.

One possibly useful optimization: moxi has a configurable front  
cache,
so it can keep a small number of hot items in moxi's memory,  
saving on

wire network hops.  In other words, an L1 cache.

Another optimization, moxi can de-deplicate concurrent GET requests
for popular keys, based on ideas from Dustin Sallings' spymemcached
client.  See:http://code.google.com/p/spymemcached/wiki/ 
Optimizations


There are more features and ideas in plan, but they're more
work-in-progress.  Appreciate any feedback, share what you want to
see, not see, etc.

Cheers,
Steve





memcached_dump() and memdump

2009-05-19 Thread Brian Aker


Hi!

I have added a new command called memcached_dump() to libmemcached. It  
takes a memcached_st and a callback function as an argument. It will  
loop through the servers and call the callback function on all of the  
keys it finds.


Because memcached does not guarantee that it will provide all keys,  
you cannot expect to get all keys.


So why add it?

I am working on a driver for Gearman and I need to shove values into  
gearman to be executed on. Now I can just push items into memcached  
and Gearman will read from its list of memcached servers and grab keys.


Gearman grabs the value from memcached and deletes the key. The  
Gearman worker just loops through the servers and constantly processes  
values.


The end result? I get a non-durable but distributed queue. This is not  
perfect but it solves my problem :)


I have also added a memdump command that will dump the key names from  
a server. It should be possible to make it do an actual dump of the  
server for some sort of partial backup but I haven't gotten to that yet.


Cheers,
-Brian



Re: Issues using memcached_get/set_by_key

2009-04-14 Thread Brian Aker


Hi!

I've applied this patch. It should be pushed within the hour.

Thanks,
-Brian

On Apr 14, 2009, at 3:50 AM, Nikhils wrote:


Hi Brian,

A careful perusal of the memcached_mget_by_key() function revealed  
the bug.


The code was generating the serverid by using the master key first.  
However if the serverid was 0, the following check was causing re- 
evaluation of the serverid by using the buffer key leading to the  
query being sent to another server:


if (master_server_key) /* if the serverid had evaluated to zero,  
we go to else */

  server_key= master_server_key;
else
  server_key= memcached_generate_hash(ptr, keys[x],  
key_length[x]);


After fixing this, the *_by_key logic appears to be working just fine.

Please find attached, a patch (diff -c format) which fixes this.

Regards,
Nikhils

On Tue, Apr 14, 2009 at 12:27 PM, Nikhils nikkh...@gmail.com wrote:
Hi,

I recently shifted to using the memcached_get/set_by_key APIs. The  
trouble is that even after warming the cache with all of the  
content, a subsequent query to fetch the key/value pair fails with a  
not found error. I am seeing this behaviour in a 2-node memcached  
cluster.


Its occurring consistently and on reverting back to using the normal  
memcached_get/set APIs, the key/value pairs can be retrieved  
appropriately! However I do need to use these by_key APIs for my  
data consistency logic.


I have added appropriate logging information in my C code (am  
linking to libmemcached 0.27) and confirmed that the master key is  
the same in both set_by_key/get_by_key calls.


Anything obvious that I am missing? Has anyone observed such dubious  
behaviour before with these by_key calls? Comments appreciated.


Regards,
Nikhils

libmemcached_mget_by_key_bug.patch


--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: Issues using memcached_get/set_by_key

2009-04-14 Thread Brian Aker


Hi!

On Apr 14, 2009, at 7:28 AM, Nikhils wrote:

Will it be possible for this patch to be backported to libmemcached  
0.26 which is what I am using?


I don't backport for any particular version normally. Any particular  
reason you can't use .28 if I release it today?


Cheers,
-Brian




Regards,
Nikhils

On Tue, Apr 14, 2009 at 7:49 PM, Brian Aker br...@tangent.org wrote:

Hi!

I've applied this patch. It should be pushed within the hour.

Thanks,
   -Brian


On Apr 14, 2009, at 3:50 AM, Nikhils wrote:

Hi Brian,

A careful perusal of the memcached_mget_by_key() function revealed  
the bug.


The code was generating the serverid by using the master key first.  
However if the serverid was 0, the following check was causing re- 
evaluation of the serverid by using the buffer key leading to the  
query being sent to another server:


   if (master_server_key) /* if the serverid had evaluated to zero,  
we go to else */

 server_key= master_server_key;
   else
 server_key= memcached_generate_hash(ptr, keys[x], key_length[x]);

After fixing this, the *_by_key logic appears to be working just fine.

Please find attached, a patch (diff -c format) which fixes this.

Regards,
Nikhils

On Tue, Apr 14, 2009 at 12:27 PM, Nikhils nikkh...@gmail.com wrote:
Hi,

I recently shifted to using the memcached_get/set_by_key APIs. The  
trouble is that even after warming the cache with all of the  
content, a subsequent query to fetch the key/value pair fails with a  
not found error. I am seeing this behaviour in a 2-node memcached  
cluster.


Its occurring consistently and on reverting back to using the normal  
memcached_get/set APIs, the key/value pairs can be retrieved  
appropriately! However I do need to use these by_key APIs for my  
data consistency logic.


I have added appropriate logging information in my C code (am  
linking to libmemcached 0.27) and confirmed that the master key is  
the same in both set_by_key/get_by_key calls.


Anything obvious that I am missing? Has anyone observed such dubious  
behaviour before with these by_key calls? Comments appreciated.


Regards,
Nikhils

libmemcached_mget_by_key_bug.patch

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.






--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: Issues using memcached_get/set_by_key

2009-04-14 Thread Brian Aker


Hi!

On Apr 14, 2009, at 7:36 AM, Nikhils wrote:

No specific reason other than that we have done bulk of the testing  
of our code with 0.26 version...


I would apply this patch to your version. Trond noticed that you were  
overflowing the master key value:

http://paste2.org/p/183969

Cheers,
-Brian




Regards,
Nikhils



Cheers,
   -Brian




Regards,
Nikhils

On Tue, Apr 14, 2009 at 7:49 PM, Brian Aker br...@tangent.org wrote:

Hi!

I've applied this patch. It should be pushed within the hour.

Thanks,
  -Brian


On Apr 14, 2009, at 3:50 AM, Nikhils wrote:

Hi Brian,

A careful perusal of the memcached_mget_by_key() function revealed  
the bug.


The code was generating the serverid by using the master key first.  
However if the serverid was 0, the following check was causing re- 
evaluation of the serverid by using the buffer key leading to the  
query being sent to another server:


  if (master_server_key) /* if the serverid had evaluated to zero,  
we go to else */

server_key= master_server_key;
  else
server_key= memcached_generate_hash(ptr, keys[x], key_length[x]);

After fixing this, the *_by_key logic appears to be working just fine.

Please find attached, a patch (diff -c format) which fixes this.

Regards,
Nikhils

On Tue, Apr 14, 2009 at 12:27 PM, Nikhils nikkh...@gmail.com wrote:
Hi,

I recently shifted to using the memcached_get/set_by_key APIs. The  
trouble is that even after warming the cache with all of the  
content, a subsequent query to fetch the key/value pair fails with a  
not found error. I am seeing this behaviour in a 2-node memcached  
cluster.


Its occurring consistently and on reverting back to using the normal  
memcached_get/set APIs, the key/value pairs can be retrieved  
appropriately! However I do need to use these by_key APIs for my  
data consistency logic.


I have added appropriate logging information in my C code (am  
linking to libmemcached 0.27) and confirmed that the master key is  
the same in both set_by_key/get_by_key calls.


Anything obvious that I am missing? Has anyone observed such dubious  
behaviour before with these by_key calls? Comments appreciated.


Regards,
Nikhils

libmemcached_mget_by_key_bug.patch

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.






--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: announce: memcached-prefix

2009-04-13 Thread Brian Aker


Hi!

Dustin and I were talking about adding this sort of command as an  
option to the protocol description for Memcached. If we could come up  
with a standard, I would love to add it to libmemcached.


Cheers,
-Brian

On Apr 13, 2009, at 9:26 PM, Mike Panchenko wrote:

Interesting... have you tested it with multiple clients? Do you  
think there's any reason to believe that more clients would cause  
degradation?


Have you considered making this an option? I'm assuming the most  
common response to this will be Memcached works very well for what  
it was designed. Don't mess with that.


Mike.

On Mon, Apr 13, 2009 at 9:10 PM, Josh Dybnis jdyb...@gmail.com  
wrote:


memcached-prefix is an experimental fork off of the memcached 1.3
development branch. It adds commands pget and pdelete that operate on
ranges of keys having a common prefix. The new commands can be used as
a simple namespace mechanism. It also adds a memcachedb compatible
rget command.

Performance is very close to the standard memcached (see the
benchmarks on the project page). Space usage is also roughly
unchanged.

Project page: http://jdybnis.github.com/memcached/





--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: Watch variable Proposal

2009-02-16 Thread Brian Aker


Hi!

On Feb 16, 2009, at 1:24 AM, luka8088 wrote:


make ajax request hang in background until someone writes something...
or, until some variable changes, in this case a loop getting a same



Have you looked at Gearman? What you are describing could be  
implemented as a worker I suspect.


Cheers,
-Brian

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: Killed by SIGPIPE using Memcached::libmemcached

2009-01-29 Thread Brian Aker


Hi!

On Jan 29, 2009, at 1:48 AM, Trond Norbye wrote:

Personally I don't think the library should install a signal  
handler, because you as a developer might want to trap SIGPIPE


We have been asking ourselves this question, aka Should we optionally  
add one?. I would love to get some more feedback on this.


Cheers,
-Brian

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: New PHP extension for Memcached

2009-01-29 Thread Brian Aker


There are a couple of in-house ones I know of as well :)

On Jan 29, 2009, at 11:57 AM, pcdinh wrote:



Andrei Zmievski, one of key men behind Unicode support in PHP6 has
released a new PHP extension for interfacing with memcached via
libmemcached library

Check it out at http://pecl.php.net/package/memcached

To my best knowledge, there are 3 PHP extensions that are based on
libmemcached so far


--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: a question about memcached

2008-11-11 Thread Brian Aker


Hi!

On Nov 12, 2008, at 5:49 AM, Matt Erkkila wrote:

So the SQL would look something like: UPDATE users SET password =  
('somepass') EXPIRE memcachekey1, memcachekey2


You can use the memcached UDF's for MySQL to do the same operation.  
You don't need to rewire the parser to get this sort of behavior.


Cheers,
-Brian

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: a question about memcached

2008-11-11 Thread Brian Aker


Hi!

On Nov 12, 2008, at 8:33 AM, Lei Gao wrote:

Thanks for your update. Let's see if I want those UDF's to be  
invoked in my slave db when receiving data changes from the master  
db, would I have to invoke those functions within a trigger?


That is one way to do it. Personally I favor embedding the udf either  
in the query itself, or in using a multi-sql issued set and having the  
UDF run against a null table (aka blackhole).


I was looking at the UDF's for mysql but could not find any function  
for invalidating memcached entries. Does it mean one can only delete/ 
update existing entries with mysql UDF's?



Invalidation is just deleting the object in the cache. As soon as a  
cache miss occurs your application should then just repopulate the  
cache.


Cheers,
-Brian

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





Re: Generic protocol for message queues

2008-11-07 Thread Brian Aker


Hi!

Just something else to throw into the equation:
http://gearmanproject.org/doku.php?id=protocol

This is the protocol as outlined by Gearman. A few of us are reworking  
it at the moment, but keeping backwards compatibility with the current  
version.


Cheers,
-Brian

On Nov 8, 2008, at 12:38 PM, Aaron Stone wrote:



Heh, nice blog post :-)

I agree that the queues that are out there and using hacked up
memcache protocols are doing us a great disservice -- I think if we
build a smart way to do a message queue into a binary protocol
extension, we can drive minds in the right direction, and provide
ourselves with something useful in the process.

Also, it would help us to slow down the rate of splinter projects.
Pluggable storage engines and message queues are I think the only
areas where the memcached-alikes play.

Aaron


On Thu, Nov 6, 2008 at 1:21 PM, Dustin [EMAIL PROTECTED] wrote:



On Nov 6, 12:48 pm, Aaron Stone [EMAIL PROTECTED] wrote:

Have a mailing list link? It'd be good to continue with where you  
left

off / review what you were thinking at the time.


I wrote about it on my embarrassingly tongue-in-cheek titled blog:

http://www.rockstarprogrammer.org/post/2008/oct/04/what-matters-asynchronous-job-queue/


--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.





0.23 Released of libmemcached

2008-09-07 Thread Brian Aker


Hi!

I've released 0.23 of libmemcached:
http://tangent.org/620/libmemcached_0%2E23_%28default%29.html

The big changes:
1) Support for the binary protocol
2) Weighted support for Ketama

Cheers,
-Brian

--
___
Brian Krow Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ -- Me
http://tangent.org/-- Software
___
You can't grep a dead tree.