Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set memory swap double of non-zero memory value #1492

Merged
merged 1 commit into from
Jun 8, 2018
Merged

fix: set memory swap double of non-zero memory value #1492

merged 1 commit into from
Jun 8, 2018

Conversation

Ace-Tang
Copy link
Contributor

@Ace-Tang Ace-Tang commented Jun 8, 2018

set value of memory swap double of non-zero memory value if
not specify --memory-sawp.

2x memory swap value is advised but not must.

You should typically size your swap space to approximately 2x main
memory for systems with less than 2GB of RAM, or approximately 1x main
memory if you have more. If you do not have a lot of RAM, though, you
will generally want a lot more swap. It is not recommended that you
configure any less than 256M of swap on a system and you should keep in
mind future memory expansion when sizing the swap partition. The
kernel's VM paging algorithms are tuned to perform best when there is at
least 2x swap versus main memory. Configuring too little swap can lead
to inefficiencies in the VM page scanning code as well as create issues
later on if you add more memory to your machine. Finally, on larger
systems with multiple SCSI disks (or multiple IDE disks operating on
different controllers), we strongly recommend that you configure
swap on each drive. The swap partitions on the drives should be
approximately the same size. The kernel can handle arbitrary sizes but
internal data structures scale to 4 times the largest swap partition.
Keeping the swap partitions near the same size will allow the kernel to
optimally stripe swap space across the N disks. Do not worry about
overdoing it a little, swap space is the saving grace of UNIX and even
if you do not normally use much swap, it can give you more time to
recover from a runaway program before being forced to reboot.'

Signed-off-by: Ace-Tang aceapril@126.com

Ⅰ. Describe what this PR did

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@Ace-Tang Ace-Tang requested a review from sunyuan3 June 8, 2018 04:36
@pouchrobot pouchrobot added kind/bug This is bug report for project size/S labels Jun 8, 2018
@Ace-Tang
Copy link
Contributor Author

Ace-Tang commented Jun 8, 2018

@sunyuan3 , this fix the aone bug.

set value of memory swap double of non-zero memory value if
not specify --memory-sawp.

2x memory swap value is advised but not must.

You should typically size your swap space to approximately 2x main
memory for systems with less than 2GB of RAM, or approximately 1x main
memory if you have more. If you do not have a lot of RAM, though, you
will generally want a lot more swap. It is not recommended that you
configure any less than 256M of swap on a system and you should keep in
mind future memory expansion when sizing the swap partition. The
kernel's VM paging algorithms are tuned to perform best when there is at
least 2x swap versus main memory. Configuring too little swap can lead
to inefficiencies in the VM page scanning code as well as create issues
later on if you add more memory to your machine. Finally, on larger
systems with multiple SCSI disks (or multiple IDE disks operating on
different controllers), we strongly recommend that you configure
swap on each drive. The swap partitions on the drives should be
approximately the same size. The kernel can handle arbitrary sizes but
internal data structures scale to 4 times the largest swap partition.
Keeping the swap partitions near the same size will allow the kernel to
optimally stripe swap space across the N disks. Do not worry about
overdoing it a little, swap space is the saving grace of UNIX and even
if you do not normally use much swap, it can give you more time to
recover from a runaway program before being forced to reboot.'

Signed-off-by: Ace-Tang <aceapril@126.com>
@codecov-io
Copy link

codecov-io commented Jun 8, 2018

Codecov Report

Merging #1492 into master will increase coverage by 0.07%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1492      +/-   ##
==========================================
+ Coverage   40.45%   40.53%   +0.07%     
==========================================
  Files         253      253              
  Lines       16466    16472       +6     
==========================================
+ Hits         6662     6677      +15     
+ Misses       8948     8939       -9     
  Partials      856      856
Impacted Files Coverage Δ
daemon/mgr/spec_linux.go 66.66% <100%> (ø) ⬆️
daemon/mgr/container_utils.go 53.19% <66.66%> (+0.35%) ⬆️
ctrd/container.go 50.18% <0%> (+0.72%) ⬆️
daemon/logger/jsonfile/utils.go 71.66% <0%> (+1.66%) ⬆️
ctrd/image.go 79.42% <0%> (+2.85%) ⬆️
apis/server/utils.go 64.28% <0%> (+4.76%) ⬆️

@sunyuan3
Copy link
Contributor

sunyuan3 commented Jun 8, 2018

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jun 8, 2018
@sunyuan3 sunyuan3 merged commit 5d82c31 into AliyunContainerService:master Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants