Openfire 4.6.0 and above - Delay in openfire startup

I have been experiencing a delay in openfire startup, its taking close to 10 -15 mins to come up. On troubleshooting, Its observed that Openfire is taking long time to load pubsub nodes.

2022.04.05 15:52:22 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for File Transfer
2022.04.05 15:52:22 WARN [main]: org.jivesoftware.util.LocaleUtils - Missing resource for key: system_property.provider.pubsub-persistence.className in locale en
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubPersistenceProviderManager - Clustering is enabled. Falling back to non-cached provider
2022.04.05 15:52:22 INFO [main]: org.jivesoftware.openfire.pubsub.PubSubPersistenceProviderManager - Loading PubSub persistence provider: class org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.
2022.04.05 15:52:22 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Default Node Configurations
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - Initializing
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Initializing using service name: ‘pubsub’
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - Loading nodes for service: pubsub
2022.04.05 16:00:45 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Load root collection node (’’) from database.
2022.04.05 16:00:45 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Disco Server Features

Further found that my Openfire(4.6.0) instance has 63,000 nodes. I tested with 4000 nodes and that started without delay. As I understand, the delay occurred as Openfire has more number of nodes to be loaded. Tested 63,000 nodes with Openfire 4.5.4 and that coming up fast.

Have taken a look at the code and I see that in 4.6.0, the loading nodes and node affiliations are changed. From my debug, I could see the potential cause of the issue is in the ‘lookupNode’ function of Class DefaultPubSubPersistenceProvider.

Sorry to hear that, Amarnath. Have you tried this with the latest release? If I recall correctly, some pubsub optimizations were added to that? If this problem persists in Openfire 4.7.1, I’ll raise a ticket for us to work on improving the performance of Pubsub loading.

Hi Guus,

Thanks for the reply.
I tried with Openfire 4.7.1 and I still see the problem.

2022.04.05 23:12:54 DEBUG [main]: org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - Loading nodes for service: pubsub

2022.04.05 23:20:27 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Load root collection node (’’) from database.

Thanks for checking. I have created this issue for this problem: [OF-2427] - Ignite Realtime Jira

Prior to you reporting this issue, a side-ways related issue was fixed in Openfire:

There isn’t an Openfire release yet that contains this fix. It is in the nightly builds, though. @janapati10 are you able to verify if your problem is fixed by this change?