Skip to content

Instantly share code, notes, and snippets.

@opencubicles
Last active March 15, 2021 08:13
Show Gist options
  • Save opencubicles/4cd86039ae812671e1d2b9299a3d410c to your computer and use it in GitHub Desktop.
Save opencubicles/4cd86039ae812671e1d2b9299a3d410c to your computer and use it in GitHub Desktop.
BigBlueButton Auto Scaler + Load Balancer based setup
@opencubicles
Copy link
Author

Hello everyone, we have been able to get an auto-scaling component (in AWS Lambda) along with scalelite (from blindsidenetworks) load balancer up and running in our AWS Account. here is what we are following:

  1. Fully packaged AWS bigbluebutton AMI created from standard bbb-install.sh script
  2. Any EC2 instance provisioned using above AWS AMI, will run a start-up script to change the domain configured for the bigbluebutton server while building AMI. Default Public DNS assigned by AWS was then fed to start-up script. Reason for using default public DNS is because AWS has a limit of no. of elastic IPs you can get and mapping Elastic IPs to your domain etc in DNS server takes a bit of time to propagate. Using public DNS autogenerated by EC2 doesn't have any such issues!
  3. We keep a fleet of about 20 such EC2 instances (AWS Limits, increasable) ready in AWS account but turned off. AWS doesn't bill you for turned off instance. (You get billed very little just for EBS volume)
  4. We have a small lambda function written which continuously monitor our meeting scheduler MySQL DB (LMS moodle), looks for the number of servers already running in EC2, come up with the additional number of servers to be started/provisioned. Based on that Lambda fires another LAMDA which is solely responsible for turning on/off EC2 servers.
  5. a small listener which again sits in lambda monitor for any new server started and stopped and then accordingly run add/remove rake command them to scalelite LB [https://github.com/blindsidenetworks/scalelite]
  6. We have a small EC2 always running which hosts the scalelite LB + another small server provisioned which is our monitoring server with prometheus and grafana installed.
  7. For storing recordings, We have configured AWS EFS which is then mounted on each bigbluebutton server via scalelite LB. AWS EFS is built to scale on-demand to petabytes and you pay per GB only when you actually store the recordings.
  8. Our only 24x7 cost incurred here is for always running scalelite LB and monitoring servers. Cost for servers hosting the meetings is always incurred when the meetings are happening. Auto-scaling component runs fully on serverless lambda function with cloud watch monitoring (for cron job).

@akshilshah
Copy link

Hi there,
Thank you for sharing this. is it possible for you to share the startup scripts?

@haozhiyu
Copy link

Yes,thank you for your thoughts. And could share the scripts ? that'd be very helpful.

@sdhulia
Copy link

sdhulia commented Aug 24, 2020

Hi ,

Thanks for sharing the info. Is it possible to share the de-allocation logic. I am also allocating server based on schedule LMS meetings, I just check running servers and no of running/scheduled meeting, my lamba start and associate the server with Scale-lite but I am not sure how to go about deallocation, basically how do you figure out which server instance to deallocate out of many running servers?

@inayet
Copy link

inayet commented Sep 16, 2020

Hello,

Can you post your scripts that you used, a video of the entire process would be really cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment