Wolfgang is providing very sensible comments.
On top of that, it is always good to remember that the Rete algorithm is
optimized for the processing of high volumes of rules and the overall
performance is not tied to the number of existing rules, but the average
number of matching rules.
So, I don't really see much value in testing your application with
no-rules or just a few rules, even if it is to get your baseline overhead,
because that will not be a real scenario. Just as an example with Drools 3
(but remember this is a Rete characteristic that applies to Drools 4 and 5):
As you can see above, increasing the number of rules 10 times degrades
the performance by a factor less than 2 times.
Now, analyze the same scenario with other solutions, including a hand
made rules processing solution. Look at your non-functional requirements on
rules maintenance and development life-cycle and required time-to-market.
After looking at all that you will be able to safely choose between a
rules engine or an in-house solution, whatever meets your requirements
better.
BTW, I am not discussing "how" you did your profile, if it includes the
whole application process or just the rules engine, etc. 25% CPU just to
create fact handles is indeed strange to me, but no one other than you can
figure this out.
[]s
Edson
2009/3/25 Wolfgang Laun <wolfgang.laun(a)gmail.com>
Many hounds soon catch the hare. :-)
You are not nice (hint, hint!) to other users if you monopolize the
resources that are
up for grabs. That's neither a problem of rules in general, nor that of
Drools in
particular. Launching many threads doing your stuff in parallel will make
you reach the end
of your job faster, but it'll also make you highly unpopular quickly
enough.
So: is it important that you process all of your stuff in a minimum of
elapsed time?
Or will you achieve your goal well enough by running just 2 to 5 threads?
If you do
need to get it done quickly, many threads may be the solution, but it won't
get
you more than 100% out of any CPU.
Any program's high CPU usage will influence other processes, especially
if that program is run in parallel.
If you think that your rules are consuming an excessive amount of CPU
cycles,
then you might want to check your rules. It is not unheard of that LHS can
be inefficient due to some unfortunate choice of the pattern order.
-W
On Wed, Mar 25, 2009 at 12:16 PM, techy <techluver007(a)gmail.com> wrote:
>
> Thanks for your valuable input.
>
> I did further testing in TEST solaris machine where other apps too are
> running.
>
> 1.In the consumer, I launched 5-10 threads of parallel execution with
> drools
> stateless session. It did performed well with more cpu usage. it
> maintained
> avg cpu usage of 65-70%. occasional spikes went to 85-90%.
> while I was doing this, Other apps contacted me about this and showed
> their
> concern too.
>
> So this brings up another question. Will drools high cpu usage degrade
> other app performance when they are running in same machine & same time?
>
> Thanks again!
>
>
> nheron wrote:
> >
> > Hello,
> > Yes, when running drools, the cpu usages goes high.
> > It is one of the main caracteristic with rule engine : the more cpu you
> > have the quickler it is !!
> > It is normal because all the rete graph & Co are in ram and drools work
> > on it.
> > So there is not wait for database, IO and co so CPU goes very high very
> > quicly but is is normal !
> > All my customers have this surprise : a 4 CPU machine instead one one
> > makes it able to have 4 concurrent drools sessions to work in parallele
> > with the same performance as one session on one CPU !
> > Regards
> > Nicolas Heron
> >
> > Regards
> > Nicolas
> > Le mercredi 25 mars 2009 à 10:05 +0100, Wolfgang Laun a écrit :
> >
> >> The figures you gave just indicate that you have a good balance
> >> between I/O
> >> and CPU load. The increase between "no rules" and "~60
rules" is to be
> >> expected
> >> as all the work is being done during fact insertion. Of course, adding
> >> more and
> >> more rules will, eventually, push the CPU load factor to the natural
> >> upper limit.
> >>
> >> If the overall throughput is good, why do you worry?
> >>
> >> -W
> >>
> >>
> >>
> >> On Tue, Mar 24, 2009 at 11:20 PM, techy <techluver007(a)gmail.com>
> >> wrote:
> >>
> >>
> >> Hello
> >> My app is functioning consumer/producer model.
> >> 1.Producer reads the data from DB and inserts to blocking
> >> queue
> >> 2.Consumer reads the data from queue and execute the rules
> >> using drools
> >> stateless session.
> >> Both producer and consumer run asynchronously.
> >>
> >> in my testing I found the following
> >>
> >> 1. for 1000 facts at a time and no rules in drl, cpu usage is
> >> maintained at
> >> 25-30% in my PC(Intel core 2 CPU,2.13 GH,2G RAM) - with no
> >> rules in drl, Is
> >> this cpu usage acceptable?
> >> 2. for 1000 facts at a time and ~60 rules in drl, cpu usage is
> >> maintained at
> >> 50-60% on the same PC.
> >> 3. If I have 1 sec wait between each execution of rules in
> >> consumer, then
> >> cpu usage is maintained < 5%
> >>
> >> high CPU usage is being big concern to me. Is this expected
> >> while using
> >> drools? Do others see same cpu usage too? Please share your
> >> thoughts.
> >> appreciate your input.
> >>
> >> Thanks
> >>
> >> --
> >> View this message in context:
> >>
http://www.nabble.com/high-cpu-usage-tp22691131p22691131.html
> >> Sent from the drools - user mailing list archive at
> >>
Nabble.com.
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users(a)lists.jboss.org
> >>
https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >>
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users(a)lists.jboss.org
> >>
https://lists.jboss.org/mailman/listinfo/rules-users
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> >
https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/high-cpu-usage-tp22691131p22699498.html
> Sent from the drools - user mailing list archive at
Nabble.com.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @