• Home
  • Services
  • Profile
  • Portfolio
  • Contact
  • Links
  • Blog
  • Archives
  • Sitemap
Subscribe: Posts | Comments | E-mail
  • Ajax XMLHttpRequestAsynchronous HTTP Request How To's
  • FreebiesBest Freebies Collection
  • MiscellaneousNews, Announcements & General Stuffs
  • Print & Web DesignPhotoshop, Vector, CSS, XHTML
  • ProgrammingProgramming PHP, ASP, .NET and more

Bali Web Design

Posted on June 27, 2010 - by webmaster

Install, Configure & Running Memcache in Windows as Service

Featured Programming

Installing memcache server in windows is a little bit complicated compared to how it can be done in *nix since theres not yet available ready to use package for win32.

Luckily i found the compiled memcached for win32 (exe) which was made by jellycan, within this exe file you can install configure and running memcached as a service in your windows environment, here are how i made it:

*** updated ****
Newer version available at northscale, thanks to Matt Ingenthron for pointing this.

Installation

  • download the memcached compiled file at jellycan website (choose: win32 binary)
  • from windows command line running with administrator privileges, locate to memcached exe file
  • execute memcached.exe -d install
  • execute memcached.exe -d start

thats it now you have memcached services running on your server, by default it is listen to TCP port 11211 with 64 Mb memory limit. Configuring memcached also pretty simple you can uninstall the service and re-install it using your own parameters

Configuration

  • memcached.exe -d uninstall
  • memcached.exe -d install -m 512 -p 8081 (running with 512 mb memory limit, listening to TCP PORT 8081)
  • memcached.exe -d start

the complete available parameters as follow:

  • -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

PHP memcached extension

To have PHP running with memcached extension, below are how i made it:

  • download the php_memcached extension for win32 (php_memcache.dll) (if its not your in your php ext directory), i download it from here
  • move it to your php extension directory
  • edit your php.ini, add extension into it (extension=php_memcache.dll)
  • save php.ini
  • restart apache (net start apache_service_name)

PHP memcached test

Use code below to test your installation

$m = new Memcache;
$m->connect('localhost', 8081) or die ("Could not connect to memcached server");

$version = $m->getVersion();
echo "Memcached Server's version: ".$version."<br/>\n";

$o = new stdClass;
$o->attr = array('testing',234,'storing','another string');

$m->set('unique_key', $o, false, 30) or die ("Could not save cached data");
echo "Storing data for 30 seconds<br/>\n";

$r = $m->get('unique_key');
echo "Loaded ata from the cache:<br/>\n";

var_dump($r);

unset($m);
Share this article:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • Ping.fm
  • Pownce
  • Slashdot
  • StumbleUpon
  • Technorati
  • Tumblr
  • TwitThis
This entry was posted on Sunday, June 27th, 2010 at 11:32 and is filed under Featured, Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Comments

We'd love to hear yours!



  1. Visit My Website

    June 27, 2010

    Permalink

    Matt Ingenthron said:

    That’s a very, very old memcached. NorthScale has a much newer one and did a recent port. You can find it here:

    http://labs.northscale.com/memcached-packages/



  2. Visit My Website

    June 27, 2010

    Permalink

    webmaster said:

    thank you for pointing the newer source, link updated



  3. Visit My Website

    June 29, 2010

    Permalink

    Install, Configure & Running Memcache in Windows as Service | eBooks Zone said:

    [...] Read More Tutorial [...]



Leave a Comment

Here's your chance to speak.

  1. Name (required)

    Mail (required)

    Website

    Message

  • Most Popular Posts

    • { 108 } ResponsesPHP ajax login form using Jquery
    • { 79 } Responsesphp ajax tutorial create ajax based login form using jquery
    • { 71 } ResponsesASP Classic Programming Still Alive
    • { 53 } Responses63+ best practice to optimize PHP code performances
    • { 44 } ResponsesVideobox: Lightbox for videos
  • Latest Posts

    • PHP Newbie: Proper handling of Error & Exception in PHP
    • Why SEO lost importance
    • jQuery Mobile Announced : Touch-Optimized Web Framework for Smartphones & Tablets
    • Multiple Google Account Signin
    • Install, Configure & Running Memcache in Windows as Service
    • DynamicWP Image Cube Wordpress Plugin
    • New Wordpress 3.0 API menu_page_url
    • Wordpress 3.0 Custom Taxonomy
    • JQuery DataGrid Plugin Compass
    • Upgrading to upcoming CodeIgniter 2.0
  • Categories

    • advertorial
    • Ajax XMLHttpRequest
    • Featured
    • Freebies
    • Miscellaneous
    • Print & Web Design
    • Programming
    • Tutorials
    • Web 2.0
  • Featured News

    • PHP Newbie: Proper handling of Error & Exception in PHP by webmaster on August 18, 2010
    • Why SEO lost importance by webmaster on August 16, 2010
    • jQuery Mobile Announced : Touch-Optimized Web Framework for Smartphones & Tablets by webmaster on August 16, 2010
    • Install, Configure & Running Memcache in Windows as Service by webmaster on June 27, 2010
    • Website Optimization Best Practices, speed up your website load by ruby on May 21, 2009
  • Tag Cloud

    • Actionscript advertorial Ajax XMLHttpRequest API best practices CakePHP chat Classic ASP CMS CSS Development facebook firefox Flash flickr Freebies gmail HTML icons Javascript Jobs jQuery jQuery Plugins Library Lightbox memcache Mootools news Personal PHP PHP Frameworks plurk Print & Web Design prism Prototype regex regular expression Scriptaculous SEO Tutorial twitter Web 2.0 Wordpress Works YUI
  • Archives

    • August 2010
    • June 2010
    • May 2010
    • September 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
copyleft 2007 - 2010 Bali Website Design Studio