Selenium: “Failed to decode response from marionette.”

“Failed to decode response from marionette.”

We were trying to move our Selenium tests into a docker container and were getting the above error response. First Google suggested increasing the memory of the container to 2G. We increased it to 3G to no effect. Deeper Googling then suggested increasing shared memory. Initially, it was 64m. We raised it to 256m and it magically worked! Our script for creating the container:

docker build . -f docker/Dockerfile --label cdx_selenium -t cdx_selenium
docker run --shm-size=256m -m3000m --cpus=4 --privileged -d  --name  cdx_selenium cdx_selenium 
docker exec cdx_selenium bash -c 'systemctl daemon-reload && systemctl enable xvfb.service && systemctl start xvfb.service'

We also needed to install dbus-x11. In theory we shouldn’t need to do the systemctl outside the Dockerfile.

Getting started with Amazon AWS

So this is all about getting started with AWS. I’ve been using AWS tangentially for about five years, almost always EC2 instances, so not really pushing the envelope. I’d really like to get my head round serverless and lambdas but I’m having a bit of a conceptual problem trying to work out a use case to do at home.

I have done the Udemy “AWS Certified Cloud Practitioner Practice Exam” which was quite frankly brutal, demanding 90% for three papers. First time through each I got 70-80% which I thought wasn’t too shabby but obviously not good enough for their arbitrary cutoff. The second time through I got >90% which was nice.

The biggest takeaway I have is once you’ve created a root account, create a user account and only give it only the privileges it needs. Security you know!

This is the list of white papers I’ve ingested to far. I hope it proves useful.

AWS Overview

This is the motherlode. If you want an overview of all available services on AWS, this is the place to start. For us in the perl world, that’ll be git, CI/CD pipelines and EC2/Fargate. If you’re jiggy, docker too. At this point for most of that, I like Gitlab, especially since M$ took over github.

AWS Well Architected Framework

This takes the overview one step further. Apparently as you partition your app vertically, VPSs are the trick. Security again.

Jenkins on AWS

In a good chunk of the contracts I’ve done, the developers have been good boys and written tests, but there was no way of automatically running them. Jenkins fixes this. Better still using the Perl TAP output formatter we can get a nice graph of the number of tests increasing. If you like, you can run Bamboo or GoCD but I’ve not had happy experiences with either of these.

Practising Continuous Integration and Continuous Delivery on AWS

Taking Jenkins one step further. In an ideal world code gets committed to master and then gets made live. Your process may vary. Oh, and database versioning is Hard. I’m reliably informed squitch is the one for this.

Development and Test on Amazon Web Services

More on the subject.

Overview of AWS Cloud Adoption Framework

Similar overview.

AWS DevOps

Taking a more DevOps approach to AWS.

DevOps for startups

More on the subject of DevOps.


Now we start getting to the docker meat. I’m not sure how applicable this is to a clunky monolithic Perl framework. I dockerised a simple Catalyst app and it was HUGE. Back to

Deploy Docker containers

Now we get to the meat.

Cost optimisation

A common whinge I’ve heard is that unless you’re careful and out of the free first year tier, is that suddenly your AWS usage blooms into thousand of pounds a month. Having been charged £15 a month for static IP I can well believe it.

Considerations for the Beginner Serverless Developer

Epsagon have a good trove of blogs too.

The Most Popular Deployment Tools For Serverless

5 Ways To Gain Serverless Observability

Yubl’s road to Serverless architecture — Testing and CI/CD

Serverless observability, what can you use out of the box?

Our Journey from Heroku to Kubernetes

Kubernetes land is still a mystery to me. Every way I’ve tried to approach it, from linux to Mac I’ve been thwarted. Oh well, one day it’ll be mature enough and actually work for me.

AWS custom runtime for lambda really works: How I developed a lambda in Perl

Now we get to some interesting stuff. It seems hideously convoluted to be but still. It’s a Perl lambda!

An alternative Perl lambda

A different approach.

Using the AWS Serverless Application Model (AWS SAM)

What Is the AWS Serverless Application Model (AWS SAM)?

Considerations for the Beginner Serverless Developer

Serverless and startups, the beginning of a beautiful friendship

So that’s what I have so far. I think most of the time, we’ll go EC2 and then RDS. I’d put Cloudflare on the front unless I particularly needed a Route53 feature. Serverless is still in the land of dragons and Perl isn’t spectacularly well supported. I’d like to see a world where the code pipeline is under Amazon as well as horizontal scaling with the load balancers.

AWS configuration with Terraform


Recently I had a contract which required me to immerse myself in AWS configuration for a LAMP stack, which led me to Terraform, amongst other things. I thought I’d publish here the list of resources that helped me. It’s a lot of links!

One tip I found was to use Jenkins to do automatic validation of your Terraform scripts. I think that’s a good tip.

Talk by Nicki Watt of Hashicorp:

Good tutorial:


Cloud Best Practices:

Elastic beanstalk might be a way to go:

These days I tend to put everything behind an Nginx reverse proxy:

Some AWS Webinars:

Drupal. Which was quite close to what I’d be needing: and and and

Doing your Git stuff at Amazon appears to have some advantages. CodeCommit:

AWS cost Best Practices:

Web Hosting general best practices:

A reference architecture for Drupal hosting:


If you’re on AWS it makes sense to use Amazon’s own CDN service. If however, you already have an Akamai account, it’s supported by terraform.


Interestingly, Terraform works across multiple cloud providers.

An introduction from Gruntwork, a Terraform consultancy:

Terraform with AWS:

Terraform getting started:

Hashicorp training:

Udemy have courses if you want to pay money:

Gruntwork comprehensive guide:

Gruntwork slideshare:

Another tutorial:

All about provisioners:


If Ansible is your configurator of choice, you can shoehorn it in to Terraform.


Chef is natively supported.

Chef and AWS:


Jenkins on AWS:

And there’s the link dump. It should be enough to keep you going for a couple of days! Overall, I think if you’re going to use AWS, embrace it fully. Except Cloudflare. They’re awesome.