Hello (static) world
I’ve decided to rebuild my portfolio using a static site generator and also start a simple blog to report on whatever tools and concepts may interest me. Despite having previous experience with Jekyll a few years ago and it still being one of the most popular options, I wanted to try a newer alternative and being used to the React ecosystem made Gatsby an obvious choice.
Learning about its conventions while making design decisions and implementing the layout simultaneously took about three days in total. Using JSX and React for templating is what I’m used to do with most apps I work with. Using GraphQL requires no setup and by using few queries you have a powerful abstraction for any backend. And the plugins allow for painless implementations of features like image transformations and SEO.
After finishing the code and writing the beginning of this post it was ready to deploy, or so I thought. Running gatsby build
worked flawlessly on two local machines running different linux distros and node versions, but at production it failed during the task “Building Rendering Engines” with the cryptically fatal message “Killed”. Checking out dmesg
I saw this error:
[4542229.417528] Out of memory: Killed process 944275 (node) total-vm:54149044kB, anon-rss:658952kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:13252kB oom_score_adj:0
My server has a meager 2gb ram which has been enough for running my simple and unpopular projects in Node, Ruby and Python, but apparently deploying Gatsby takes more than that. So I rewrote the code from scratch using Jekyll and within a few hours it was built on production without a hitch. This isn’t a dunking on Gatsby though, just a warning it might have an unspoken memory requirement. I’ll keep investigating and this post updated. (on Jekyll for now…)