24 August 2013

Today I decided that my blog needed a facelift. After a few research on the web, I found the Jekyll Bootstrap project and decided to give it a try. Even if Jade Dominguez does not contribute to it actively anymore and now concentrate on Ruhoh, I decided to stay with Jekyll for this first transition. I might give a try to Ruhoh in the near future.

At the same time, I moved my bloging basecamp from Windows (professional PC…) to my cloud Ubuntu 13.04 desktop. This new environment was also an opportunity to upgrade my Jekyll framework to a newer one (I installed the one from the standard Ubuntu repository, I am courageous but not reckless…).

For the first time I tried the server option embedded with Jekyll and I have to admit I was very disappointed by the latency to fetch the pages. After some diagnosis, it came out that Webrick was the real culprit… as an former system administrator, I always suspect the network when things go wrong…

At first I tought that there might be a reverse DNS lookup problem but when I tried to resolve the name of my client IP address using nslookup it was very fast. After a couple of minutes browsing the web I found this gist that really made my day! The slow response time was indeed related to DNS queries… I don"t know exactly what was the problem but applying the following patch fixed it!

--- a/lib/jekyll/commands/serve.rb
+++ b/lib/jekyll/commands/serve.rb
@@ -20,6 +20,7 @@ module Jekyll
         s = HTTPServer.new(
           :Port => options['port'],
           :BindAddress => options['host'],
+          :DoNotReverseLookup => options['DoNotReverseLookup'],
           :MimeTypes => mime_types

I decided not to hard code the :DoNotReverseLookup parameter and chose to add an option in my _config.yml file to tweak it. So after applying this patch, don"t forget to add the following in your _config.yml file.

DoNotReverseLookup: true

blog comments powered by Disqus