Venerable Monks,

I have Perl 5.10 programs on Solaris 10 that use Net::LDAP to:

  • Bind to an X.500 Directory System Agent (DSA)
  • Update (Add or delete or modify) thousands of entries
  • Unbind

    The mean time for the DSA to service each LDAP update is 51 miliseconds.
    The mean time for my Perl program (LDAP client) to prepare the next LDAP update request is 13 milliseconds.

    The resulting round time per update is 64 milliseconds, giving about 15 updates per second. I have tuned the DSA to about its optimal performance, according to the vendor. So I cannot reduce that 51 ms time per LDAP update by the server. However, I run the X.500 DSA as one parent process that spawns 10 children. So I am considering forking my LDAP client Perl program to split the possibly thousands of updates into up to 10 batches to be processed in parallel. Thus I hope to finish all updates in one tenth of the current time.

    Can Monks kindly advise whether Net::LDAP provides any built-in support for multi-threading? Or should I somehow fork off 10 child processes and assume that each may bind to a different child LDAP server?

    I'd welcome advice on either approach.

    My first edition of Perl Cookbook has recipies in Chapter 17 Sockets on:

  • 17.11 Forking Servers
  • 17.12 Pre-Forking Servers

    Should I adapt these Socket examples to LDAP, or should I look to more recent books/editions for improvement in threading support in Perl? I have subscribed to the Sourceforge LDAP mailing list, but its archives seem to be heavily spammed - I cannot get anything useful from the list archives.

    Thank-you for any guidance you can offer.


    In reply to Multi-threading Net::LDAP by Cuhulain

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.