1. This process will take 100% CPU until other process, also very greedy to CPU will execute. Most system administrators, especially web hosting ones, dislike processes take 100% CPU, no matter they use "nice" or not.
  2. Code sometimes contain bugs. Sometimes bug initiate an infinite loop which only take CPU and do nothing. This slow down overall system very much and this slowdown can be detected many time after: for example, some time ago I execute such script in background and log out from system, and then log in after 10 hours (because I estimate time to finish this script to 10 hours) and found very slow system and a lot of complains from customers "why system was too slow yesterday?". My solution allow to limit maximum CPU load and no bug can break this limit.
  3. It's nice to have ability to control how greedy for CPU your script can be. It's nice to have simple way to control speed of your script. And it was very interesting to develop this solution!

In reply to Re: Re: Re: Re: use less 'CPU' by powerman
in thread use less 'CPU' by powerman

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.