FS#40606 - [memcached] Switch to socket

Attached to Project: Arch Linux
Opened by beta990 (beta990) - Friday, 30 May 2014, 09:30 GMT
Last edited by Dan McGee (toofishes) - Saturday, 31 May 2014, 18:05 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

memcached 1.4.19-1

Instead of listen to address, we should listen on socket.
It seems faster, and it works for most applications.

$ cat /usr/lib/systemd/system/memcached-custom.service
[Unit]
Description=Memcached Daemon
After=network.target

[Service]
User=memcached
ExecStart=/usr/bin/memcached -s /var/run/memcached/memcached.socket -a 0777
Restart=always

[Install]
WantedBy=multi-user.target
This task depends upon

Closed by  Dan McGee (toofishes)
Saturday, 31 May 2014, 18:05 GMT
Reason for closing:  Won't implement
Comment by Dave Reisner (falconindy) - Saturday, 31 May 2014, 02:42 GMT
> It seems faster, and it works for most applications.
Benchmarks to prove this? Using an AF_UNIX socket precludes the ability to put memcached on a different machine which is the obvious reasoning behind listening over AF_INET instead.
Comment by beta990 (beta990) - Saturday, 31 May 2014, 11:44 GMT
Hi Dave,

Sorry for the mistake, what I actually meant is that sockets have less overhead, and therefore less stress on the CPU (useful on a NAS, etc.).
On the other hand, I did forget load-balancing, etc.

What I would like to requests, is a systemd service that uses a socket (named like 'memcached-socket'), since I'm just a systemd beginner, I don't know the correct way of doing things.
The user than has the choose to use socket(s), or TCP connection.
Comment by Dave Reisner (falconindy) - Saturday, 31 May 2014, 16:42 GMT
You already have the option to change this yourself. Create a directory, /etc/systemd/system/memcached.service.d, and add a file to it called start.conf (the name doesn't matter so long as it ends with .conf):

[Service]
ExecStart=
ExecStart=/usr/bin/memcached -s /run/memcached/socket
RuntimeDirectory=memcached

There's no reason to ship a different service to express a different configuration method.
Comment by Dan McGee (toofishes) - Saturday, 31 May 2014, 18:04 GMT
I'm not planning on implementing this, as Dave just stated exactly what I was going to say.

Loading...