[CalendarServer-changes] [2440] CalendarServer/branches/unified-cache
source_changes at macosforge.org
source_changes at macosforge.org
Wed May 21 16:57:29 PDT 2008
Revision: 2440
http://trac.macosforge.org/projects/calendarserver/changeset/2440
Author: dreid at apple.com
Date: 2008-05-21 16:57:26 -0700 (Wed, 21 May 2008)
Log Message:
-----------
build and run memcached
Modified Paths:
--------------
CalendarServer/branches/unified-cache/run
CalendarServer/branches/unified-cache/twistedcaldav/cluster.py
CalendarServer/branches/unified-cache/twistedcaldav/config.py
Modified: CalendarServer/branches/unified-cache/run
===================================================================
--- CalendarServer/branches/unified-cache/run 2008-05-21 23:11:19 UTC (rev 2439)
+++ CalendarServer/branches/unified-cache/run 2008-05-21 23:57:26 UTC (rev 2440)
@@ -47,7 +47,7 @@
if [ "${1--}" != "-" ]; then echo "$@"; echo; fi;
- echo "Usage: ${program} [-hvsfpndkr] [-K key] [-iI dst] [-t type] [-S statsfile]";
+ echo "Usage: ${program} [-hvsfpndkr] [-K key] [-iI dst] [-t type] [-S statsdirectory]";
echo "Options:";
echo " -h Print this help and exit";
echo " -v Be verbose";
@@ -62,7 +62,7 @@
echo " -i Perform a system install into dst; implies -s";
echo " -I Perform a home install into dst; implies -s";
echo " -t Select the server process type (Master, Slave or Combined)";
- echo " -S Write a pstats object to the given file when the server is stopped.";
+ echo " -S Write a pstats object for each process to the given directory when the server is stopped.";
if [ "${1-}" == "-" ]; then return 0; fi;
exit 64;
@@ -518,6 +518,44 @@
fi;
#
+# libevent
+#
+libevent="${top}/libevent-1.4.4-stable"
+
+www_get "libevent" "${libevent}" http://www.monkey.org/~provos/libevent-1.4.4-stable.tar.gz
+
+if ! "${disable_setup}" && (
+ "${force_setup}" || [ ! -d "${libevent}/_root" ]
+); then
+ echo "";
+ echo "Building libevent...";
+ cd "${libevent}";
+ ./configure --prefix="${libevent}/_root";
+ make;
+ make install;
+fi;
+
+export DYLD_LIBRARY_PATH="${libevent}/_root/lib"
+
+#
+# memcached
+#
+memcached="${top}/memcached-1.2.5"
+
+www_get "memcached" "${memcached}" http://www.danga.com/memcached/dist/memcached-1.2.5.tar.gz;
+
+if ! "${disable_setup}" && (
+ "${force_setup}" || [ ! -d "${memcached}/_root" ]
+); then
+ echo "";
+ echo "Building memcached...";
+ cd "${memcached}";
+ ./configure --prefix="${memcached}/_root" --with-libevent="${libevent}/_root";
+ make;
+ make install;
+fi;
+
+#
# Twisted
#
@@ -536,7 +574,7 @@
# PYTHONPATH, not a build directory.
py_install "Twisted" "${twisted}";
-
+
export PYTHONPATH="${PYTHONPATH}:${twisted}";
# twisted.web2 doesn't get installed by default
@@ -603,7 +641,7 @@
if ! py_have_module pydirector; then
pydirector="${top}/pydirector-1.0.0";
-
+
www_get "PyDirector" "${pydirector}" http://easynews.dl.sourceforge.net/sourceforge/pythondirector/pydirector-1.0.0.tar.gz;
put_setuptools "${pydirector}";
py_build "PyDirector" "${pydirector}" false;
Modified: CalendarServer/branches/unified-cache/twistedcaldav/cluster.py
===================================================================
--- CalendarServer/branches/unified-cache/twistedcaldav/cluster.py 2008-05-21 23:11:19 UTC (rev 2439)
+++ CalendarServer/branches/unified-cache/twistedcaldav/cluster.py 2008-05-21 23:57:26 UTC (rev 2440)
@@ -102,6 +102,10 @@
'-o', 'MultiProcess/ProcessCount=%d' % (
config.MultiProcess['ProcessCount'],)])
+ if config.Memcached["ServerEnabled"]:
+ args.extend(
+ ['-o', 'Memcached/ClientEnabled=True'])
+
if self.ports:
args.extend([
'-o',
@@ -287,6 +291,22 @@
fname],
env=parentEnv)
+
+ if config.Memcached["ServerEnabled"]:
+ memcachedArgv = [
+ config.Memcached["memcached"],
+ '-p', str(config.Memcached["Port"]),
+ '-l', config.Memcached["BindAddress"]]
+
+ if config.Memcached["MaxMemory"] is not None:
+ memcachedArgv.extend([
+ '-m', str(config.Memcached["MaxMemory"])])
+
+ memcachedArgv.extend(config.Memcached["Options"])
+
+ monitor.addProcess('memcached', memcachedArgv, env=parentEnv)
+
+
logger = AMPLoggingFactory(
RotatingFileAccessLoggingObserver(config.AccessLogFile))
Modified: CalendarServer/branches/unified-cache/twistedcaldav/config.py
===================================================================
--- CalendarServer/branches/unified-cache/twistedcaldav/config.py 2008-05-21 23:11:19 UTC (rev 2439)
+++ CalendarServer/branches/unified-cache/twistedcaldav/config.py 2008-05-21 23:57:26 UTC (rev 2440)
@@ -201,8 +201,18 @@
},
"ThreadPoolSize": 10,
-
+
"ListenBacklog": 50,
+
+ "Memcached": {
+ "ClientEnabled": False,
+ "ServerEnabled": False,
+ "BindAddress": "127.0.0.1",
+ "Port": 11211,
+ "memcached": "/usr/share/caldavd/bin/memcached",
+ "MaxMemory": None, # Megabytes
+ "Options": [],
+ },
}
class Config (object):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080521/bd0b3cdb/attachment.htm
More information about the calendarserver-changes
mailing list