Memcached is a high-performance, distributed memory object caching system intended for use in speeding up dynamic web applications by alleviating database load. The server can be run as a Windows Service using FireDaemon Pro, which allows you to have the application start automatically at boot prior to login, start multiple instances of the application and so forth. This HOWTO will show you how to set it up. You can also use FireDaemon Fusion to manage FireDaemon and other Windows services via a web browser.
Memcached Setup Under FireDaemon Pro
Extract the contents of the zip file to a folder on your hard drive. For the purposes of this HOWTO, we will use "C:\Memcached". Memcached uses command line parameters for its initial settings.
Download and install FireDaemon Pro into the directory of your choice, typically C:\Program Files\FireDaemon.
Next start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Adjust the paths to suit your installation.
- Executable: The path to your memcached.exe file. For the purposes of this HOWTO, the path is C:\Memcached\memcached.exe.
- Working Directory: The directory containing your memcached.exe file. For the purposes of this HOWTO, the path is C:\Memcached.
- Parameters: -l 127.0.0.1 -p 11211 -m 64
The most important field on the tab is the Parameters. The Parameters define the initial setup of your server. Here’s the full parameter list you should have:
-l 127.0.0.1 -p 11211 -m 64
- "-l 127.0.0.1” Tells Memcached to listen on the IP 127.0.0.1. Replace 127.0.0.1 with the IP of the server.
- “-p 11211” Tells Memcached to use port 11211 (11211 is the default port)
- "-m 64" Tells Memcached to allocate 64MB of memory for caching. This is the default setting. You can increase it to more (e.g. 128, 256, 512, etc.)
Now click on the Settings tab. If you DON'T want to see Memcached running, uncheck the Interact with Desktop check box & select “Hidden” from the “Show Window” dropdown. You can optionally run Memcached as the user you installed it as. In the Logon Account field type your username (e.g. Administrator) and then enter the user's password twice in the Password and Confirm fields. You can change the Process Priority to allocate more CPU time to Memcached or specify which CPU or core Memcached will run on (in the case of multi-processor, hyperthreaded or multi-core CPUs).
Now click on the Lifecycle tab. Uncheck Graceful Shutdown as Memcached doesn't respond to it.
Now click OK to finish setup and start memcached!
NOTE: If Memcached is not secured, anyone can read and write data to your MySQL databases. To increase security you should change the port Memcached listens on. If remote servers need to access your Memcached, rather than open the port on your firewall so that any IP can access it, only allow the IP of the remote server to access the port.