Skip to content

Commit

Permalink
Enable jemalloc by default and remove feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
svkrieger committed Oct 23, 2024
1 parent 5b44461 commit 69585b4
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ cd /var/vcap/packages/cloud_controller_ng/cloud_controller_ng
export RUBYOPT='--yjit'
<% end %>

<% if link("cloud_controller_internal").p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so

exec bundle exec rake deployment_updater:start
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ cd /var/vcap/packages/cloud_controller_ng/cloud_controller_ng
export RUBYOPT='--yjit'
<% end %>

<% if link("cloud_controller_internal").p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>

exec bundle exec rake clock:start
5 changes: 0 additions & 5 deletions jobs/cloud_controller_ng/spec
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ provides:
- cc.external_port
- cc.external_protocol
- cc.experimental.use_yjit_compiler
- cc.experimental.use_jemalloc_memory_allocator
- cc.internal_service_hostname
- cc.jobs.enable_dynamic_job_priorities
- cc.log_db_queries
Expand Down Expand Up @@ -1253,10 +1252,6 @@ properties:
description: "Use Ruby's YJIT compiler when running Cloud Controller API servers and workers. This feature is experimental and not recommended. Please review the drawbacks and benefits of YJIT before enabling."
default: false

cc.experimental.use_jemalloc_memory_allocator:
description: "Enables jemalloc rather than malloc for Cloud Controller API servers and workers; however, it's experimental and not typically recommended, so review its pros and cons before use."
default: false

cc.experimental.use_redis:
description: "Use co-deployed Valkey (Redis fork) for rate limiting and metrics. If the Puma webserver is enabled, Valkey will automatically be used."
default: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ echo 'Finished migrations and seeds'
export RUBYOPT='--yjit'
<% end %>

<% if p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>

exec /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/bin/cloud_controller \
-c /var/vcap/jobs/cloud_controller_ng/config/cloud_controller_ng.yml
2 changes: 0 additions & 2 deletions jobs/cloud_controller_ng/templates/bin/local_worker.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ wait_for_blobstore
export RUBYOPT='--yjit'
<% end %>

<% if p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>

cd /var/vcap/packages/cloud_controller_ng/cloud_controller_ng
exec bundle exec rake "jobs:local[cc_api_worker.<%= spec.job.name %>.<%= spec.index %>.${INDEX}]"
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ wait_for_blobstore
export RUBYOPT='--yjit'
<% end %>

<% if link("cloud_controller_internal").p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>

cd /var/vcap/packages/cloud_controller_ng/cloud_controller_ng

Expand Down
4 changes: 1 addition & 3 deletions jobs/rotate_cc_database_key/templates/bin/run.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

set -eu

<% if link("cloud_controller_internal").p('cc.experimental.use_jemalloc_memory_allocator') %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so
<% end %>
export LD_PRELOAD=/var/vcap/packages/jemalloc/lib/libjemalloc.so

rotate() {
export CLOUD_CONTROLLER_NG_CONFIG=/var/vcap/jobs/rotate_cc_database_key/config/cloud_controller_ng.yml
Expand Down
4 changes: 2 additions & 2 deletions spec/cloud_controller_ng/cloud_controller_ng_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module Test
'private_endpoint' => 'https://blobstore.service.cf.internal:4443',
'public_endpoint' => 'https://blobstore.brook-sentry.capi.land',
'username' => 'blobstore-user' } },
'experimental' => {},
'install_buildpacks' =>
[{ 'name' => 'staticfile_buildpack', 'package' => 'staticfile-buildpack' },
{ 'name' => 'java_buildpack', 'package' => 'java-buildpack' },
Expand Down Expand Up @@ -104,8 +105,7 @@ module Test
[{ 'description' => 'Cloud Foundry Linux-based filesystem',
'name' => 'cflinuxfs4' }],
'staging_upload_password' => '((cc_staging_upload_password))',
'staging_upload_user' => 'staging_user',
'experimental' => {} },
'staging_upload_user' => 'staging_user' },
'ccdb' =>
{ 'databases' => [{ 'name' => 'cloud_controller', 'tag' => 'cc' }],
'db_scheme' => 'mysql',
Expand Down

0 comments on commit 69585b4

Please sign in to comment.