G'day Karl,

Let's say I have three clients (users of my MCE application): A has 4 lcores; B has 8 lcores; C has 16 lcores.

Let's further say that each client only wants to use half of their processing power for my application, so: A wants to use 2 lcores; B wants to use 4 lcores; C wants to use 8 lcores.

If I simply use an "int param", as you suggest, they'll get the same value for max_workers. For instance, if I used max_workers => 6: A would be using 150%; B would be using 75%; C would be using 37.5%. (Compare what happened, in the first half of my OP, where I didn't cap the value and, at 200%, my computer with 12 lcores got 24 workers.)

Furthermore, clients' requirements may change depending on a number of factors. Perhaps start a big job on a Friday afternoon, using all available processing power, and let it run over the weekend; in another scenario, run jobs mid-week, during a busy part of the day, using only a fraction of available processing power.

Both of my solutions calculate the percentages correctly. What I didn't know was if there was a better solution; and, if not, which of those two solutions fellow monks would consider to be better (keeping in mind, of course, that better might vary under different conditions).

— Ken


In reply to Re^2: MCE - max_workers by kcott
in thread MCE - max_workers by kcott

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.