10 seconds wait time for kahadb lock

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

10 seconds wait time for kahadb lock

Pvbouwel
Is there a reason why it is not possible to set the timeout for brokers who want to acquire a lock on the kahadb?

When I look into the source code (KahaPersistenceAdapter.java).  I see:

    private static final int STORE_LOCKED_WAIT_DELAY = 10 * 1000;

I wanted to set this wait_delay using a configuration parameter but this isn't possible.  

Is there a special reason why this is the case?  What will happen if I modify the value in code and I recompile?  Will everything still work?

Greetings,

Peter
Reply | Threaded
Open this post in threaded view
|

Re: 10 seconds wait time for kahadb lock

dejanb
If you're trying to use KahaDB than

<kahaDB databaseLockedWaitDelay="xxx" ... />

should work for you

Regards
--
Dejan Bosanac
Senior Software Engineer | FuseSource Corp.
[hidden email] | fusesource.com
skype: dejan.bosanac | twitter: @dejanb
blog: http://www.nighttale.net
ActiveMQ in Action: http://www.manning.com/snyder/



On Tue, Mar 20, 2012 at 12:19 PM, Pvbouwel <[hidden email]>wrote:

> Is there a reason why it is not possible to set the timeout for brokers who
> want to acquire a lock on the kahadb?
>
> When I look into the source code (KahaPersistenceAdapter.java).  I see:
>
>    private static final int STORE_LOCKED_WAIT_DELAY = 10 * 1000;
>
> I wanted to set this wait_delay using a configuration parameter but this
> isn't possible.
>
> Is there a special reason why this is the case?  What will happen if I
> modify the value in code and I recompile?  Will everything still work?
>
> Greetings,
>
> Peter
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/10-seconds-wait-time-for-kahadb-lock-tp4488418p4488418.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: 10 seconds wait time for kahadb lock

Pvbouwel
If I try that I get the following error:

 Attribute 'databaseLockWaitDelay' is not allowed to appear in element 'kahaDB'

By the way: I am using activemq-5.4.3.
Reply | Threaded
Open this post in threaded view
|

Re: 10 seconds wait time for kahadb lock

Pvbouwel
OK, apparently you had a little typo.  It should be:

   databaseLockedWaitDelay

Thanks a lot!  Now I can do exactly what I wanted to do!
Reply | Threaded
Open this post in threaded view
|

Re: 10 seconds wait time for kahadb lock

Pvbouwel
To be clear for other people wanting to change the wait time for kahadb lock:  dejanb his answer was 100 % correct.  I had a typo in my configuration file. If you want to change the time-out just change persistenceAdapter in your activemq.xml to look like:

  <persistenceAdapter>
            <kahaDB databaseLockedWaitDelay="1000" directory="${activemq.base}/data/kahadb"/>
  </persistenceAdapter>

The value of databaseLockedWaitDelay is in miliseconds so this configuration will wait 1 second before trying a new attempt to get the lock.
Reply | Threaded
Open this post in threaded view
|

stop ML

Nishizawa Kenji
 To remove your address from the list, send a message to:
   <[hidden email]>

not mail stop
Reply | Threaded
Open this post in threaded view
|

Re: 10 seconds wait time for kahadb lock

dejanb
In reply to this post by Pvbouwel
Thanks for closing the loop!

Regards
--
Dejan Bosanac
Senior Software Engineer | FuseSource Corp.
[hidden email] | fusesource.com
skype: dejan.bosanac | twitter: @dejanb
blog: http://www.nighttale.net
ActiveMQ in Action: http://www.manning.com/snyder/



On Wed, Mar 21, 2012 at 8:49 AM, Pvbouwel <[hidden email]>wrote:

> To be clear for other people wanting to change the wait time for kahadb
> lock:
> dejanb his answer was 100 % correct.  I had a typo in my configuration
> file.
> If you want to change the time-out just change persistenceAdapter in your
> activemq.xml to look like:
>
>
>
> The value of databaseLockedWaitDelay is in miliseconds so this
> configuration
> will wait 1 second before trying a new attempt to get the lock.
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/10-seconds-wait-time-for-kahadb-lock-tp4488418p4491519.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re:Re: 10 seconds wait time for kahadb lock

DepestBlue
Could you please to interpret how the parameter affect the performance of ActiveMQ?


thanks a lot,
Zhuran Li



At 2012-03-21 22:54:14,"Dejan Bosanac" <[hidden email]> wrote:

>Thanks for closing the loop!
>
>Regards
>--
>Dejan Bosanac
>Senior Software Engineer | FuseSource Corp.
>[hidden email] | fusesource.com
>skype: dejan.bosanac | twitter: @dejanb
>blog: http://www.nighttale.net
>ActiveMQ in Action: http://www.manning.com/snyder/
>
>
>
>On Wed, Mar 21, 2012 at 8:49 AM, Pvbouwel <[hidden email]>wrote:
>
>> To be clear for other people wanting to change the wait time for kahadb
>> lock:
>> dejanb his answer was 100 % correct.  I had a typo in my configuration
>> file.
>> If you want to change the time-out just change persistenceAdapter in your
>> activemq.xml to look like:
>>
>>
>>
>> The value of databaseLockedWaitDelay is in miliseconds so this
>> configuration
>> will wait 1 second before trying a new attempt to get the lock.
>>
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/10-seconds-wait-time-for-kahadb-lock-tp4488418p4491519.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
Reply | Threaded
Open this post in threaded view
|

Re: Re:Re: 10 seconds wait time for kahadb lock

Pvbouwel
I haven't done any real testing regarding performance but I don't think the parameter would impact the performance greatly?

The Broker that has the lock can just continue working with the kahadb (as if there was no slave).  And the Slave is polling the the kahadb more often (more requests to the shared Filesystem)  but those requests shouldn't eat a lot of bandwidth.  It will only check whether the file is still locked.  But performance impact will be very different from system to system so I guess you should test it on a setup for which you want to know the impact.

Anywasy for testing I do recommend to chose an appropriate loglevel otherwise you will get a lot of entries like " INFO | Database /opt/amq/data/kahadb/lock is locked... waiting 0 seconds for the database to be unlocked. Reason: java.io.IOException: File '/opt/amq/data/kahadb/lock' could not be locked.".   So make sure you don't log INFO messages :-).

If I find the time to do some testing, I'll post the results.