powered by Jive Software

"Queue full" and Openfire insert query performance

Hi

I faced the error following recently.

java.lang.IllegalStateException: Queue full

at java.util.AbstractQueue.add(AbstractQueue.java:98)

at org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl.logConversation(Mult iUserChatServiceImpl.java:1422)

at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.broadcast(LocalMUCRoom.java:1264 )

at org.jivesoftware.openfire.muc.cluster.BroadcastMessageRequest$1.run(BroadcastMe ssageRequest.java:72)

at org.jivesoftware.openfire.muc.cluster.MUCRoomTask.execute(MUCRoomTask.java:85)

at org.jivesoftware.openfire.muc.cluster.BroadcastMessageRequest.run(BroadcastMess ageRequest.java:69)

When I checked source code, there is limit number of queue size.

Openfire/MultiUserChatServiceImpl.java at master · igniterealtime/Openfire · GitHub

private Queue logQueue = new LinkedBlockingQueue<>(100000);

Is there any reason that queue size is 100000 ?

And, seems “logConversation” method call insert query for each 1 record.

but there are log data.

Cannot use batch insert to increase performance ?

Openfire/MultiUserChatServiceImpl.java at master · igniterealtime/Openfire · GitHub

private void logConversation() {

ConversationLogEntry entry;

boolean success;

for (int index = 0; index <= log_batch_size && !logQueue.isEmpty(); index++) {

entry = logQueue.poll();

if (entry != null) {

success = MUCPersistenceManager.saveConversationLogEntry(entry);

if (!success) {

logQueue.add(entry);

}

}

}

}

private void logAllConversation() {

ConversationLogEntry entry;

while (!logQueue.isEmpty()) {

entry = logQueue.poll();

if (entry != null) {

MUCPersistenceManager.saveConversationLogEntry(entry);

}

}

}

Thanks gaku

You should see about speeding up your database or decrease the commit interval via the Openfire system property xmpp.muc.tasks.log.timeout