Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Fast provider feeding slow consumer

by graff (Chancellor)
on Apr 24, 2016 at 18:34 UTC ( #1161383=note: print w/replies, xml ) Need Help??

in reply to Fast provider feeding slow consumer

I don't use smnpwalk or Parallel::ForkManager, so I apologize in advance if my comments are of no use to you, but...

First, the only thing you've said (so far) about the problem on the production server is "it crashed." Can you be more specific? (What error messages do you get?)

Second, I wonder why you don't include the (slow) snmpwalk operation as part of the first script -- that is, do the fork management right there in the &data callback as you read from the socket, and print a line to STDOUT with four "insertable" values for each socket input, instead of just echoing it.

Then, your downstream process would be doing just the database connection and insertion without fork management being involved, which seems to me like a worthwhile way to keep things simple.

(updated to be slightly less wordy)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1161383]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2021-02-27 17:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found