Optimal kadira host

I’ve got Kadira running locally and created an init script to locally start it. And also one to start the mongo replicaset. I just wonder. Has anyone already deployed it. If yes, any specs that the server has to have? I’m planning to just first have it naively run together (mongo replicaset + all kadira services) on 1 server. Then check which ones require what resources. My plan:

  • Start amazon ec2 medium instance, manual install / pull
  • Monitor it
  • Split up until optimal use of resources
1 Like

I would be interested in the results of your research, since I also plan to host Kadira on AWS. I’ll probably host the database on Compose, though. What did it take to make it run locally?

I’ve it running on my Fedora 25 laptop (8gig)

  • Setting up mongo set
  • Running installer in each app folder
  • Installing ext dependencies (node, npm etc)
  • adding env vars listed in init-shell.sh
  • creating start scripts:

Starting Kadira

#!/usr/bin/env bash

source ./init-shell.sh


red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
blue=$(tput setaf 4)
default=$(tput sgr0)


cd ./kadira-engine
sh run.sh | sed "s/.*/$red&$default/" &
cd ../kadira-rma
sh run.sh | sed "s/.*/$green&$default/" &
cd ../kadira-alertsman/
sh run.sh | sed "s/.*/$blue&$default/" &
cd ../kadira-ui
sh run.sh | sed "s/.*/$yellow&$default/" &


# sleep forever
cat
Raw

Starting mongo replica set

#!/bin/bash

# shell script to create a simple mongodb replica set (tested on osx)
set -e

red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
default=$(tput sgr0)

function finish {
    pids=(`cat /home/cloudspider/mongosvr/rs-*.pid`)
    for pid in "${pids[@]}"
    do
        kill $pid
        wait $pid
    done
}
trap finish EXIT


mkdir -p ~/mongosvr/rs-0
mkdir -p ~/mongosvr/rs-1
mkdir -p ~/mongosvr/rs-2

mongod --dbpath /home/cloudspider/mongosvr/rs-0 --replSet set --rest --port 27010 \
    --pidfilepath /home/cloudspider/mongosvr/rs-0.pid 2>&1 | sed "s/.*/$red&$default/" &

mongod --dbpath /home/cloudspider/mongosvr/rs-1 --replSet set --rest --port 27011 \
    --pidfilepath /home/cloudspider/mongosvr/rs-1.pid 2>&1 | sed "s/.*/$green&$default/" &

mongod --dbpath /home/cloudspider/mongosvr/rs-2 --replSet set --rest --port 27012 \
    --pidfilepath /home/cloudspider/mongosvr/rs-2.pid 2>&1 | sed "s/.*/$yellow&$default/" &

# wait a bit for the first server to come up
sleep 5

# call rs.initiate({...})
cfg="{
    _id: 'set',
    members: [
        {_id: 1, host: 'localhost:27010'},
        {_id: 2, host: 'localhost:27011'},
        {_id: 3, host: 'localhost:27012'}
    ]
}"
mongo localhost:27010 --eval "JSON.stringify(db.adminCommand({'replSetInitiate' : $cfg}))"

# sleep forever
cat
Raw


2 Likes

I’m no expert in APM services and stuff whatsoever but do you really need such a “powerful” server for Kadira APM if you only use if for your own app?! My plan was to just spin up the cheapest DigitalOcen droplet (1 CPU, 512MB RAM) and go from there. Of course it depends on the user-count of your app but still - I thought the smallest droplet should do just fine?!

I might want to try that indeed. But my experience with mongo is that it needs some ram to go on.

right now our instance of kadira needs like 16 gb ram

but we are not only monitoring our production apps but dev/stagging too

oh wow … really? I had no idea haha … so no chance whatsoever running this on a small droplet as planned?

Its mostly mongo. We might be able to run it on a smaller instance if we make it run without a replica setup.

Is this possible? as far as I know Kadira needs the replica set?!

Its needed, because of the multi tenancy (if I’m correct). If we tweak the code to allow for single tenancy, we might be able to run it without the replica

Chances are that you won’t need a full replica set… You could use a single node replica set, if you’re not too worried about loss or if it’s to set up on dev’s machines. I haven’t tried but I don’t see why it shouldn’t work.

I’m looking at Digital ocean droplets right now. They seem viable and indeed I might get away with a single instance replicaset initially. As long as its a replicaset so I can scale it out.