Initial load of MUCRoom service properties is inefficient

Description

https://github.com/igniterealtime/Openfire/pull/1394

 

Hi, I tested Openfire 4.2.3 with 200,000 MUC rooms. And I found out loading MUC rooms can be very slow in proportion to the number of rooms. In my case, it needed over 1 hour to start Openfire.
I identified the cause in MUCPersistenceManager. (This problem still exists in Openfire 4.3 or later)

  • After fetching MUC rooms from {{ofmucroom}} table, each {{LocalMUCRoom}} loads its default properties from {{ofmucserviceprop}} table with MUCPersistenceManager. This process calls {{SELECT}} SQL about 200,000 * 12 times (the 12 is the number of LocalMUCRoom.xxx fields). In the end, the more MUC rooms the more time needed.

I tweaked MUCPersistenceManager.getProperty just a little bit.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created June 17, 2019 at 4:31 PM
Updated June 20, 2019 at 5:20 PM
Resolved June 20, 2019 at 5:20 PM