The message "kern.ipc.maxpipekva exceeded" is showing up on a development box ( FreeBSD 5.4 ) where I'm running a perl daemon that is doing a number of traceroutes to various hosts over time. From what I can tell, this leak is in the method I'm performing the traceroutes.

The longer the process runs, the more pipes that seem to remain open on the system, eventually reaching maxpipekva.

I can see in sysctl that kern.ipc.pipes and kern.ipc.pipekva bob up and down slowing approaching the maximum.

I can also see, using fstat, that there are a growing number of pipes connected to my daemon. The shell process spawned to deal with the traceroute has a number of pipes associated with them but disappear when the traceroute finally times out.

I'm using the following code to gather the traceroute:
eval { local $SIG{ALRM} = sub { die "timeout" }; alarm( 10 ); $temp = `traceroute -I -n $hostname > $data_file_dir/traceroute.$$ +`; alarm( 0 ); };
I assume that the traceroute in backticks will be terminated after the ALRM signal is sent, but I suspect that this is not the case and the traceroute program is waiting to perform the default of all 64 hops before terminating.

How can I avoid reaching the maxpipekva limit?

In reply to Leaky pipes? by vancetech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.