Does -k lock more memory that what I specified in -m ?

2010-04-06 Thread Weijun Li
Hello everyone,

I started memcached with:

memcached -u root -k -d -m 4000 -v >>m.log 2>&1

and after I inserted tens of millions of keys, the "top" command shows
that the "RES" memory of memcached is about 5.5GB which is much more
than what I specified with "-m". I think "RES" is the amount of what
memcached has locked because this number kept increasing when I was
inserting keys. So is this desired behavior of memcached? Should
memcached obey to the "-m" memory limit when you turned on memory
lock?

Thanks,

-Weijun


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


Re: Issue 129 in memcached: start-memcached needs to call setsid()

2010-04-06 Thread memcached


Comment #3 on issue 129 by techadvise: start-memcached needs to call  
setsid()

http://code.google.com/p/memcached/issues/detail?id=129

Forgive me if I'm missing something obvious, but I don't see any setsid()  
references
here:  
http://github.com/memcached/memcached/blob/master/scripts/start-memcached -  
as
a matter of fact, that's pretty much the exact script I have in my 1.2.2  
deb.


Was it fixed in the memcached daemon?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


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


Re: pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread Ren


On 6 Apr, 20:13, Stephen Johnston 
wrote:
> Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13 in an
> NTS version for WIndows?
>
> Stephen Johnston

I don't think there is one.

I suspect libmemcached has to be ported to MSVC first.

Jared


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


Re: Issue 129 in memcached: start-memcached needs to call setsid()

2010-04-06 Thread memcached

Updates:
Status: Invalid

Comment #2 on issue 129 by dsallings: start-memcached needs to call setsid()
http://code.google.com/p/memcached/issues/detail?id=129

(No comment was entered for this change.)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


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


Re: PHP and persistent connections

2010-04-06 Thread Ren

Yes..

addServer('127.0.0.1', 11211);

$m2 = new MemCached('Pool');
$m2->addServer('127.0.0.1', 11211);

var_dump($m2->getServerList());
?>

Will output

array(2) {
  [0]=>
  array(3) {
["host"]=>
string(9) "127.0.0.1"
["port"]=>
int(11211)
["weight"]=>
int(0)
  }
  [1]=>
  array(3) {
["host"]=>
string(9) "127.0.0.1"
["port"]=>
int(11211)
["weight"]=>
int(0)
  }
}

Which is probably not what is intended.


Wrapping the 2nd call to addServer...

if ($m2->isPristine())
{
$m2->addServer('127.0.0.1', 11211);
}

Will output

array(1) {
  [0]=>
  array(3) {
["host"]=>
string(9) "127.0.0.1"
["port"]=>
int(11211)
["weight"]=>
int(0)
  }
}

Jared


On Apr 6, 10:37 pm, Jay Paroline  wrote:
> The singleton isn't shared across processes though.
> We also use a singleton, but the constructor still gets called once
> for each process that gets fired up.
>
> If we are using connection pooling, do we need to worry about multiple
> PHP processes adding servers?
>
> Jay
>
> On Apr 6, 5:06 pm, Brian Moon  wrote:
>
>
>
> > >> Just give a string parameter to the memcached constructor , any class
> > >> instance with the same string as parameter should use the same
> > >> connection.
>
> > >> /tyn
>
> > > Yeah, only thing to watch out for is not to add the servers more than
> > > once.
>
> > We use a singleton to avoid this. We pass in the "config" we want. it is
> > loaded and the singleton created.
>
> > Brian.


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


Re: Issue 129 in memcached: start-memcached needs to call setsid()

2010-04-06 Thread memcached


Comment #1 on issue 129 by lindner.profile: start-memcached needs to call  
setsid()

http://code.google.com/p/memcached/issues/detail?id=129

this has been fixed in later versions of memcached 1.2.2 is ancient history.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


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


Issue 129 in memcached: start-memcached needs to call setsid()

2010-04-06 Thread memcached

Status: New
Owner: 
Labels: Type-Defect Priority-Medium

New issue 129 by techadvise: start-memcached needs to call setsid()
http://code.google.com/p/memcached/issues/detail?id=129

What steps will reproduce the problem?
1.  Start a memcached with the included start-memcached perl script from a
real tty.
2.  Log out, note the processes stay there.
3.  From ssh, or another tty, kill the tty that you called start-memcached
from.
4.  Note that your memcached processes are dead and gone.

What is the expected output? What do you see instead?
Expected to see processes still there, there were none instead.


What version of the product are you using? On what operating system?
1.2.2-1+lenny1build0 on Ubuntu Jaunty (9.04)


Please provide any additional information below.
Here's the diff to a patch that fixes the issue.  It makes sure posix is
present before calling setsid()

--- a/start-memcached   2010-04-06 22:17:52.0 +
+++ b/start-memcached   2010-04-06 22:26:50.0 +
@@ -106,6 +106,8 @@
 if($pid == 0)
 {
reopen_logfile($fd_reopened);
+   eval "use POSIX qw(setsid)";
+   setsid() unless $@;
exec "$memcached $params";
exit(0);



--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


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


Re: PHP and persistent connections

2010-04-06 Thread Jay Paroline
The singleton isn't shared across processes though.
We also use a singleton, but the constructor still gets called once
for each process that gets fired up.

If we are using connection pooling, do we need to worry about multiple
PHP processes adding servers?

Jay

On Apr 6, 5:06 pm, Brian Moon  wrote:
> >> Just give a string parameter to the memcached constructor , any class
> >> instance with the same string as parameter should use the same
> >> connection.
>
> >> /tyn
>
> > Yeah, only thing to watch out for is not to add the servers more than
> > once.
>
> We use a singleton to avoid this. We pass in the "config" we want. it is
> loaded and the singleton created.
>
> Brian.


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


Re: pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread Stephen Johnston
I take that back. The version I have there shows version 2.2.5 in php_info()
so that is most likely pecl-memcache. I will try the one in your package.

Stephen Johnston

On Tue, Apr 6, 2010 at 5:34 PM, Stephen Johnston <
stephen.johns...@guildlaunch.com> wrote:

> I also have another source, but I can't verify that it is pecl-memcached
> and not pecl-memcache and since the consensus is to go with pecl-memcached
> the distinction is important.
>
> Stephen Johnston
>   On Tue, Apr 6, 2010 at 3:24 PM, Svemir Brkic 
> wrote:
>
>>  Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13
>>> in an NTS version for WIndows?
>>>
>>
>>  I only got this, but it is a minor version change so it might still
>> work. There is a bunch of extensions in there, including memcached:
>>
>> http://museum.php.net/php5/pecl-5.2.6-nts-Win32.zip
>>
>> Svemir
>> http://www.deveblog.com/
>>
>>
>> --
>> To unsubscribe, reply using "remove me" as the subject.
>>
>
>


Re: pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread Stephen Johnston
I also have another source, but I can't verify that it is pecl-memcached and
not pecl-memcache and since the consensus is to go with pecl-memcached the
distinction is important.

Stephen Johnston
On Tue, Apr 6, 2010 at 3:24 PM, Svemir Brkic wrote:

>  Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13
>> in an NTS version for WIndows?
>>
>
>  I only got this, but it is a minor version change so it might still
> work. There is a bunch of extensions in there, including memcached:
>
> http://museum.php.net/php5/pecl-5.2.6-nts-Win32.zip
>
> Svemir
> http://www.deveblog.com/
>
>
> --
> To unsubscribe, reply using "remove me" as the subject.
>


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: pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread Svemir Brkic

Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13
in an NTS version for WIndows?


I only got this, but it is a minor version change so it might still
work. There is a bunch of extensions in there, including memcached:

http://museum.php.net/php5/pecl-5.2.6-nts-Win32.zip

Svemir
http://www.deveblog.com/


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


Re: pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread svemir
> Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13 in an
> NTS version for WIndows?

I only got this, but it is a minor version change so it might still
work. There is a bunch of extensions in there, including memcached:

http://museum.php.net/php5/pecl-5.2.6-nts-Win32.zip

Svemir
http://www.deveblog.com/


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


Re: PHP and persistent connections

2010-04-06 Thread Brian Moon

Just give a string parameter to the memcached constructor , any class
instance with the same string as parameter should use the same
connection.

/tyn


Yeah, only thing to watch out for is not to add the servers more than
once.


We use a singleton to avoid this. We pass in the "config" we want. it is 
loaded and the singleton created.


Brian.


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


Re: PHP and persistent connections

2010-04-06 Thread Ren


On Apr 6, 7:11 pm, Tuyan  wrote:
> Hi,
>
> On Apr 6, 2:38 pm, Jay Paroline  wrote:> Currently we 
> are (still) stuck using the PECL memcache extension, but
> > hopefully soon we will be moving to the libmemcached based PECL
> > memcached extension. I am trying to figure out if there is any way to
> > set it up to use persistent/shared connections.
>
> > Unfortunately I haven't been able to find any info about this in the
> > memcached extension. Can anyone shed some light on whether this is
> > possible and if so, how?
>
> Just give a string parameter to the memcached constructor , any class
> instance with the same string as parameter should use the same
> connection.
>
> /tyn

Yeah, only thing to watch out for is not to add the servers more than
once.

$memCached = new MemCached('MyApp');
if ($memCached->isPristine())
{
$memCached->addServer(...);
...
}

Jared



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


Re: PHP and persistent connections

2010-04-06 Thread Tuyan
Hi,

On Apr 6, 2:38 pm, Jay Paroline  wrote:
> Currently we are (still) stuck using the PECL memcache extension, but
> hopefully soon we will be moving to the libmemcached based PECL
> memcached extension. I am trying to figure out if there is any way to
> set it up to use persistent/shared connections.
>
> Unfortunately I haven't been able to find any info about this in the
> memcached extension. Can anyone shed some light on whether this is
> possible and if so, how?
>
Just give a string parameter to the memcached constructor , any class
instance with the same string as parameter should use the same
connection.

/tyn


pecl-memcached php 5.2.13 Windows NTS

2010-04-06 Thread Stephen Johnston
Anyone know where I can find a binary of PECL-memcached for PHP 5.2.13 in an
NTS version for WIndows?

Stephen Johnston


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


PHP and persistent connections

2010-04-06 Thread Jay Paroline
Currently we are (still) stuck using the PECL memcache extension, but
hopefully soon we will be moving to the libmemcached based PECL
memcached extension. I am trying to figure out if there is any way to
set it up to use persistent/shared connections.

Currently every apache/PHP process ends up with its own connection to
every memcached bucket. We had to up the ephemeral port range because
we were actually running out. During peak times, we still come up
short. Rather than trying to squeeze out more ephemeral ports or mess
with TIME_WAIT settings, it would be nice if the connections could
just be pooled.

Unfortunately I haven't been able to find any info about this in the
memcached extension. Can anyone shed some light on whether this is
possible and if so, how?

Thanks,

Jay


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


Re: Memcached release 1.4.5

2010-04-06 Thread Paul Lindner
memcache-1.4.5 now available in updates-testing for Fedora 12 and 13.
 Please test it out and add karma points below:

https://admin.fedoraproject.org/updates/memcached-1.4.5-1.fc13
https://admin.fedoraproject.org/updates/memcached-1.4.5-1.fc12


Once we have
feedback these builds will be moved to the normal updates repo.


On Sat, Apr 3, 2010 at 2:42 PM, dormando  wrote:

> Hey,
>
> The team is happy to belatedly announce memcached 1.4.5. We're skipping
> the -rc routine since this release is very late and contains only minor
> bugfixes and one new statistic.
>
> http://code.google.com/p/memcached/wiki/ReleaseNotes145
>
> We will very shortly begin a long -rc cycle with 1.4.6, and are
> stabilizing 1.6.0 for release. More of the rest of the open bugs will be
> closed out for 1.4.6.
>
> A number of us will be at MySQLConf (http://en.oreilly.com/mysql2010/)
> next week. Speaking, dotorg-boothing, or getting drunk in the lobby. Come
> say hi if you're brave enough.
>
> -Dormando
>
>
> --
> To unsubscribe, reply using "remove me" as the subject.
>


Re: Am I writing to Memcached too fast?

2010-04-06 Thread PP Bas
Thanks for replying, here's the reason we are trying to do it,
hopefully that would give some more context.

We are running a game site where users compete to answer questions
within the allotted time, certain conditions can cause this timer to
change.

Our original setup was kinda dumb, we had each browser keep polling
this "status.php" every second and a huge chunk of status.php is
already cached in MC, but apache was dying because we keep on hitting
maxConnection on apache.  So our new idea is to have a daemon that
writes the current state of the world (which was status.php) and just
write that to MC so that nginx can serve status directly from MC.

So our daemon does this:

$expireTime = time() + ($config['App']['cronTime'] * 60);

while (time() < $expireTime) {

  $live_games = cacheRead('cache_live_games');

  // Loop through all games that needs to be written to MC
  foreach($live_auctions as $value){

//do some work

//One of the values that go in there:
$results['Game']['end_time_s']   = getStringTime($result['Game']
['end_time']);

$memcache->set("/game_".$value.".json", $json->convert($results));
  }
  usleep(25);
}

Then the browser would just have a script that reads http://www/game_.json
every second and updates the page.

So we have checked latency through firebug and we see that the calls
were all ~200ms, the writes of the entire loop takes only ~100ms or
so.  So We really don't know why the browser timer keeps skipping
(meaning that it read two values from MC having the same Time
stamp)...

Thanks again for helping!


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


Re: Am I writing to Memcached too fast?

2010-04-06 Thread Adam Lee
Yeah, I'm having a bit of trouble wrapping my head around what exactly
it is you're trying to accomplish-- it really sounds like your
solution is significantly more complex than your problem...  perhaps
if you described the actual functionality you're trying to implement,
we'd have a better chance of suggesting something.

-- 
awl


Re: Am I writing to Memcached too fast?

2010-04-06 Thread Guille -bisho-
Why are you writting on MC for that?

if it's a timer diff against a certain date, just store in MC this:


var d = new Date();
document.write(finalTime - d.getTime()/1000)


That will be the seconds pending for the finalTime. replace finalTime
with the unix timestamp of your choice.

Or even better, avoid the browser having to fetch the counter each
second. Probably that's your problem right now (network latency could
be greater than 1 sec), and just calculate the counter changes in
javascript!!!

Definitely this is not the use case for memcache...

-- 
Guille -ℬḭṩḩø- 
:wq


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


Re: Am I writing to Memcached too fast?

2010-04-06 Thread Brian Moon
That seems like a lot of trouble to put a timer on a web page. There are 
so many moving parts in the system you just described, I am not even 
sure where to start.



Brian.

http://brian.moonspot.net/

On 4/5/10 8:29 PM, PP Bas wrote:

Here is what we have setup:

  - nginx frontend that serves from Memcached directly.
  - A daemon (written in PHP) that gets called every minute, in the 1
minute, the daemon loops around 3 times and writes to memcached for 7
"items" with an updated timer.
  - When our user visits the website, it querys the server, which
serves from the cache every second and updates the timer on the
screen.

The problem we are seeing is that the website shows the timer skipping
a few seconds pretty often, what seems to be going on is that the
website script is reading two values being the same from the cache in
the span of 2 seconds, my question is if I am writing that often, how
can the website be reading "stale" data? Am I writing too fast?

BTW, the buffered I/O option is set to off on the PHP library already.

Thanks!





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