Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A handful of tweaks that came up running through this today:

* Correctly set ServerLimit in Apache.
* Some fabfile fixes to install extra stuff I missed before (svn).
* A few extra Fab commands.
* Caching fixes.
* pgpool fixes.
  • Loading branch information...
commit 6e9472d7727beeb0ff6698567e26e6ec9876c884 1 parent 9e5d999
@jacobian jacobian authored
View
3  apache/apache2.conf
@@ -22,10 +22,11 @@ Listen *:80
Timeout 60
StartServers 2
+ServerLimit 5
MinSpareThreads 2
MaxSpareThreads 4
ThreadLimit 10
-ThreadsPerChild 10
+ThreadsPerChild 10
MaxClients 100
MaxRequestsPerChild 10000
View
4 fabfile.py
@@ -36,4 +36,6 @@ def setup():
def killem():
for name in env.hosts:
- CS.servers.find(name=name).delete()
+ CS.servers.find(name=name).delete()
+
+del Path
View
9 fabfiles/multiple-webs.py
@@ -21,7 +21,7 @@ def setup():
"Set up and bootstrap a new web server."
# Install needed packages
- run('aptitude -y install git-core python-dev postgresql-dev postgresql-client build-essential libpq-dev apache2 libapache2-mod-wsgi')
+ run('aptitude -y install subversion git-core python-dev postgresql-dev postgresql-client build-essential libpq-dev apache2 libapache2-mod-wsgi')
# Make the code directories, and go get the code
run('mkdir -p %s' % os.path.join(env.web_root, "static"))
@@ -53,9 +53,6 @@ def setup():
# Done - where! Now restart Apache.
run('invoke-rc.d apache2 restart')
-def trysed():
- dbip = '10.177.58.115'
-
def push():
"Push out new code to the server."
with cd(env.code_root):
@@ -70,6 +67,10 @@ def reload():
"Reload Apache to pick up new code changes."
run("invoke-rc.d apache2 reload")
+def restart_apache():
+ "Restart Apache."
+ run("invoke-rc.d apache2 restart")
+
def flush_cache():
"Flush memcached."
run("invoke-rc.d memcached restart")
View
3  fumblerooski-site/buildout.cfg
@@ -22,8 +22,7 @@ extra-paths = ${buildout:extra-paths}
[fumblerooski]
recipe = zerokspot.recipe.git
-repository = git://github.com/jacobian/fumblerooski.git
-rev = 542c21e
+repository = git://github.com/dwillis/fumblerooski.git
[gcharts]
recipe = zerokspot.recipe.git
View
6 fumblerooski-site/fski/settings.py
@@ -27,16 +27,16 @@
# Umcomment this and the middleware below to enable caching.
# Replace the IPs with the internal IPs of the machines running memcached.
-CACHE_BACKEND = 'memcached://10.X.X.X:11211;10.X.X.X:11211/'
+# CACHE_BACKEND = 'memcached://10.X.X.X:11211;10.X.X.X:11211/'
MIDDLEWARE_CLASSES = (
- 'django.middleware.cache.UpdateCacheMiddleware',
+ # 'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
- 'django.middleware.cache.FetchFromCacheMiddleware',
+ # 'django.middleware.cache.FetchFromCacheMiddleware',
)
ROOT_URLCONF = 'fumblerooski.urls'
View
9 notes/pycon-2010-script.txt
@@ -61,7 +61,7 @@ Pre-fetch the big data file::
Bootstrap up the example app::
- web1$ aptitude install git-core python-dev postgresql-dev postgresql-client build-essential libpq-dev
+ web1$ aptitude install git-core python-dev postgresql-dev postgresql-client build-essential libpq-dev subversion
web1$ mkdir -p /home/web/static
web1$ cd /home/web
web1$ git clone git://github.com/jacobian/django-deployment-workshop.git
@@ -91,7 +91,7 @@ Install and configure Postgres.
Edit config files pg_hba.conf to include the correct IP addresses, then start::
db1$ vim pg_hba.conf
- db1$ vim postgresql.config
+ db1$ vim postgresql.conf
db1$ invoke-rc.d postgresql-8.4 start
And create users and database. Root user for convenience::
@@ -338,7 +338,10 @@ Copy over the WAL files::
db2$ RSYNC_RSH="ssh -i /var/lib/postgresql/.ssh/no-pass" rsync -arv --remove-source-files postgres@<db1>:/pg_archive/* /pg_archive/
-In real life, the above would be a cron job.
+In real life, the above would be a cron job::
+
+ RSYNC_RSH="ssh -i /var/lib/postgresql/.ssh/no-pass"
+ */5 * * * * rsync -arv --remove-source-files postgres@<db1>:/pg_archive/* /pg_archive/
Start PostgreSQL and verify it is in recovery mode::
View
2  pgpool/pgpool-single-db.conf
@@ -5,7 +5,7 @@ listen_addresses = 'localhost'
port = 5432
# Don't use local auth; defer to the database instead.
-enable_pool_hba = true
+enable_pool_hba = false
# Don't use any of pgpool's fancy features
replication_mode = false
View
2  pgpool/pgpool-with-failover.conf
@@ -5,7 +5,7 @@ listen_addresses = 'localhost'
port = 5432
# Don't use local auth; defer to the database instead.
-enable_pool_hba = true
+enable_pool_hba = false
# Don't use any of pgpool's fancy features
replication_mode = false
Please sign in to comment.
Something went wrong with that request. Please try again.