A couple of days ago I received a message from my hosting company saying my bandwidth usage was 80%.
Yesterday I received the
Error 509 Bandwidth limit exceeded message.
I increased my allowance then tried to track down the cause of the problem.
It turned out that a site had been hotlinking one of my images… stealing bandwidth.
You know who you are. Don’t do it!
Finding the problem
First off I looked at my trace summary records. But couldn’t see anything there. Then I looked at my Apache server access log.
I noticed thousands of requests for the same image. With all of the requests coming from the same referrer. I visited the referrer site and found that my image was being displayed in the site’s header.
To date it had been loaded over 700,000 times.
Fixing the problem
I decided to put a stop to it.
First off I replaced the image with a 100 byte menu item separator.
Then, having read the altlab’s articles, I added a redirect to display this image instead.
Having decided to re-enable the correct display of the image when viewed from my site, but prevent the offending site from loading the image, I discovered that Jetpack’s Photon module had now cached the target image of the redirection.
I’ve now created a smaller, lower quality version of the image and updated my pages to use this new image.
Any requests for the original image will be handled as follows:
- The offending site will get the redirected image
- Other sites will get the menu bar separator
What’s also a bit of a shame is that Jetpack’s Photon module had not been able to intercept the many thousands of requests to my image.
So I’ve learnt something…
even though you use a CDN, you’re not protected from bandwidth theft