[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Do we need JournalStorageManager::ADD_MESSAGE?
clebert.suconic@jboss.com
do-not-reply at jboss.com
Thu May 8 16:04:45 EDT 2008
The Buffers were being created about 3 times for the AddMessage
| MessagingBuffer buffer = new BufferWrapper(1024); // 1st
| buffer.putByte(ADD_MESSAGE);
| // this would
| buffer.putBytes(message.encode().array()); //2nd
| messageJournal.appendAddRecord(message.getMessageID(), buffer.array()); // 3rd
|
With this code, a class calling JournalStorageManager directly was performing about 30K inserts, with intermediate commits (what would require them to wait).
I have made few changes:
I have introduced an interface EncondingSupport:
public interface EncodingSupport
| {
| int encodeSize();
| void encode(MessagingBuffer buffer);
| }
|
And on the Journal it's possible to pass an Encodingsupport. With that it is possible to avoid at least few copies, writing to the final and necessary buffer only. (before calling journal.append).
I could get twice about 60K writes/second.
I know the transport now won't let me go above 8K / second based on NonPersistentMessages (on my computer at least)... but even that way I got some higher numbers on few tests I made.
I'm still not ready to commit though... it should be another day :-)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4149572#4149572
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4149572
More information about the jboss-dev-forums
mailing list