http://qs321.pair.com?node_id=1161383


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)