Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Move total_memory_mb from zulip::base into zulip::common.

Alex Vandiver34e8c2c61e88
diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp
index 5d75d2f306e..6d2921e8d46 100644
--- a/puppet/zulip/manifests/app_frontend_base.pp
+++ b/puppet/zulip/manifests/app_frontend_base.pp
@@ -65,7 +65,7 @@ class zulip::app_frontend_base {
# This determines whether we run queue processors multithreaded or
# multiprocess. Multiprocess scales much better, but requires more
# RAM; we just auto-detect based on available system RAM.
- $queues_multiprocess = $zulip::base::total_memory_mb > 3500
+ $queues_multiprocess = $zulip::common::total_memory_mb > 3500
$queues = [
'deferred_work',
'digest_emails',
diff --git a/puppet/zulip/manifests/base.pp b/puppet/zulip/manifests/base.pp
index 25a51891cac..665e156c156 100644
--- a/puppet/zulip/manifests/base.pp
+++ b/puppet/zulip/manifests/base.pp
@@ -65,8 +65,6 @@ class zulip::base {
}
package { $base_packages: ensure => 'installed' }
- $total_memory_mb = Integer($::memorysize_mb);
-
group { 'zulip':
ensure => present,
}
diff --git a/puppet/zulip/manifests/common.pp b/puppet/zulip/manifests/common.pp
index f64c039bc6a..00638d299ae 100644
--- a/puppet/zulip/manifests/common.pp
+++ b/puppet/zulip/manifests/common.pp
@@ -26,4 +26,6 @@ class zulip::common {
}
}
$supervisor_conf_dir = "${supervisor_system_conf_dir}/zulip"
+
+ $total_memory_mb = Integer($::memorysize_mb)
}
diff --git a/puppet/zulip/manifests/memcached.pp b/puppet/zulip/manifests/memcached.pp
index 173a9e5ff31..8e2bda4cf82 100644
--- a/puppet/zulip/manifests/memcached.pp
+++ b/puppet/zulip/manifests/memcached.pp
@@ -17,7 +17,7 @@ class zulip::memcached {
}
package { $memcached_packages: ensure => 'installed' }
- $memcached_memory = zulipconf('memcached', 'memory', $zulip::base::total_memory_mb / 8)
+ $memcached_memory = zulipconf('memcached', 'memory', $zulip::common::total_memory_mb / 8)
file { '/etc/sasl2':
ensure => directory,
}
diff --git a/puppet/zulip/manifests/postgres_appdb_tuned.pp b/puppet/zulip/manifests/postgres_appdb_tuned.pp
index d1985b26b64..e6ca0fcd726 100644
--- a/puppet/zulip/manifests/postgres_appdb_tuned.pp
+++ b/puppet/zulip/manifests/postgres_appdb_tuned.pp
@@ -3,10 +3,10 @@
class zulip::postgres_appdb_tuned {
include zulip::postgres_appdb_base
- $work_mem = $zulip::base::total_memory_mb / 512
- $shared_buffers = $zulip::base::total_memory_mb / 8
- $effective_cache_size = $zulip::base::total_memory_mb * 10 / 32
- $maintenance_work_mem = $zulip::base::total_memory_mb / 32
+ $work_mem = $zulip::common::total_memory_mb / 512
+ $shared_buffers = $zulip::common::total_memory_mb / 8
+ $effective_cache_size = $zulip::common::total_memory_mb * 10 / 32
+ $maintenance_work_mem = $zulip::common::total_memory_mb / 32
$random_page_cost = zulipconf('postgresql', 'random_page_cost', undef)
$effective_io_concurrency = zulipconf('postgresql', 'effective_io_concurrency', undef)