OnTheGoSystems / wpml-elasticpress

WPML ElasticPress adds support for languages in ElasticPress.
GNU General Public License v3.0
10 stars 3 forks source link

Performance impact on "save_post" actions #48

Closed alexanderaltendorfer closed 2 months ago

alexanderaltendorfer commented 3 months ago

This plugin appears to have a major performance impact when saving posts. This is caused by multiple remote requests to the ElasticSearch endpoint. For each language, there are two calls to index_exists and one call to bulk_index. In our case, this results in 12 (!) remote calls, each costing around 500ms of loading time.

I understand the need for calling bulk_index for each language, but index_exists should not be called this often, or its result should be cached. All the calls to index_exists appear to be caused by WPML\ElasticPress\Sync\Singular::manageSyncQueue. With wpml-elasticpress disabled, this endpoint is not called at all when saving a post.

I appreciate you looking into this, as our editors are complaining about slow performance when they are working in wp-admin.

decodekult commented 3 months ago

Hi Alexander.

Thanks for your report. I already created a ticket in our internal tracking system to review and address this issue. For reference, it is named wpmlbridge-300

I will update here once we have a suitable solution, or at least some news to share.

Regards.