Index: trunk/udplog/debian/changelog |
— | — | @@ -1,3 +1,9 @@ |
| 2 | +udplog (1.8-2) lucid; urgency=low |
| 3 | + |
| 4 | + * init script sets recv-queue to up to 128k based on rmem_max |
| 5 | + |
| 6 | + -- Asher Feldman <afeldman@wikimedia.org> Mon, 21 Nov 2011 24:00:00 +0000 |
| 7 | + |
2 | 8 | udplog (1.8-1) lucid; urgency=low |
3 | 9 | |
4 | 10 | * Added a non-blocking write mode. Not recommended for use at this time. |
Index: trunk/udplog/debian/udp2log.init |
— | — | @@ -22,6 +22,16 @@ |
23 | 23 | SCRIPTNAME=/etc/init.d/$NAME |
24 | 24 | CONFFILE=/etc/udp2log |
25 | 25 | |
| 26 | +if [ -f /proc/sys/net/core/rmem_max ] ; then |
| 27 | + rmax=$(cat /proc/sys/net/core/rmem_max) |
| 28 | + if [ $rmax -ge 134217728 ] ; then |
| 29 | + queue=131072 |
| 30 | + else |
| 31 | + queue=$((queue/1024)) |
| 32 | + fi |
| 33 | + $DAEMON_ARGS="$DAEMON_ARGS --recv-queue=$queue" |
| 34 | +fi |
| 35 | + |
26 | 36 | # Exit if the package is not installed |
27 | 37 | [ -x "$DAEMON" ] || exit 0 |
28 | 38 | |