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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Brett
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
Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator

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
>

--
Reply | Threaded
Open this post in threaded view
|

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

Pierre Smits
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 <
[hidden email]> 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
>>
>>
> --
>
Reply | Threaded
Open this post in threaded view
|

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

Brett
In reply to this post by Jacques Le Roux
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 <
[hidden email]> 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
>>
>>
> --
>
Reply | Threaded
Open this post in threaded view
|

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

Mike Z
In reply to this post by Pierre Smits
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 <[hidden email]> 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 <
> [hidden email]> 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
> >>
> >>
> > --
> >
>
Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
In reply to this post by Brett
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 <
> [hidden email]> 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
>>>
>>>
>> --
>>

--
Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
In reply to this post by Mike Z
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 <[hidden email]> 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 <
>> [hidden email]> 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
>>>>
>>>>
>>> --
>>>

--