You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Brett Palmer <br...@gmail.com> on 2014/04/04 18:47:45 UTC

Correct use of the "clustered" property in general.properties files

Ofbiz Users,

We upgraded our version of OFBiz a few months ago and are running through
some performance tests.  We are seeing errors in the
SequenceUtil.getNextSeqId() method when we run load tests with multiple
application servers.  Note: We normally run multiple instances of OFBiz
against the same database in production, but that version of OFBiz is a
couple years old.

In reviewing the code we are seeing a property called "clustered" that
looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
method it uses a "SELECT ... FOR UPDATE" statement to prevent other processes
from modifying the record until the transaction is complete.  We have set
this property to 'Y' and it has resolved our error, but we want to make
sure we are using the "clustered: property correctly.


Here are my questions:

1. In general.properties the property is called "cluster" and its set to
"N".  I can't see any reference to a property "cluster" only to the
property "clustered".  I'm assuming this is a typo in the
general.properties file.  Is that correct?

2.  Does the "clustered" property simply mean that multiple OFBiz
application servers are running or does it mean that we need to configure
our catalina container as a true cluster?  For example, in the
framework/catalina/ofbiz-component.xml file there is a configuration to run
tomcat in a true container cluster.

Thanks in advance for your help on these questions.



Brett

Re: Correct use of the "clustered" property in general.properties files

Posted by Jacques Le Roux <ja...@les7arts.com>.
It should work yes

Jacques

Le 05/04/2014 15:30, Brett Palmer a écrit :
> Jacques,
>
> Thanks for the quick reply.  We also don't use clustering but we do run
> multiple application servers to a single database (e.g.1 to 4).
>
> Am I correct from your response that setting the "clustered" flag to "Y"
> will work with multiple application servers.  We are running into
> sequenceId collisions during load testing without this flag set.  Specially
> we need the following conditional to be true so multiple application
> servers don't update the sequence value concurrently:
>
>
> * if (clustered) {*
>
> * sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
> SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
> "='" + this.seqName + "'" + " FOR UPDATE";     *
>
>
>
> } else {
>
> sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
> SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
> "='" + this.seqName + "'";
>
> }
>
>
> Thanks,
>
>
>
> Brett
>
>
>
>
> On Fri, Apr 4, 2014 at 1:38 PM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
>> Le 04/04/2014 18:47, Brett Palmer a écrit :
>>
>>> Ofbiz Users,
>>>
>>> We upgraded our version of OFBiz a few months ago and are running through
>>> some performance tests.  We are seeing errors in the
>>> SequenceUtil.getNextSeqId() method when we run load tests with multiple
>>> application servers.  Note: We normally run multiple instances of OFBiz
>>> against the same database in production, but that version of OFBiz is a
>>> couple years old.
>>>
>>> In reviewing the code we are seeing a property called "clustered" that
>>> looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
>>> method it uses a "SELECT ... FOR UPDATE" statement to prevent other
>>> processes
>>>
>>> from modifying the record until the transaction is complete.  We have set
>>> this property to 'Y' and it has resolved our error, but we want to make
>>> sure we are using the "clustered: property correctly.
>>>
>>>
>>> Here are my questions:
>>>
>>> 1. In general.properties the property is called "cluster" and its set to
>>> "N".  I can't see any reference to a property "cluster" only to the
>>> property "clustered".  I'm assuming this is a typo in the
>>> general.properties file.  Is that correct?
>>>
>> Yes indeed, that's a typo I introduced. I never noticed it, because I
>> always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
>> Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
>> More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
>> focusedCommentId=13044590
>>
>> Thanks for the typo report. I will fix it. being unnoticed for 3 years, it
>> seems it's no much used or people follow the DCC way.
>>
>>
>>   2.  Does the "clustered" property simply mean that multiple OFBiz
>>> application servers are running or does it mean that we need to configure
>>> our catalina container as a true cluster?  For example, in the
>>> framework/catalina/ofbiz-component.xml file there is a configuration to
>>> run
>>> tomcat in a true container cluster.
>>>
>> I personnaly decided to not change things there (ie to keep the default
>> Tomcat session manager) and to rather use sticky sessions.
>> More about that at http://markmail.org/message/kr72apsujnz4gmqa
>>
>> HTH
>>
>> Jacques
>>
>>
>>   Thanks in advance for your help on these questions.
>>>
>>>
>>> Brett
>>>
>>>
>> --
>>

-- 

Re: Correct use of the "clustered" property in general.properties files

Posted by Brett Palmer <br...@gmail.com>.
Jacques,

Thanks for the quick reply.  We also don't use clustering but we do run
multiple application servers to a single database (e.g.1 to 4).

Am I correct from your response that setting the "clustered" flag to "Y"
will work with multiple application servers.  We are running into
sequenceId collisions during load testing without this flag set.  Specially
we need the following conditional to be true so multiple application
servers don't update the sequence value concurrently:


* if (clustered) {*

* sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
"='" + this.seqName + "'" + " FOR UPDATE";     *



} else {

sql = "SELECT " + SequenceUtil.this.idColName + " FROM " +
SequenceUtil.this.tableName + " WHERE " + SequenceUtil.this.nameColName +
"='" + this.seqName + "'";

}


Thanks,



Brett




On Fri, Apr 4, 2014 at 1:38 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

>
> Le 04/04/2014 18:47, Brett Palmer a écrit :
>
>> Ofbiz Users,
>>
>> We upgraded our version of OFBiz a few months ago and are running through
>> some performance tests.  We are seeing errors in the
>> SequenceUtil.getNextSeqId() method when we run load tests with multiple
>> application servers.  Note: We normally run multiple instances of OFBiz
>> against the same database in production, but that version of OFBiz is a
>> couple years old.
>>
>> In reviewing the code we are seeing a property called "clustered" that
>> looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
>> method it uses a "SELECT ... FOR UPDATE" statement to prevent other
>> processes
>>
>> from modifying the record until the transaction is complete.  We have set
>> this property to 'Y' and it has resolved our error, but we want to make
>> sure we are using the "clustered: property correctly.
>>
>>
>> Here are my questions:
>>
>> 1. In general.properties the property is called "cluster" and its set to
>> "N".  I can't see any reference to a property "cluster" only to the
>> property "clustered".  I'm assuming this is a typo in the
>> general.properties file.  Is that correct?
>>
>
> Yes indeed, that's a typo I introduced. I never noticed it, because I
> always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
> Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
> More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
> focusedCommentId=13044590
>
> Thanks for the typo report. I will fix it. being unnoticed for 3 years, it
> seems it's no much used or people follow the DCC way.
>
>
>  2.  Does the "clustered" property simply mean that multiple OFBiz
>> application servers are running or does it mean that we need to configure
>> our catalina container as a true cluster?  For example, in the
>> framework/catalina/ofbiz-component.xml file there is a configuration to
>> run
>> tomcat in a true container cluster.
>>
>
> I personnaly decided to not change things there (ie to keep the default
> Tomcat session manager) and to rather use sticky sessions.
> More about that at http://markmail.org/message/kr72apsujnz4gmqa
>
> HTH
>
> Jacques
>
>
>  Thanks in advance for your help on these questions.
>>
>>
>>
>> Brett
>>
>>
> --
>

Re: Correct use of the "clustered" property in general.properties files

Posted by Jacques Le Roux <ja...@les7arts.com>.
Le 05/04/2014 19:40, Mike a écrit :
> Or nobody performed load tests using multiple front-ends to a single DB.

This setting is now used for 3 years on a cluster with 5 (modified but not the core, nor specifically this part) OFBiz front end (ecommerce style) 
servers running on a single DB sustained by 3 Postgres servers (using PgPool).
We previously did some load tests which, as expected, proved the bottleneck keeps to be the DB.

>   However, I don't understand the difference between this and the
> Distributed Entity Cache Clear that Jacques mentioned.  Does DCC maintain
> unique sequences?

Please read about DCC in the wiki. It does not maintain unique sequences but guarantees each Entity Engine instance has the same view of the 
distributed cache at any moment by clearing other servers caches when one does (ActiveMQ doing the broadcast to OFBiz DCC services). The clustered 
property just guarantees that SELECT FOR UPDATE will be used in a clustered environment (with or w/o DCC, but once DCC is used SELECT FOR UPDATE is  
needed because we know we are then in a clustered environment so then setting the clustered property would be redundant, though possible.)

I hope I'm clear enough

Jacques

>
> On Sat, Apr 5, 2014 at 3:23 AM, Pierre Smits <pi...@gmail.com> wrote:
>
>> Jacques,
>>
>> This may indicate that clustering is not widely used in the OFBiz
>> community.
>>
>> Regards,
>>
>>
>>
>> Pierre Smits
>>
>> *ORRTIZ.COM <http://www.orrtiz.com>*
>> Services & Solutions for Cloud-
>> Based Manufacturing, Professional
>> Services and Retail & Trade
>> http://www.orrtiz.com
>>
>>
>> On Fri, Apr 4, 2014 at 9:38 PM, Jacques Le Roux <
>> jacques.le.roux@les7arts.com> wrote:
>>
>>> Le 04/04/2014 18:47, Brett Palmer a écrit :
>>>
>>>   Ofbiz Users,
>>>> We upgraded our version of OFBiz a few months ago and are running
>> through
>>>> some performance tests.  We are seeing errors in the
>>>> SequenceUtil.getNextSeqId() method when we run load tests with multiple
>>>> application servers.  Note: We normally run multiple instances of OFBiz
>>>> against the same database in production, but that version of OFBiz is a
>>>> couple years old.
>>>>
>>>> In reviewing the code we are seeing a property called "clustered" that
>>>> looks like a possible solution for us.  In the
>> SequenceUtil.getNextSeqId()
>>>> method it uses a "SELECT ... FOR UPDATE" statement to prevent other
>>>> processes
>>>> from modifying the record until the transaction is complete.  We have
>> set
>>>> this property to 'Y' and it has resolved our error, but we want to make
>>>> sure we are using the "clustered: property correctly.
>>>>
>>>>
>>>> Here are my questions:
>>>>
>>>> 1. In general.properties the property is called "cluster" and its set to
>>>> "N".  I can't see any reference to a property "cluster" only to the
>>>> property "clustered".  I'm assuming this is a typo in the
>>>> general.properties file.  Is that correct?
>>>>
>>> Yes indeed, that's a typo I introduced. I never noticed it, because I
>>> always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
>>> Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
>>> More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
>>> focusedCommentId=13044590
>>>
>>> Thanks for the typo report. I will fix it. being unnoticed for 3 years,
>> it
>>> seems it's no much used or people follow the DCC way.
>>>
>>>
>>>   2.  Does the "clustered" property simply mean that multiple OFBiz
>>>> application servers are running or does it mean that we need to
>> configure
>>>> our catalina container as a true cluster?  For example, in the
>>>> framework/catalina/ofbiz-component.xml file there is a configuration to
>>>> run
>>>> tomcat in a true container cluster.
>>>>
>>> I personnaly decided to not change things there (ie to keep the default
>>> Tomcat session manager) and to rather use sticky sessions.
>>> More about that at http://markmail.org/message/kr72apsujnz4gmqa
>>>
>>> HTH
>>>
>>> Jacques
>>>
>>>
>>>   Thanks in advance for your help on these questions.
>>>>
>>>>
>>>> Brett
>>>>
>>>>
>>> --
>>>

-- 

Re: Correct use of the "clustered" property in general.properties files

Posted by Mike <mz...@gmail.com>.
Or nobody performed load tests using multiple front-ends to a single DB.
 However, I don't understand the difference between this and the
Distributed Entity Cache Clear that Jacques mentioned.  Does DCC maintain
unique sequences?


On Sat, Apr 5, 2014 at 3:23 AM, Pierre Smits <pi...@gmail.com> wrote:

> Jacques,
>
> This may indicate that clustering is not widely used in the OFBiz
> community.
>
> Regards,
>
>
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
>
> On Fri, Apr 4, 2014 at 9:38 PM, Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
> >
> > Le 04/04/2014 18:47, Brett Palmer a écrit :
> >
> >  Ofbiz Users,
> >>
> >> We upgraded our version of OFBiz a few months ago and are running
> through
> >> some performance tests.  We are seeing errors in the
> >> SequenceUtil.getNextSeqId() method when we run load tests with multiple
> >> application servers.  Note: We normally run multiple instances of OFBiz
> >> against the same database in production, but that version of OFBiz is a
> >> couple years old.
> >>
> >> In reviewing the code we are seeing a property called "clustered" that
> >> looks like a possible solution for us.  In the
> SequenceUtil.getNextSeqId()
> >> method it uses a "SELECT ... FOR UPDATE" statement to prevent other
> >> processes
> >> from modifying the record until the transaction is complete.  We have
> set
> >> this property to 'Y' and it has resolved our error, but we want to make
> >> sure we are using the "clustered: property correctly.
> >>
> >>
> >> Here are my questions:
> >>
> >> 1. In general.properties the property is called "cluster" and its set to
> >> "N".  I can't see any reference to a property "cluster" only to the
> >> property "clustered".  I'm assuming this is a typo in the
> >> general.properties file.  Is that correct?
> >>
> >
> > Yes indeed, that's a typo I introduced. I never noticed it, because I
> > always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
> > Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
> > More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
> > focusedCommentId=13044590
> >
> > Thanks for the typo report. I will fix it. being unnoticed for 3 years,
> it
> > seems it's no much used or people follow the DCC way.
> >
> >
> >  2.  Does the "clustered" property simply mean that multiple OFBiz
> >> application servers are running or does it mean that we need to
> configure
> >> our catalina container as a true cluster?  For example, in the
> >> framework/catalina/ofbiz-component.xml file there is a configuration to
> >> run
> >> tomcat in a true container cluster.
> >>
> >
> > I personnaly decided to not change things there (ie to keep the default
> > Tomcat session manager) and to rather use sticky sessions.
> > More about that at http://markmail.org/message/kr72apsujnz4gmqa
> >
> > HTH
> >
> > Jacques
> >
> >
> >  Thanks in advance for your help on these questions.
> >>
> >>
> >>
> >> Brett
> >>
> >>
> > --
> >
>

Re: Correct use of the "clustered" property in general.properties files

Posted by Pierre Smits <pi...@gmail.com>.
Jacques,

This may indicate that clustering is not widely used in the OFBiz community.

Regards,



Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Fri, Apr 4, 2014 at 9:38 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

>
> Le 04/04/2014 18:47, Brett Palmer a écrit :
>
>  Ofbiz Users,
>>
>> We upgraded our version of OFBiz a few months ago and are running through
>> some performance tests.  We are seeing errors in the
>> SequenceUtil.getNextSeqId() method when we run load tests with multiple
>> application servers.  Note: We normally run multiple instances of OFBiz
>> against the same database in production, but that version of OFBiz is a
>> couple years old.
>>
>> In reviewing the code we are seeing a property called "clustered" that
>> looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
>> method it uses a "SELECT ... FOR UPDATE" statement to prevent other
>> processes
>> from modifying the record until the transaction is complete.  We have set
>> this property to 'Y' and it has resolved our error, but we want to make
>> sure we are using the "clustered: property correctly.
>>
>>
>> Here are my questions:
>>
>> 1. In general.properties the property is called "cluster" and its set to
>> "N".  I can't see any reference to a property "cluster" only to the
>> property "clustered".  I'm assuming this is a typo in the
>> general.properties file.  Is that correct?
>>
>
> Yes indeed, that's a typo I introduced. I never noticed it, because I
> always used a DCC https://cwiki.apache.org/confluence/display/OFBIZ/
> Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
> More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?
> focusedCommentId=13044590
>
> Thanks for the typo report. I will fix it. being unnoticed for 3 years, it
> seems it's no much used or people follow the DCC way.
>
>
>  2.  Does the "clustered" property simply mean that multiple OFBiz
>> application servers are running or does it mean that we need to configure
>> our catalina container as a true cluster?  For example, in the
>> framework/catalina/ofbiz-component.xml file there is a configuration to
>> run
>> tomcat in a true container cluster.
>>
>
> I personnaly decided to not change things there (ie to keep the default
> Tomcat session manager) and to rather use sticky sessions.
> More about that at http://markmail.org/message/kr72apsujnz4gmqa
>
> HTH
>
> Jacques
>
>
>  Thanks in advance for your help on these questions.
>>
>>
>>
>> Brett
>>
>>
> --
>

Re: Correct use of the "clustered" property in general.properties files

Posted by Jacques Le Roux <ja...@les7arts.com>.
Le 04/04/2014 18:47, Brett Palmer a écrit :
> Ofbiz Users,
>
> We upgraded our version of OFBiz a few months ago and are running through
> some performance tests.  We are seeing errors in the
> SequenceUtil.getNextSeqId() method when we run load tests with multiple
> application servers.  Note: We normally run multiple instances of OFBiz
> against the same database in production, but that version of OFBiz is a
> couple years old.
>
> In reviewing the code we are seeing a property called "clustered" that
> looks like a possible solution for us.  In the SequenceUtil.getNextSeqId()
> method it uses a "SELECT ... FOR UPDATE" statement to prevent other processes
> from modifying the record until the transaction is complete.  We have set
> this property to 'Y' and it has resolved our error, but we want to make
> sure we are using the "clustered: property correctly.
>
>
> Here are my questions:
>
> 1. In general.properties the property is called "cluster" and its set to
> "N".  I can't see any reference to a property "cluster" only to the
> property "clustered".  I'm assuming this is a typo in the
> general.properties file.  Is that correct?

Yes indeed, that's a typo I introduced. I never noticed it, because I always used a DCC 
https://cwiki.apache.org/confluence/display/OFBIZ/Distributed+Entity+Cache+Clear+%28DCC%29+Mechanism in a clustered env.
More is explained at https://issues.apache.org/jira/browse/OFBIZ-2353?focusedCommentId=13044590

Thanks for the typo report. I will fix it. being unnoticed for 3 years, it seems it's no much used or people follow the DCC way.

> 2.  Does the "clustered" property simply mean that multiple OFBiz
> application servers are running or does it mean that we need to configure
> our catalina container as a true cluster?  For example, in the
> framework/catalina/ofbiz-component.xml file there is a configuration to run
> tomcat in a true container cluster.

I personnaly decided to not change things there (ie to keep the default Tomcat session manager) and to rather use sticky sessions.
More about that at http://markmail.org/message/kr72apsujnz4gmqa

HTH

Jacques

> Thanks in advance for your help on these questions.
>
>
>
> Brett
>

--