# Maaah! How I Killed My Site With a Goat GIF

Source: https://djangotv.com/videos/wagtail-cms/2023/lightning-talk-maaah-how-i-killed-my-site-with-a-goat-gif/
Date: 2023-07-14
Speakers: Meagen Voss

## Summary

Meagen Voss describes how adding an animated GIF of goats to her blog on a 512 MB DigitalOcean server caused her site to break, with parts of the backend and frontend failing. She restored the site from a droplet backup, then reproduced the failure to investigate; she learned that an animated GIF’s frame rate, not just its file size, can strain a server, especially one with little memory. She recommends keeping backups, avoiding undersized servers, and considering video or no animation instead of GIFs.

## Transcript

### [00:00] The Testing Goat GIF

[00:04] Hi, I'm Megan. I work for a UK agency called Torchbox. We're the creators of a Python-powered CMS called Wagtail. And I'm not going to talk to you about Wagtail so much today as how I personally broke my own website in a very in a way where I learned some lessons. So, you know, that's my social media. Feel free to follow me and come check the things out that I do. Anyway, this all started out when I wrote a blog about testing your Python code. So if you have not been through Harry J. W. Percival 's very wonderful book, Test-Driven Development with

[00:50] Python. Then you probably don't know about the testing goat. The testing goat is this character that he uses to kind of scare menacingly at you if you do not test your code thoroughly. And it amused me to the point where when I wrote this blog post, I'm like, you know what? I wanna I want to include some GOAT chips in this blog post. And so I went and found this chip of two goats jauntily strutting down the street doing their goat thing on a goat afternoon and decided, hey, I want to put this thing in my blog post. Now let's talk about the specs of the site real quick. So this site is my personal site, Meganboss.

### [01:35] Site Hosting Setup

[01:35] com. At the time that this whole thing happened, I was running Wagtail 2. 13. And this site is hosted on a digital ocean droplet. I was running Ubuntu with Gunicorn and Nginx And this number will become relevant later on. I was on a very small amount of memory droplet, only 512 megs. And also had 10 gigs of solid state memory like solid state drive on the server there. So like these specs are important to remember. So when I put the post together, I added the goat gif. Went through, double-checked on my grammar, things like that, and hit

### [02:25] The Site Crash and Recovery

[02:25] publish. And this happened. My site just went kabalooey. It was one of the most complex collection of errors I have ever seen. I had parts of my backend were working properly, other parts were just gone. The front end was just a complete mess. And it was like the logs were so tangled. I was sitting here going, like, I don't think there I can find the error in here even if I tried. Fortunately, and this is a lesson again that backups are a great thing to have. I had a backup of my Digital Ocean droplet, and that is totally worth the money for anybody who is hosting on DigitalOcean.

[03:14] And I was like, you know what? Honestly, it would take me less time to rewrite the blog post. Than it would to try and figure out where this error is originating from. So I went ahead and put the backup together And got my site back up and running. Everything was functioning. Everything looked good. I was minus one blog post, but hey, I could rewrite that pretty quickly. And so, but because I'm the type of person who is just absolutely curious, and also because I now knew that my backup worked. I'm like, you know what? I just want to see, did I really, really destroy my site, like my production site this badly with just this image and why?

### [04:00] Reproducing the Failure

[04:00] So I uploaded it again. And I blew up my sight again because that's the type of person that I am. And so The lessons that I got from this when I started talking to other people in the community and other people at Torchbox about like, hey, why does this thing happen? Like you know, what am I running into here? And this is when I started to learn that, you know, the GIF format is actually pretty old. And it they can be chaos engines on the back end of servers. Honestly, these things are the like the sysadmins. I talked to say that, you know, GIFs can be the bane of their existence sometime

### [04:49] GIFs, Memory, and Server Load

[04:49] because ultimately it's not just the size of the file that matters. When you post a GIF to a website or a blog post, the frame rate, how fast the GIF is moving, also matters because I was looking at things like, you know, this file is Small enough that it shouldn't be causing any problems on my blog. But ultimately it turned out that the frame rate of those goats strutting down the alleyway was what was causing some problems On top of that, I also had a very, very small amount of memory. It was very tiny. So don't cheap out on your memory. Also consider converting your gifts to something else. Many people replace animated GIFs with videos for faster loading pages.

[05:36] Or just consider not using them whatsoever, as this person, Paul Bacchus, suggests on his Gifts Must Die blog. So All right, that's how I killed my website with a goat shift and resurrected it. Please come check out Wagtail. It's a great piece of software, awesome content management system If you have any questions about Wagtail or questions about how I destroyed my site and brought it back, feel free to hit me up on Slack. Thanks so much, everybody.
