Running Rocket Chat on an Intel Celron CPU in 2023

, updated 13 September 2024 🔖 cloud-software ⏲️ 7 minutes to read

I previously wrote about Running Rocket Chat on a Raspberry Pi in 2023, and ended the post by saying I was emulating the x86_64 build of Rocket Chat on the Pi's ARM CPU (you may want to skim it for context).

As you may have guessed from the title of this post... emulation didn't work out, it was too unstable. I could deal with slowness, but not unreliability. I figured, I'll go the route of least friction, and buy a cheap x86_64 Intel CPU. I landed on hardware with a Intel Celeron N4505 , released Q1 2021.

I shifted everything over to this machine, and it all worked great! The latest version of Rocket Chat (6.x at the time of writing) worked fine, and I stuck with version 4.4.15 of MongoDB. When I did try upgrading that, it crashed. I didn't think much of it, but little did I know this was yet another rabbit hole.

Upgrading MongoDB

I tried upgrading to version 5.x again... and consistently reproduced the crash. Turning to Google, I found that from version 5.x onwards, MongoDB requires the AVX instruction set, otherwise it will not run.

It's the cheap Celron CPUs which don't support AVX, Intel are still pumping them out and I just bought one🤦

The Intel Celeron N4505 CPU specs showing a lack of AVX support

I may have said said some choice words, then started to figure out how to move forwards...

Building my own MongoDB Image

There are patches in FreeBSD and Gentoo Linux which patch out the need for the AVX instruction set to run MongoDB, and I came across this fantastic GitHub repository wrapping up the build in a Docker image: https://github.com/GermanAizek/mongodb-without-avx

It took me a while to understand how to get this to build successfully with docker build ., and the main problem was Docker on Windows. Under WSL2, by default Windows only allows it to use half of your system's memory, which meant that I couldn't build MongoDB using all of my cores without getting a segfault from g++.

To fix that, I created a file called %UserProfile%/.wslconfig with the following content:

[wsl2]
memory=50GB

Where my machine has 64GB of RAM, 50GB gives WSL2 a bit more RAM with a buffer left for Windows itself. This allowed me to compile at full speed, without any crashes from the compilation process.

From that point, I forked the original Git repository to make some tweaks, and spun up a public Amazon Elastic Container Registry (ECR) repository for my images:

I have pushed up Linux x86_64 images for MongoDB 5.x and 6.x at the time of writing, and intend to push at least one image for each new major version (after all, I need them).

There are some differences between the officially recommended Bitnami image and this image - namely the configuration of replica sets is manual. There's a bit more information about that in the README.

My Rocket Chat interface now displays the following, which is the latest version of MongoDB at the time of writing:

So I can pretend this whole thing never happened!

At least.. until the next version, or the "no-AVX" patch stops working, o̾r̾ ̾R̾o̾c̾k̾e̾t̾ ̾C̾h̾a̾t̾ ̾i̾t̾s̾e̾l̾f̾ ̾s̾t̾a̾r̾t̾s̾ ̾u̾s̾i̾n̾g̾ ̾A̾V̾X̾, ҉o҉r҉ ҉U҉b҉u҉n҉t҉u҉ ҉s҉t҉o҉p҉s҉ ҉s҉u҉p҉p҉o҉r҉t҉i҉n҉g҉ ҉n҉o҉n҉-҉A҉V҉X҉ ҉C҉P҉U҉s҉, , o̘̭̝̖r̻͊ͤ͑ͭͅ ͍t̳̠͙̠h̲͓̝̺e̬ ̪͓̯̻͔̄ͬ͑ͪs͓̼̟̙̿ͦe̋r̯̅v͚̪̏͆͐ͭě͆͒͛r͍̦͔̟̗ͫͪ̏ ͌ǐ̹m̜̣̜ͮ̈́̑̃p͔̣̦͔l̺̒̐ͬ̄o̅̓̓d̍͋ͣ̊es̝͇̰̒ͅ,̯͔̖ͅ ̹̬̇õ̫̱̠̝̹̊̾rͤ̾ͯ̂ ̙̣̭͈̳ͦt̃͐h̻͕̗̝ͅe̬͓͈͋͛ͦr̯͕͍̉ͧ̐ͨe͚̳̮'̑͐ṣ ̳̞̖ͪ̾̈s̗̮͎̽͂͑̇ȍ͇͍͉͖̜m̫̤͙̈́e̼̙̯̳ͮͤͣ ̼͈̗͖̦̅o͙͉̐̏̃t̻̻̭͖̓ͦͤ͊h̳̲̖͑̆ě̳̪̣͂ͫͧͥr͎̃ͅͅͅ ̰̥̠̪̥ͯ̔f̬̟͉͈͒e̲̬̞̥̒̄̅a̳̦tu͙ͅȓ̤̿ͮ̀e͙̣̋ͣͨ ͒ͨ̐t͊ͭ̏̅ͭh̊a̝̖̯̱͗͛̽t̤̜͌ ̥̫́ͭ̽̓I̒n͕̫̥̳͖̑ͤ̽t͓̞͇͑͂͗̄ͦe̋̂l̗͉̯̩̙̉ ͮ̄h̟͈̭̏͛̚a̮̺͈͒v̰̤̥ͅe̤̘͓͂̔̎̈͒ r͈ḛ̲̉̉m̳̲͇̼ͅỏ̯͔ͧ̈́vͥ͆e̱̒͛d̞̂ͭͬ͋̋ ̱̔ͫ̓͂̚f̦̲̤r̟̳̹͂̍ͣͣ̀ọ̎m̠̃̏ͥͅ ̤̗̥͗̊t͇̟͇̬͊͊h͓e̖ ̮͇̳̦̯͋ͯ̑̀́C̺͓̦̬̪̋ͨͤͭ̒e͈͉̽̒ͤl̦̝̂ͭ̿͐r͑̎o̫ͮn̪̫̥̼͆ ̜ͬͦ͌ͪl͔͓̦͙̒ͨ̇͆i̳͓͗̒ñ͖̌͛̓̚e͓̼̾̿̋ͣ,̹̂ ̠͔͔̀ͅo̝ͪ̿̄ͩͮr̠̘͎̠̖ ̣͚͙̙͚̒͗͆͐̚ T͉͈̰͈̹ͭH͎̦͚̺̭E͊Y͔͓̓̆ͅ'̞̣̟̹̤R̅̆͊E̠̗̭͔͈ͩͥ ̟̲͇ͦͬ̿H̗ͬ̾E͒̒̄Rͤ̌ͮ̊̃E̖,ͯͯ̎ ̦̠̤͖̙ͨͫ͐̃S̱ͥU͕ͨ͌B͉͕̰͖͍ͤ̃M̳̬̞̰ͫͨ̽ͯ͆I͖͈̪̳͙T̪̳̑ͦ ̲͚̍ͩͯS͕̱̾Ü͍̯̲͇̟B͚̮ͯ̓M͈̞̑ͯͣ̈I̱̣̤͍ͦT͕̎̽̃ ̯͔̯̆ͭ̔̑͛T̹̰̜̝̪̾ͥ̾H͙͎̬̮ͩ̄̔̍̽E͈̥̝͕̭Y̜̫͎̼̘͌͐̃'̬̬̳̄̑ͧͤͅR̙̣̬͐ͅE̤͌͂ͧͤ ̦̖̿̇ͤH̩̰̃̿̆̅E̹̳̱͋̔̎̀ͧR͖̍̊E͇̲̳͈̤͌̈́̋͋

Maybe I should give up on my self hosted adventures 🤕

🏷️ mongodb rocket chat intel image cpu avx x86 upgrade repository windows celron about pi cheap

⬅️ Previous post: Running Rocket Chat on a Raspberry Pi in 2023

➡️ Next post: Using Material Layers in UE5

🎲 Random post: Tips for Building Games with Unreal Engine 4

Comments

Please click here to load comments.