does memcached work on windows 7

2010-02-12 Thread tvinod
im trying to run memcached on my windows 7 machine within a rails
project and it errors out..

936 connection closed.
940 new client connection
940 set mem-development:c222efbcfc08b4850198cd1eea610f76 0 0 217
940 STORED
Failed to write, and not due to blocking: Resource temporarily
unavailable
940 connection closed.

the same rails project works perfectly fine on vista and linux. i saw
somewhere it could be due to firewall issue. but i checked to make
sure memcached is allowed in windows firewall.

any ideas?

thanks


Re: Memcached and EC2

2010-02-12 Thread Henrik Schröder
On Fri, Feb 12, 2010 at 01:26, Brian Moon br...@moonspot.net wrote:

 Slightly related: Is there any way to get persistent connections for
 memcached in PHP? There's no real static variables in it, but there
 seems to be something for mysql that attaches connections to the parent
 apache process, is there something similar for memcached? Or are you
 just permanently screwed and have to re-initialize everything each
 pageview? I tried googling for it, but I only get... unhelpful... results.


 http://us2.php.net/manual/en/memcached.construct.php

 or

 http://us3.php.net/manual/en/function.memcache-addserver.php

 depending on your library.


Thanks, but how does that work exactly?

I've been trying to find information about it, and what I've pieced together
so far is that if you are running PHP as an Apache module, and if you are
making your own extension in C, then you get access to methods that allow
you to store stuff in some sort of shared memory in the Apache process, that
you can retrieve between pageviews, such as socket handles or initialized
arrays or similar. But there's nothing in the PHP language itself to do
something like that, you have to make your own C module. Correct?

And that then, in turn, means that the answer to the original question is
that adding more servers doesn't slow down the app, if they're using
persistent connections, because client initialization will only happen once?
(Given the prerequsities above, and given that they actually make sure they
only init once like a comment on that memcached manual page describes)

And is this true for both PHP clients?


/Henrik


Re: Memcached and EC2

2010-02-12 Thread dormando
 Thanks, but how does that work exactly?

 I've been trying to find information about it, and what I've pieced together 
 so far is that if you are running PHP as an Apache module, and if you are 
 making your own extension in C, then you get access to
 methods that allow you to store stuff in some sort of shared memory in the 
 Apache process, that you can retrieve between pageviews, such as socket 
 handles or initialized arrays or similar. But there's
 nothing in the PHP language itself to do something like that, you have to 
 make your own C module. Correct?

Yeah. special PHP mumbo jumbo.

 And that then, in turn, means that the answer to the original question is 
 that adding more servers doesn't slow down the app, if they're using 
 persistent connections, because client initialization will
 only happen once? (Given the prerequsities above, and given that they 
 actually make sure they only init once like a comment on that memcached 
 manual page describes)

 And is this true for both PHP clients?

I recall a thread a while back that the ketama/consistent hashing stuff
with the old library redid all of the calculations on every request
regardless of persistent settings.

Don't recall if that was ever fixed or properly tested, but the
complaining user had his performance problems go away when he stopped
using that.

I assume pecl/memcached isn't quite that stupid, but someone might want to
verify for PHP's sake.

-Dormando


Re: does memcached work on windows 7

2010-02-12 Thread Matt Ingenthron

tvinod wrote:

im trying to run memcached on my windows 7 machine within a rails
project and it errors out..

936 connection closed.
940 new client connection
940 set mem-development:c222efbcfc08b4850198cd1eea610f76 0 0 217
  

940 STORED


Failed to write, and not due to blocking: Resource temporarily
unavailable
940 connection closed.
  


Which release are you running on Windows, and did you build it yourself 
or did you get binaries?  What was the source?


I looked through the code briefly; the only places where that may pop up 
is where memcached tries to write to the socket and gets an error back 
from the OS.  The error handling in the current code appears to print 
more information out, so I suspect you have an older build.

the same rails project works perfectly fine on vista and linux. i saw
somewhere it could be due to firewall issue. but i checked to make
sure memcached is allowed in windows firewall.


Yes, that is listed in older memcached issues, but I know of a couple of 
folks who have tried recent code on Windows 7 without seeing this 
issue.  There could well be some firewall (from Windows or some other 
utility) causing an issue.  If you can confirm it's something recent, 
maybe there is a way to get more info.  One way would be with a 
debugger, but it may also just make sense to get you a binary with some 
more diagnostics.


Regards,

- Matt


Re: does memcached work on windows 7

2010-02-12 Thread Henrik Schröder
Which version of memcached are you using? I seem to remember that those
error messages are typical of older memcached versions on windows. I'm
running 1.2.5 and I have never encountered that error.

Oh look, here's me getting that problem and solving it, perhaps that helps:
http://groups.google.com/group/memcached/browse_thread/thread/9a90d63f5f164fcf/7f10b2d6e65a5656?pli=1

I'm still running 1.2.5 though and I don't have the problem, you can grab a
binary here: http://code.google.com/p/beitmemcached/

I was gonna recommend 1.2.6 that you can get here:
http://code.jellycan.com/memcached/, but I just tested it and remembered why
I wasn't running it, it has a dependency to MSVCR71.DLL for some weird
reason, 1.2.5 doesn't have that.

You also have this guy who started seeing the problem after installing some
firewall:
http://groups.google.com/group/memcached/browse_thread/thread/8ffab363145ed61e


/Henrik

On Fri, Feb 12, 2010 at 10:02, tvinod tvi...@gmail.com wrote:

 im trying to run memcached on my windows 7 machine within a rails
 project and it errors out..

 936 connection closed.
 940 new client connection
 940 set mem-development:c222efbcfc08b4850198cd1eea610f76 0 0 217
 940 STORED
 Failed to write, and not due to blocking: Resource temporarily
 unavailable
 940 connection closed.

 the same rails project works perfectly fine on vista and linux. i saw
 somewhere it could be due to firewall issue. but i checked to make
 sure memcached is allowed in windows firewall.

 any ideas?

 thanks



Re: Release 0.38 of libmemcached

2010-02-12 Thread diegomsana
Looking good. However, i couldn't get it working with PHP's memcached
module on Centos 5.4/php 5.3.1

After updating to 0.38 and restarting apache, i got this error PHP
Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/
modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined
symbol: memcached_result_value in Unknown on line 0

Tried to recompile memcached module and got more errors. So i reverted
back to 0.37 and it's all fine.

Is this a libmemcached or PHP's memcached bug?

On 11 fev, 15:23, Brian Aker br...@tangent.org wrote:
 Hi!

 From the changelog:

 * C++ interface for libhashkit.
 * Modified memcached_set_memory_allocators() so that it requires a context 
 pointer.
 * memcached_clone() now runs 5 times faster.
 * Functions used for callbacks are now given const memcached_st.
 * Added MEMCACHED_BEHAVIOR_CORK.
 * memslap now creates a configuration file at ~/.memslap.cnf
 * memcached_purge() now calls any callbacks registered during get execution.
 * Many fixes to memslap.
 * Updates for memcapable.
 * Compile fixes for OpenBSD.
 * Fix for possible recursive decent on IO failure.

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

 Cheers,
         -Brian


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