Commit 20eb5fee authored by Christos Stavrakakis's avatar Christos Stavrakakis

deploy: Performance tune for postgresql

Turn off fsync, synchronous_commit and full_pages_writer to speed up
postgresql. DB is not no longer crash-safe, but this is no needed for
tests.

Also, introduce 'testing_vm' setting to distinquish between the type of
deployment. In cases like the above, we want to be able to configure the
server in a different way, whether is deployed for development/testing
or for production deployment.
parent 27e4f213
......@@ -31,3 +31,9 @@ cmd = /var/run/snf-deploy/cmd
keygen = False
# whether to inject ssh keys found in templates/root/.ssh in nodes
key_inject = True
[options]
# Deploy Synnefo, specially tuned for testing. This option improves the speed
# of some operations, but is not safe for all enviroments. (e.g. disable
# fsync of postgresql)
testing_vm = True
......@@ -31,3 +31,9 @@ cmd = /var/run/snf-deploy/cmd
keygen = False
# whether to inject ssh keys found in templates/root/.ssh in nodes
key_inject = True
[options]
# Deploy Synnefo, specially tuned for testing. This option improves the speed
# of some operations, but is not safe for all enviroments. (e.g. disable
# fsync of postgresql)
testing_vm = False
......@@ -454,6 +454,12 @@ def setup_db():
"""
try_run(cmd)
if env.env.testing_vm:
cmd = """
echo "fsync=off\nsynchronous_commit=off\nfull_page_writes=off" >> /etc/postgresql/8.4/main/postgresql.conf
"""
try_run(cmd)
allow_access_in_db(env.host, "all", "trust")
try_run("/etc/init.d/postgresql restart")
......
......@@ -128,7 +128,7 @@ class Conf(object):
files = {
"nodes": ["network", "info"],
"deploy": ["dirs", "packages", "keys"],
"deploy": ["dirs", "packages", "keys", "options"],
"vcluster": ["cluster", "image"],
"synnefo": ["cred", "synnefo", "roles"],
"packages": ["debian", "ganeti", "synnefo", "other"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment