From: Michael Widenius Date: March 28 1999 6:30pm Subject: Forking Processes List-Archive: http://lists.mysql.com/mysql/1127 Message-Id: <14078.29950.194718.211187@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> "Jonathan" == Jonathan A Zdziarski writes: Jonathan> Hi, Jonathan> I'm writing a search engine in PERL right now...it runs great and fast Jonathan> too...except for one thing. The program that goes out and fetches the web Jonathan> pages is currently doing it in sequential order (waiting for #304 to Jonathan> finish before doing #305). I would like to program it to fork off into up Jonathan> to 30 or 40 processes to handle this (using all the proper SQL transaction Jonathan> code, etc), however I get the errors... Jonathan> DBD::mysql::st execute failed: Lost connection to MySQL server during Jonathan> query at ./spider.pl line 157, chunk 32. Jonathan> when I do this. I'm trying to determine the possible reasons for this. Jonathan> One question would be, if I form a connection before forking, can all Jonathan> processes use the same $DBH handle (speaking perl here) or do I need to Jonathan> rather re-connect in each instance with its own handle? If that's not the Jonathan> problem, what else could be causing it? Jonathan> Thank you, Hi! Sorry, you can't open a connection and then fork without running into trouble! fork first and open the MySQL connections after that! Regards, Monty