I'm trying to make a persistent change to sunrpc.tcp_slot_table_entries
on a Linux CentOS 5.5. This value has been found important for the performance of our NFS clients, and must be set before the NFS mounts are done.
Simply putting the value in /etc/sysctl.conf
doesn't work because /etc/rc.d/rc.sysinit
(which does the sysctl -p) is executed before the sunrpc module is loaded.
Same problem with RHEL 4:
- http://amitgud.blogspot.com/2006/07/sysctl-for-late-comers.html
- https://bugzilla.redhat.com/show_bug.cgi?id=189311
I tried to:
- put
install sunrpc /sbin/modprobe -q --ignore-install sunrpc;/sbin/sysctl -w sunrpc.tcp_slot_table_entries=64
in/etc/modprobe.conf
(and in/etc/modprobe.d/sunrpc
) - put
SUBSYSTEM=="module" ACTION=="add" DEVPATH=="*/sunrpc" RUN+="/sbin/sysctl -w sunrpc.tcp_slot_table_entries=64"
(maybe it has to be changed for CentOS 5)
in/etc/udev/rules.d/23-sunrpc.rules
but to no avail.
And I'd prefer not to modify /etc/init.d/netfs
(from initscripts package).
So, have you succeeded in doing it properly on a CentOS 5, and if so, how ?
Edit:
found in /etc/modprobe.d/modprobe.conf.dist
:
install sunrpc /sbin/modprobe --first-time --ignore-install sunrpc && { /bin/mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs > /dev/null 2>&1 || :; }
That's maybe why my own addition to modprobe wasn't taken into account. But I'm not sure if I should modify directly that file, as it may be overwritten by module-init-tools updates …
Best Answer
Finally I created an almost dummy init script, inserted at S15 (see in /etc/rc3.d/), as the module is loaded in S14 (nfslock) and used in S25 (netfs).
/etc/init.d/sunrpc_tuning
:Then:
chkconfig --add sunrpc_tuning