Trond Norbye's Weblog

« One year @ Sun | Main | OpenGrok and SMF »

http://blogs.sun.com/trond/date/20080108 Tuesday January 08, 2008

Memcached in Solaris

I have been working on integrating Memcached into OpenSolaris for a while, and it is now integrated and available if you would like to try it!

The Memcached server is controlled by SMF and needs to be configured before it can be started. You must at least specify the username for the user you would like memcached to run as, and you would probably like to increase the amount of memory the server should use. In the following example I am using the user nobody and 2GB of memory (note: you should not exceed the physical amount of RAM available)

# svccfg
svc:> select memcached
svc:/application/database/memcached> setprop memcached/options=("-u" "nobody" "-m" "2048")
svc:/application/database/memcached> quit
# svcadm refresh memcached
        

You can now start memcached by executing:

# svcadm enable memcached
        

And to monitor the status om memcached, you can just execute:

$ svcs memcached
STATE          STIME    FMRI
online         08:20:03 svc:/application/database/memcached:default
        

To shut down the memcached server, execute:

# svcadm disable memcached     
        

Please see memcached(1m) for more information.

Comments:

This is good! So if I install SXDE on a VM on Mac, then I'll get memcached built in ?

libevent.so is included as part of the bundle as well ?

Posted by Arun Gupta on March 12, 2008 at 08:05 PM CET #

Will this run on Solaris?

Posted by Bill on September 22, 2009 at 07:45 PM CEST #

Bill: Yes. you could download the web stack package for Solaris 10. Right now I'm working on integrating memcached 1.4.1 into the OpenSolaris release train.

Posted by Trond Norbye on September 22, 2009 at 07:48 PM CEST #

At least with the package from OpenSolaris 2009.06 I had to alter the method script to replace "memcached" with "$SMF_FMRI" in order to use multiple instances. This way it obtains the correct memcached/options property for the specific instance.

getproparg() {
val=`svcprop -p "$1" $SMF_FMRI`
[ -n "$val" ] && echo "$val"
}

Perhaps there was a better way to do this?

Posted by Matthew Montgomery on November 05, 2009 at 10:34 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed

Valid HTML! Valid CSS!

This is a personal weblog, I do not speak for my employer.