[ 
https://issues.apache.org/jira/browse/AMQ-6377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15894658#comment-15894658
 ] 

Christopher L. Shannon edited comment on AMQ-6377 at 3/3/17 4:28 PM:
---------------------------------------------------------------------

[~gtully], Good catch, that was an oversight.  I had chosen to use String to 
store that value because that's how preallocationScope and 
preallocationStrategy work as well.  We can change the member variable to store 
the enum value itself instead of the string representation.  If we did then the 
isEnableJournalDiskSyncs() becomes:

{code:java}
    public boolean isEnableJournalDiskSyncs() {
        return JournalDiskSyncStrategy.ALWAYS.equals(journalDiskSyncStrategy);
    }
{code}

That should be much faster as then it is just an identity check.


was (Author: christopher.l.shannon):
Good catch, that was an oversight.  I had chosen to use String to store that 
value because that's how preallocationScope and preallocationStrategy work as 
well.  We can change the member variable to store the enum value itself instead 
of the string representation.  If we did then the isEnableJournalDiskSyncs() 
becomes:

{code:java}
    public boolean isEnableJournalDiskSyncs() {
        return JournalDiskSyncStrategy.ALWAYS.equals(journalDiskSyncStrategy);
    }
{code}

That should be much faster as then it is just an identity check.

> Introduce a periodic disk sync mode for KahaDB journal
> ------------------------------------------------------
>
>                 Key: AMQ-6377
>                 URL: https://issues.apache.org/jira/browse/AMQ-6377
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker, KahaDB
>    Affects Versions: 5.13.4
>            Reporter: Christopher L. Shannon
>            Assignee: Christopher L. Shannon
>             Fix For: 5.14.0
>
>
> KahaDB has two modes for journal disk syncs, either always sync for each 
> write or never sync.  I'm proposing that we add a third option, a period disk 
> sync. 
> The intended behavior of this would be to run a task in the file appender 
> that would sync the file (if necessary) at some periodic interval (such as 
> every 500 ms, or 1 second, etc) instead of every write.  The file would also 
> be synced on close (on file rollover or shutdown)
> In my testing, syncing every 1 second has been proven to be nearly 
> indistinguishable performance as never disk syncing but is a safer option as 
> you insure that a sync is performed at least once per interval.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to