Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Fast provider feeding slow consumer

by graff (Chancellor)
on Apr 24, 2016 at 18:34 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-29 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found