High CPU usage with redirects enabled
-
Hi,
I have a site with about 17,000 redirects (unfortunately they have to be unique, as the old site we migrated from has no patternable structure to the old URLs).
I have imported the redirects in groups of 2,000, and when I go above about 7,000-8,000, the MySQL process on my server starts to run high when traffic to my site increases.
An example redirect regex I have (there are about 15,500 of these) is:
/(oldsite|newsite)/article/(optional-article-slug-here/)?5556/?I know it’s a lot of redirects, but just wondered if there’s anything I can do differently in the plugin to make it faster? For example:
1. Should I use the Apache module instead of WordPress?
2. Would a stricter regex on each redirect help? E.g. defining the start and end of each URL precisely using ^ and $ respectively?
3. Are there any other optimisations I could make?Our server is pretty powerful (an Amazon Lightsail instance, with 8 vCPUs, 32GB RAM) but it’s just the MySQL process that struggles when all the redirects are enabled.
Thanks very much for any advice!
The topic ‘High CPU usage with redirects enabled’ is closed to new replies.