powered by Jive Software

Pubsub cache issue

I have openfire pubsub db populated with 5 million subscriptions. now when I restart openfire, it randomly throws ‘node not found’ for some nodes. If I restart again a different set of nodes start throwing this error. Seems like a cache issue. Is there a way to increase the pubsub cache in openfire?

Shouldn’t it be looking up nodes from db when it is not found in cache instead of returning node not found? When I reduce the number of subscriptions to 3million, it seems to work fine. The number of nodes is around 100K in both these cases. I am using Oracle Enterprise Edition for the db. Any help is greatly appreciated.

Thanks,

Nithya

Found the issue after looking into other forum discussions and code. Seems like the thread that loops through the db data and copies it to memory (there is no cache type of interaction) had a maximum active time for 5 minutes. Changed the following lines in

org.jivesoftware.database.DefaultConnectionProvider

private long activeTimeout = 7200000;

In the start() method:

settings.setProperty(“proxool.maximum-active-time”, Long.toString(activeTimeout));

or if you want it to be configurable from admin console:

settings.setProperty(“proxool.maximum-active-time”, JiveGlobals.getProperty(“dbthread.maximum.active.time”, Long.toString(activeTimeout)).toLowerCase());

Thanks,

Nithya

Please provide it as a .patch file.

Hi Nithya,

does it mean that Openfire uses one database connection for 5 minutes and then the database timeout does occur?

While it may be a quick fix to increase the timeout I wonder whether it would be better to optimize the query. Does it load all nodes into memory? This may be a bad idea, depending on the usage as a lot of memory may be needed.

LG

There are definitely issues with the pubsub memory usage. I was not aware of this particular issue, but I have logged another one related to persistent nodes. All items are loaded into memory from all nodes. It is logged as OF-39.

There are several issues related to memory and threading in the current implementation that will cause scalability issues.