After some research I found that there is a Win32 binary version of memcached available here.
So go there and download binary version to your computer. When downloaded, extract the file to folder memcahced on your C drive.
You should get only one file named memcached.exe. Now we need to install this as a service.
To install Memcached as a service, follow these steps:
- Run “Command Prompt” with administrator privileges.
- Install service using Command: > C:\memcached\memcached.exe -d install
- Start “memcached” service from Windows Services or using this command: > C:\memcached\memcached.exe -d start
That is it, now your memcached server is installed and is listening to port 11211. There is one more thing left to do. By default, server is set to 64Mb memory limit, which is too small.
To configure Memcached for memory or port, follow these steps:
- go to Registry Editor and find key “HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/memcached Server”
- Change the ImagePath entry to: ”C:\memcached\memcached.exe” -d runservice -m 512
This way you will use 512 Mb memory limit for your server.
Other options is:
- memcached.exe -d uninstall
- memcached.exe -d install -m 512
Complete list of options to configure as follows:
- -p [num] TCP port number to listen on (default: 11211)
- -U [num] UDP port number to listen on (default: 0, off)
- -s [file] unix socket path to listen on (disables network support)
- -a [mask] access mask for unix socket, in octal (default 0700)
- -l [ip address] interface to listen on, default is INDRR_ANY
- -d start tell memcached to start
- -d restart tell running memcached to do a graceful restart
- -d stop|shutdown tell running memcached to shutdown
- -d install install memcached service
- -d uninstall uninstall memcached service
- -r maximize core file limit
- -u [username] assume identity of (only when run as root)
- -m [num]] max memory to use for items in megabytes, default is 64 MB
- -M return error on memory exhausted (rather than removing items)
- -c [num] max simultaneous connections, default is 1024
- -k lock down all paged memory.
- -v verbose (print errors/warnings while in event loop)
- -vv very verbose (also print client commands/reponses)
- -h print this help and exit
- -i print memcached and libevent license
- -b run a managed instanced (mnemonic: buckets)
- -P [file]] save PID in , only used with -d option
- -f [factor] chunk size growth factor, default 1.25
- -n [bytes]] minimum space allocated for key+value+flags, default 48