Improve memory performance by reducing dirty pages after fork()

The nakayoshi_fork gem works around the lack of a Ruby compacting
garbage collecting by calling GC.start a few times to "promote" the age
of young objects to the maximum age 3. This reduces the number of dirty
pages and consequently improves copy-on-write behavior with unicorn
and other forking Web application servers.
This commit is contained in:
Stan Hu 2018-11-17 23:13:00 -08:00
parent 29d8179ba0
commit d991ea6ddd
4 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,9 @@ source 'https://rubygems.org'
gem 'rails', gem_versions['rails']
gem 'rails-deprecated_sanitizer', '~> 1.0.3'
# Improves copy-on-write performance for MRI
gem 'nakayoshi_fork', '~> 0.0.4'
# Responders respond_to and respond_with
gem 'responders', '~> 2.0'

View File

@ -470,6 +470,7 @@ GEM
mustermann-grape (1.0.0)
mustermann (~> 1.0.0)
mysql2 (0.4.10)
nakayoshi_fork (0.0.4)
net-ldap (0.16.0)
net-ssh (5.0.1)
netrc (0.11.0)
@ -1051,6 +1052,7 @@ DEPENDENCIES
mini_magick
minitest (~> 5.7.0)
mysql2 (~> 0.4.10)
nakayoshi_fork (~> 0.0.4)
net-ldap
net-ssh (~> 5.0)
nokogiri (~> 1.8.2)

View File

@ -467,6 +467,7 @@ GEM
mustermann-grape (1.0.0)
mustermann (~> 1.0.0)
mysql2 (0.4.10)
nakayoshi_fork (0.0.4)
net-ldap (0.16.0)
net-ssh (5.0.1)
netrc (0.11.0)
@ -1042,6 +1043,7 @@ DEPENDENCIES
mini_magick
minitest (~> 5.7.0)
mysql2 (~> 0.4.10)
nakayoshi_fork (~> 0.0.4)
net-ldap
net-ssh (~> 5.0)
nokogiri (~> 1.8.2)

View File

@ -0,0 +1,5 @@
---
title: Improve memory performance by reducing dirty pages after fork()
merge_request: 23169
author:
type: performance