gc_thresh, maxsize (?)

Simon Kirby (sim@netnation.com)
Wed, 27 Jan 1999 11:26:17 -0800 (PST)

Running 2.1.131 and some 2.2pres on our routing/firewall/accounting box,
we were bitten by some sort of limit placed on the dst_alloc() function to
stop it from allocating too many records, it looks like.

We were having problems with sites outside randomly not being reachable
for the first few tries and then suddenly working -- it was very hard to
trace until recently when it was happening more and more often during peek
traffic time. It felt to me like something with the ARP table size being
limited or something, so I added some printk()s and rebooted and added
some more printk()s and rebooted and added some more printk()s and
rebooted and got yelled at by the other staff in the office and added some
more printk()s and rebooted...and finally found that it was the "if"
condition in the dst_alloc() function in linux/net/core/dst.c that was
making dst_alloc() return NULL and making it drop new routes discovered in

I added a printk() to the dst_alloc() function before it returned and
found that syslog noticed it was happening thousands of times per second,
so I went into /proc/sys/net/ipv4/route and twiddled with gc_thresh and
max_size and was able to make it stop. After this, all the problems we
were having with the network stopped (yay!).

So, what is the gc_thresh for? I also noticed "gc_elasticity" and some
others...I tried to look around for some documentation explaining them but
I was not able to find any.

If it not wise to raise the limits for the common case, I recommend that a
printk() or something be added to the function so that in the future
people doing something similar don't get bitten by the same
hard-to-track-down problem.


| Simon Kirby | Systems Administration |
| mailto:sim@netnation.com | NetNation Communications |
| http://www.netnation.com/ | Tech: (604) 684-6892 |

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/