Heroku Technical Details

What are the specs of the VMs that Heroku runs? One of my binary executable is not working (works perfectly fine on my computer), and I think it may be due to technical mismatches.

When I run file on my executable, I get Mach-O 64-bit executable x86_64.

  • Does Heroku use a 64 bit machine with x86 architecture?
  • What kind of nix do they use?
  • What other reasons would there be for an (C++) executable executing fine in my app locally, but not on Heroku itself?

The error I get is gibberish:

2014-09-07T04:38:32.909511+00:00 app[web.1]: ./process: 1: �����#�
                                                                  ��!H__PAGEZERO�__TEXT�__text__TEXT�a�d�a�__stubs__TEXT: not found
2014-09-07T04:38:32.909519+00:00 app[web.1]: ./process: 3: Syntax error: "(" unexpected
2014-09-07T04:38:32.909521+00:00 app[web.1]:
2014-09-07T04:38:32.909517+00:00 app[web.1]: ./process: 2: ��: not found

Heroku apps are deployed on their Cedar Stack which is based on a 64-bit Ubuntu 10.04. The new Cedar-14 stack is based on Ubuntu 14.04.

By deploying a simple Node.js app and using heroku run bash we can inspect the live environment:

$ heroku run bash
Running `bash` attached to terminal... up, run.2785

~ $ which node
/app/vendor/node/bin/node

~ $ file /app/vendor/node/bin/node
/app/vendor/node/bin/node: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

~ $ uname -a
Linux 9cf0ac66-9131-4a19-8f4a-f4a132cf3db8 3.8.11-ec2 #6 SMP Tue Jul 22 22:02:15 UTC 2014 x86_64 GNU/Linux

It's important to note that Heroku is not designed to run pre-compiled executables. Rather, it is designed to compile your application as part of the build stage of Heroku Buildpacks.

For more detail, take a look at the "Build, release, run" section of The Twelve Factor App -- a set of application best practices you must follow to use a PaaS like Heroku.