Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Handling a large number of redirections can indeed lead to high memory usage, especially when performing regex matches. Here are some suggestions to optimize this:
1. Review your redirections and ensure there are no unnecessary and chained redirections.
2. If regex matching is not critical for your use case, consider using exact matching instead. This significantly reduces the load on the database and improves performance.
3. If the issue persists, consider increasing the memory limit temporarily or offloading redirections to the server level (e.g., .htaccess or nginx).
4. Also ensure your database is indexed properly for the redirection table. Adding an index on the URI column, for instance, could speed up queries and reduce memory consumption.
You may also try the following plugin to create indexes on the database to speed up the MySQL calls: https://wordpress.org/plugins/index-wp-mysql-for-speed/
If you decide to try that plugin, please take a complete backup before trying it as it will modify the database.
We hope this helps. Please let us know if you have further questions or concerns.
Thank you.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.