OCT 29, 2016

Bugs

As you might have noticed, I recently switched to disqus for comments. It was working fine, until today the site was taking around THIRTEEN seconds to load. That's a lot. And I'm only talking about the HTML.

However, I noticed that the admin pages, site pages, static files and unpublished articles loaded just fine. Here are the average times for each:

  • Admin: 100ms
  • Static: 70ms
  • Page: 70ms
  • Unpublished post: 80ms
  • Published post: 6s
  • Home page: 13s

Woah, what's going on there?

The only difference between unpublished and published posts is a little DRAFT notice and the lack of comments. Since I doubt that it's the draft notice, I went on to disable comments... but I couldn't ssh to the VPS. After a few reboots I realized my IP had changed, and that's why I couldn't login. However, I also noticed that right after rebooting, the home page was down to about 600ms. Still a lot, but definitely an improvement. Happy with my success, I just left it, only to come back later and notice it's now taking around 2 seconds to load.

Fuck

So, it increases over time. Great. Well, I disabled comments and come back.

  • Home page: 600ms
  • Published post: 300ms

As of writing, there are 2 posts, so I assumed it was taking ~300ms to fetch each post from the database. So, I added another post. Home page still 600ms.

That is when I decided to write this post.

Since I began writing, the time to load the home page increased by about 200ms.

I have absolutely no idea what's causing this.

The code is available here, if you want to take a look (I wasn't able to reproduce it on my home pc). Good luck.

UPDATE: I published this, and it's taking 80ms to load... Again, no idea what's wrong here. Same thing with comments. So yeah, comments aren't the cause. They're back now.