kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] dw_dev2009-06-07 01:04 pm
Entry tags:

memcache on a dreamhack?

Does anyone have any tips for getting memcache to work on a dreamhack?

The instructions on the wiki assume you have root and can use apt-get.

Thanks in advance!
exor674: Computer Science is my girlfriend (Default)

[personal profile] exor674 2009-06-07 07:37 pm (UTC)(link)
You probably need to work with [personal profile] sophie, as she'll need to assign you a port your memcached can work on and stuff.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-06-09 01:15 pm (UTC)(link)
So, as you know, we got you sorted for this. For anyone else who wants to use memcache on their Dreamhack:

* Let me or Fu (depending on whose box you're on) know, first, so you can be assigned a port that you can use for memcached.

* You'll then want to run memcached in a screen session, as it runs in the foreground. The command you want to run in screen is:

memcached -p <port>

where <port> is the port number you were given.

* Finally, you'll want to edit your etc/config-local.pl file. Look for this line:

#@MEMCACHE_SERVERS = ('hostname:port');

and change it to:

@MEMCACHE_SERVERS = ('127.0.0.1:<port>');

again replacing <port> with the appropriate port number. (Make sure also that the line is uncommented by removing the # at the front.)

This, I think, should be all that's needed.
Edited 2009-06-09 13:16 (UTC)
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2009-06-10 10:26 pm (UTC)(link)
Why not run memcached with -d so it runs in the background? And you can specify -m to give it a small amount of memory.

memcached -d -m 8 -l 127.0.0.1 -p $PORT
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-06-10 10:38 pm (UTC)(link)
I don't know much at all about memcached, so the parameters I gave were based on what Dre had said was necessary.

The -m switch is definitely a good idea in this case, as would the -l switch if it does what I think it does (since I assume that otherwise it'll listen on all interfaces?)

As for -d, for a dev installation I imagine it would be useful to see console messages easily, though I don't even know if memcached outputs any, heh. (I'd personally still do it in screen just for the ability to Ctrl-C it directly rather than having to kill via the command line, but that's totally a me-thing and I know that not everyone will want that.)

Thanks for the tips!
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2009-06-12 05:38 pm (UTC)(link)
Yeah, -l is "bind to IP". And you're right about the foreground! It doesn't by default but you can specify -v or -vv (or maybe -vvv) to get some very verbose output which can really help in debugging.