in reply to Re^2: Mail::SendMail and fork
in thread Mail::SendMail and fork

fork is a bad idea on Windows, and it's a bad idea on any system to try to fork 10000 processes at once. Take a look at Parallel::ForkManager or a simple thread-based solution that runs (say) 5 or 10 worker threads and feeds them from a queue.

Replies are listed 'Best First'.
Re^4: Mail::SendMail and fork
by hiradhu (Acolyte) on Apr 01, 2009 at 08:59 UTC
    Thanks! I suppose ForkManager is also uses Fork function, not sure. Basically I'm testing Mail scalability, it would be good if I can stress the server with 50000 mails per day sending mails in parallel...
      Even using threads, those sorts of numbers will cause tremendous context switching issues.

      50000 mails per day is not the same as 50000 all at once. If a mail takes one second in the system, 50000 is only two per second if evenly distributed throughout the day (which it won't be, I know). What is your peak?
        It is like this

        Users 9000

        Mail box 9000

        mail/box 2000

        Total mails per year--- 18000000

        Per Day 49315.06849 = (18000000/365)

        Uniform Distribution/sec 1.712328767 (ie mail per sec)