Re: Regarding setting up SASL with memcached server and getting a memcached client to associate with server.

2018-05-02 Thread dormando
Hey,

Please interpret this with kindness: if you're struggling getting sasl to
work, getting asynchronous TLS to work, be performant enough, and not
buggy, while also forking the project, is going to be a very very bad idea
for you.

If you're willing to put the effort into figuring out TLS into memcached,
you're better off reading the cyrus source code to figure out how password
databases work. Read the SASL protocol spec (it's not too bad).

I see you spending a huge amount of time trying to work around the bugs
you encounter; instead of going around, go through them. Get the password
file to work the way you want it to.

On Wed, 2 May 2018, Om Kale wrote:

> Hi Dormando,Thanks for your reply. Yes, that works. Also, one more thing that 
> I was
> curious to know or rather want to add to memcached.
> Is there anyway I can go ahead and modify memcached itself to support SSL/TLS 
> (using
> certificates) without using this third-party cyrus plugin/libsasl2?
> If yes, where the memcached code need to be added for this. Basically, I want 
> to know
> where exactly in the memcached code does the client connect to server and do 
> the SASL
> protocol negotiation/exchanges)
> I was thinking of adding a way in which memcached would be able to support
> authentication depending on whatever ssl library the user wants to use. (not 
> restrict it
> to cyrus-sasl or libsasl2)
>
>
> Thanks and Regards,Om Kale
>
>
> On Mon, Apr 30, 2018 at 1:50 PM, dormando  wrote:
>   Hey,
>
>   The passwd needs to be created with saslpasswd for most of the other 
> auth
>   types to work, otherwise you'll have to do it manually and I have no 
> idea
>   how to do that. IE; the saslpasswd files I created when trying to
>   reproduce your method worked fine with DIGEST-MD5 as well.
>
>   On Mon, 30 Apr 2018, Om Kale wrote:
>
>   > Hi All,I am trying to get my head around making memcached work with 
> SASL
>   support. The PLAIN auth is working but still running into issues for
>   > DIGEST-MD5. 
>   > I have changed my memcached client side code to enable MD5 as 
> follows. I
>   have enabled the behavior to support MD5 and then passed the MD5
>   >
>   > /*
>   >  * Test that libmemcached is built with SASL support.
>   >  */
>   > #include 
>   > #include 
>   > #include 
>   > #include 
>   > #include 
>   >
>   > const char* key = "abc";
>   > const char* value = "value";
>   >
>   > // test basic get/set operation works.
>   > void test_getset(memcached_st* cache)
>   > {
>   >   char* r_value;
>   >   uint32_t flags = 0;
>   >   uint32_t r_flags = 0;
>   >   size_t val_length;
>   >   memcached_return_t rc;
>   >
>   >
>   >   rc = memcached_set(cache, key, strlen(key), value, strlen(value),
>   (time_t)0, flags);
>   >   if (rc == MEMCACHED_TIMEOUT) {
>   >     fprintf(stderr, "Set timeout\n");
>   >     return;
>   >   } else if (rc != MEMCACHED_SUCCESS) {
>   >     fprintf(stderr, "Set failed: %s\n", memcached_strerror(cache, 
> rc));
>   >     return;
>   >   }
>   >
>   >   r_value = memcached_get(cache, key, strlen(key), _length, 
> _flags,
>   );
>   >   if (rc == MEMCACHED_TIMEOUT) {
>   >     fprintf(stderr, "Get timeout\n");
>   >     return;
>   >   } else if (rc != MEMCACHED_SUCCESS) {
>   >     fprintf(stderr, "Get failed: %s\n", memcached_strerror(cache, 
> rc));
>   >     return;
>   >   }
>   >
>   >   if (strcmp(value, r_value) != 0) {
>   >     fprintf(stderr, "Get returned bad value! (%s != %s)!\n", value,
>   r_value);
>   >   }
>   >
>   >   if (r_flags != flags) {
>   >     fprintf(stderr, "Get returned bad flags! (%u != %u)!\n", flags,
>   r_flags);
>   >   }
>   >
>   >   fprintf(stdout, "Get/Set success!\n");
>   > }
>   >
>   > // connect with SASL.
>   > void authTest(const char* user, const char* pass, const char* server)
>   > {
>   >   memcached_server_st *servers = NULL;
>   >   memcached_return_t rc;
>   >   memcached_st *cache;
>   >   uint32_t hashVal;
>   >   uint32_t hashPass;
>   >   uint32_t hash;
>   >   uint64_t behavior = 0;
>   >
>   >
>   >   cache = memcached_create(NULL);
>   > //  uint32_t hashusername = memcached_generate_hash(cache, user,
>   strlen(user));
>   >   //hash = memcached_generate_hash(cache, user, strlen(user));
>   >   //printf ("Hash value is: %" PRIu32 "\n", hash);
>   >
>   > //  hashVal = memcached_generate_hash_value(user, strlen(user),
>   MEMCACHED_HASH_MD5);
>   > //  printf ("Hash value is: %" PRIu32 "\n", hashVal);
>   >
>   > //  hashPass = memcached_generate_hash_value(pass, strlen(pass),
>   MEMCACHED_HASH_MD5);
>   > //  printf ("Hash value is: %" PRIu32 "\n", hashPass);
>  

Benchmark projects for memcached

2018-05-02 Thread Arie Aharon
Hi there,

I am trying to do some CPU and memory utilization analysis for memcached.
Is there any good benchmark to stress memcached with a pre defined memory 
limit and a number of threads?

-- 

--- 
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.