Skip to content

Commit

Permalink
Add udev rule to increase read_ahead_kb when an NFS share is mounted
Browse files Browse the repository at this point in the history
  • Loading branch information
hailmo-amzn authored and Noah Meyerhans committed Nov 16, 2021
1 parent 6f35b44 commit 9b1ff7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions 53-ec2-read-ahead-kb.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.


# increase read_ahead_kb when a nfs/efs export is mounted to improve throughput
SUBSYSTEM=="bdi", ACTION=="add", PROGRAM="/bin/awk -v bdi=$kernel 'BEGIN{ret=1} {if ($4 == bdi) {ret=0}} END{exit ret}' /proc/fs/nfsfs/volumes", ATTR{read_ahead_kb}="15360"
8 changes: 7 additions & 1 deletion amazon-ec2-utils.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: amazon-ec2-utils
Summary: A set of tools for running in EC2
Version: 1.3
Release: 3%{?dist}
Release: 4%{?dist}
License: MIT
Group: System Tools

Expand All @@ -15,6 +15,7 @@ Source22: 70-ec2-nvme-devices.rules
Source23: ec2nvme-nsid
Source24: ebsnvme-id
Source25: 51-ec2-xen-vbd-devices.rules
Source26: 53-ec2-read-ahead-kb.rules

URL: https://github.com/aws/amazon-ec2-utils
BuildArch: noarch
Expand Down Expand Up @@ -52,6 +53,7 @@ install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
install -m645 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
install -m644 %{SOURCE16} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
install -m644 %{SOURCE25} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
install -m644 %{SOURCE26} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/

#udev rules for nvme block devices and supporting scripts
install -m644 %{SOURCE22} $RPM_BUILD_ROOT%{_sysconfdir}/udev/rules.d/
Expand Down Expand Up @@ -84,10 +86,14 @@ rm -rf $RPM_BUILD_ROOT
%{_sysconfdir}/udev/rules.d/51-ec2-hvm-devices.rules
%{_sysconfdir}/udev/rules.d/51-ec2-xen-vbd-devices.rules
%{_sysconfdir}/udev/rules.d/52-ec2-vcpu.rules
%{_sysconfdir}/udev/rules.d/53-ec2-read-ahead-kb.rules
%{_sysconfdir}/udev/rules.d/60-cdrom_id.rules
%{_sysconfdir}/udev/rules.d/70-ec2-nvme-devices.rules

%changelog
* Tue Apr 20 2021 Hailey Mothershead <hailmo@amazon.com> 1.3-4
- Add udev rule to increase read_ahead_kb when an NFS share is mounted

* Thu Jul 14 2021 Sai Harsha <ssuryad@amazon.com> 1.3.3
- Disable timeout on EBS volumes

Expand Down

0 comments on commit 9b1ff7d

Please sign in to comment.