How to change default entity sequencer increment of 10

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

How to change default entity sequencer increment of 10

Brett
We are running a mysql 5.x database with 4 applications servers on the same
db.  We use the GenericDelegator.getNextSeqId() a lot in our code and simple
methods.  The default is for the sequencer to increment by 10 but under
heavy loads we are seeing the SequenceValueItem table get really hot with
updates that lock.

We would like to avoid the frequency of locks on this table by increasing
the increment from 10 to 100 or bigger.

Is this done in a configuration file?  I see a method
 GenericDelegator.getNextSeqId(seqName, staggerMax) that would probably work
but is this also available in a simple method.

Thanks,


Brett
Reply | Threaded
Open this post in threaded view
|

Re: How to change default entity sequencer increment of 10

David E. Jones-2

This is currently configured per entity. On the entity definition there is a sequence-bank-size attribute you can use to increase this to 100 or whatever.

BTW, which version of OFBiz are you using? Getting sequence IDs should be in a separate transaction from your main transaction, but of course even with a tiny transaction like that conflicts could occur.

-David


On Dec 12, 2009, at 11:26 AM, Brett Palmer wrote:

> We are running a mysql 5.x database with 4 applications servers on the same
> db.  We use the GenericDelegator.getNextSeqId() a lot in our code and simple
> methods.  The default is for the sequencer to increment by 10 but under
> heavy loads we are seeing the SequenceValueItem table get really hot with
> updates that lock.
>
> We would like to avoid the frequency of locks on this table by increasing
> the increment from 10 to 100 or bigger.
>
> Is this done in a configuration file?  I see a method
> GenericDelegator.getNextSeqId(seqName, staggerMax) that would probably work
> but is this also available in a simple method.
>
> Thanks,
>
>
> Brett

Reply | Threaded
Open this post in threaded view
|

Re: How to change default entity sequencer increment of 10

Brett
David,

We are at revision 806775 of the trunk.

We mostly use the sequencer through simple methods using the "<sequence-id..
" command.  I had assumed this was done in a separate transaction but is
that not the case?  What is the recommended way to generate unique IDs for
entities using simple methods?  Do we need to create separate services for
getting the ID and call that in a separate transaction?


Brett


On Sat, Dec 12, 2009 at 2:44 PM, David E Jones <[hidden email]> wrote:

>
> This is currently configured per entity. On the entity definition there is
> a sequence-bank-size attribute you can use to increase this to 100 or
> whatever.
>
> BTW, which version of OFBiz are you using? Getting sequence IDs should be
> in a separate transaction from your main transaction, but of course even
> with a tiny transaction like that conflicts could occur.
>
> -David
>
>
> On Dec 12, 2009, at 11:26 AM, Brett Palmer wrote:
>
> > We are running a mysql 5.x database with 4 applications servers on the
> same
> > db.  We use the GenericDelegator.getNextSeqId() a lot in our code and
> simple
> > methods.  The default is for the sequencer to increment by 10 but under
> > heavy loads we are seeing the SequenceValueItem table get really hot with
> > updates that lock.
> >
> > We would like to avoid the frequency of locks on this table by increasing
> > the increment from 10 to 100 or bigger.
> >
> > Is this done in a configuration file?  I see a method
> > GenericDelegator.getNextSeqId(seqName, staggerMax) that would probably
> work
> > but is this also available in a simple method.
> >
> > Thanks,
> >
> >
> > Brett
>
>
Reply | Threaded
Open this post in threaded view
|

Re: How to change default entity sequencer increment of 10

David E. Jones-2

That uses a separate transaction pretty far down in the sequence util code. So, no, there is no need to put it in a separate transaction higher up.

On the other hand, if you're using the current code and running into lots of conflicts it could be totally valid conflicts, or it could be that we could improve the code some how and mitigate the issue.

-David


On Dec 12, 2009, at 5:27 PM, Brett Palmer wrote:

> David,
>
> We are at revision 806775 of the trunk.
>
> We mostly use the sequencer through simple methods using the "<sequence-id..
> " command.  I had assumed this was done in a separate transaction but is
> that not the case?  What is the recommended way to generate unique IDs for
> entities using simple methods?  Do we need to create separate services for
> getting the ID and call that in a separate transaction?
>
>
> Brett
>
>
> On Sat, Dec 12, 2009 at 2:44 PM, David E Jones <[hidden email]> wrote:
>
>>
>> This is currently configured per entity. On the entity definition there is
>> a sequence-bank-size attribute you can use to increase this to 100 or
>> whatever.
>>
>> BTW, which version of OFBiz are you using? Getting sequence IDs should be
>> in a separate transaction from your main transaction, but of course even
>> with a tiny transaction like that conflicts could occur.
>>
>> -David
>>
>>
>> On Dec 12, 2009, at 11:26 AM, Brett Palmer wrote:
>>
>>> We are running a mysql 5.x database with 4 applications servers on the
>> same
>>> db.  We use the GenericDelegator.getNextSeqId() a lot in our code and
>> simple
>>> methods.  The default is for the sequencer to increment by 10 but under
>>> heavy loads we are seeing the SequenceValueItem table get really hot with
>>> updates that lock.
>>>
>>> We would like to avoid the frequency of locks on this table by increasing
>>> the increment from 10 to 100 or bigger.
>>>
>>> Is this done in a configuration file?  I see a method
>>> GenericDelegator.getNextSeqId(seqName, staggerMax) that would probably
>> work
>>> but is this also available in a simple method.
>>>
>>> Thanks,
>>>
>>>
>>> Brett
>>
>>