Many hounds soon catch the hare. :-)<br><br>You are not nice (hint, hint!) to other users if you monopolize the resources that are<br>up for grabs. That&#39;s neither a problem of rules in general, nor that of Drools in<br>
particular. Launching many threads doing your stuff in parallel will make you reach the end<br>of your job faster, but it&#39;ll also make you highly unpopular quickly enough.<br><br>So: is it important that you process all of your stuff in a minimum of elapsed time?<br>
Or will you achieve your goal well enough by running just 2 to 5 threads? If you do<br>need to get it done quickly, many threads may be the solution, but it won&#39;t get<br>you more than 100% out of any CPU.<br><br>Any program&#39;s high CPU usage will influence other processes, especially<br>
if that program is run in parallel.<br><br>If you think that your rules are consuming an excessive amount of CPU cycles,<br>then you might want to check your rules. It is not unheard of that LHS can<br>be inefficient due to some unfortunate choice of the pattern order.<br>
<br>-W<br><br><div class="gmail_quote">On Wed, Mar 25, 2009 at 12:16 PM, techy <span dir="ltr">&lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks for your valuable input.<br>
<br>
I did further testing in TEST solaris machine where other apps too are<br>
running.<br>
<br>
1.In the consumer, I launched 5-10 threads of parallel execution with drools<br>
stateless session. It did performed well with more cpu usage. it maintained<br>
avg cpu usage of 65-70%. occasional spikes went to 85-90%.<br>
while I was doing this, Other apps contacted me about this and showed their<br>
concern too.<br>
<br>
So this brings up another question.  Will drools high cpu usage degrade<br>
other app performance when they are running in same machine &amp; same time?<br>
<br>
Thanks again!<br>
<div><div></div><div class="h5"><br>
<br>
nheron wrote:<br>
&gt;<br>
&gt; Hello,<br>
&gt; Yes, when running drools, the cpu usages goes high.<br>
&gt; It is one of the main caracteristic with rule engine : the more cpu you<br>
&gt; have the quickler it is !!<br>
&gt; It is normal because all the rete graph &amp; Co are in ram and drools work<br>
&gt; on it.<br>
&gt; So there is not wait for database, IO and co so CPU goes very high very<br>
&gt; quicly but is is normal !<br>
&gt; All my customers have this surprise : a 4 CPU machine instead one one<br>
&gt; makes it able to have 4 concurrent drools sessions to work in parallele<br>
&gt; with the same performance as one session on one CPU  !<br>
&gt; Regards<br>
&gt; Nicolas Heron<br>
&gt;<br>
&gt; Regards<br>
&gt; Nicolas<br>
&gt; Le mercredi 25 mars 2009 à 10:05 +0100, Wolfgang Laun a écrit :<br>
&gt;<br>
&gt;&gt; The figures you gave just indicate that you have a good balance<br>
&gt;&gt; between I/O<br>
&gt;&gt; and CPU load. The increase between &quot;no rules&quot; and &quot;~60 rules&quot; is to be<br>
&gt;&gt; expected<br>
&gt;&gt; as all the work is being done during fact insertion. Of course, adding<br>
&gt;&gt; more and<br>
&gt;&gt; more rules will, eventually, push the CPU load factor to the natural<br>
&gt;&gt; upper limit.<br>
&gt;&gt;<br>
&gt;&gt; If the overall throughput is good, why do you worry?<br>
&gt;&gt;<br>
&gt;&gt; -W<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Mar 24, 2009 at 11:20 PM, techy &lt;<a href="mailto:techluver007@gmail.com">techluver007@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;         Hello<br>
&gt;&gt;         My app is functioning consumer/producer model.<br>
&gt;&gt;         1.Producer reads the data from DB and inserts to blocking<br>
&gt;&gt;         queue<br>
&gt;&gt;         2.Consumer reads the data from queue and execute the rules<br>
&gt;&gt;         using drools<br>
&gt;&gt;         stateless session.<br>
&gt;&gt;         Both producer and consumer run asynchronously.<br>
&gt;&gt;<br>
&gt;&gt;         in my testing I found the following<br>
&gt;&gt;<br>
&gt;&gt;         1. for 1000 facts at a time and no rules in drl, cpu usage is<br>
&gt;&gt;         maintained at<br>
&gt;&gt;         25-30% in my PC(Intel core 2 CPU,2.13 GH,2G RAM)  - with no<br>
&gt;&gt;         rules in drl, Is<br>
&gt;&gt;         this cpu usage  acceptable?<br>
&gt;&gt;         2. for 1000 facts at a time and ~60 rules in drl, cpu usage is<br>
&gt;&gt;         maintained at<br>
&gt;&gt;         50-60% on the same PC.<br>
&gt;&gt;         3. If I have 1 sec wait between each execution of rules in<br>
&gt;&gt;         consumer, then<br>
&gt;&gt;         cpu usage is maintained &lt; 5%<br>
&gt;&gt;<br>
&gt;&gt;         high CPU usage is being big concern to me. Is this expected<br>
&gt;&gt;         while using<br>
&gt;&gt;         drools? Do others see same cpu usage too?  Please share your<br>
&gt;&gt;         thoughts.<br>
&gt;&gt;         appreciate your input.<br>
&gt;&gt;<br>
&gt;&gt;         Thanks<br>
&gt;&gt;<br>
&gt;&gt;         --<br>
&gt;&gt;         View this message in context:<br>
&gt;&gt;         <a href="http://www.nabble.com/high-cpu-usage-tp22691131p22691131.html" target="_blank">http://www.nabble.com/high-cpu-usage-tp22691131p22691131.html</a><br>
&gt;&gt;         Sent from the drools - user mailing list archive at<br>
&gt;&gt;         Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt;         _______________________________________________<br>
&gt;&gt;         rules-users mailing list<br>
&gt;&gt;         <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt;         <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/high-cpu-usage-tp22691131p22699498.html" target="_blank">http://www.nabble.com/high-cpu-usage-tp22691131p22699498.html</a><br>
</font><div><div></div><div class="h5">Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>