Search code examples
phpwordpressnewrelic

Some random image transaction showing on New Relic for Wordpress


I recently configured New Relic for my server which runs our retail site powered by Magento and blog powered by Wordpress.

The most time consuming transaction I see is "/image" and I am unable to understand what it is and how to fix it.

Wordpress runs on www.mydomain.com/blog/

Please check the following screenshots of my New Relic panel.

  • Transactions

/image is 54.4% on the time consumption chart.

  • Server breakdown

enter image description here

  • Transaction traces

enter image description here

Can you help me understand what is happening so I can debug and fix it?


Solution

  • I found the problem after digging into attachments.

    After uploading media, Wordpress creates an attachment page for them, like so:

    www.mydomain.com/blog/?attachment_id=xxxx

    The template loaded by Wordpress for this type of page is:

    /wp-content/themes/your-theme/image.php

    There were TONS of comments on the page and it was making close to 4300 HTTP calls to my server per each attachment page.

    Solution:

    I simply redirected these pages to the home page since I do not want such pages to show up.