monitoring for online services - meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · •...

22
www.dataloop.io | @dataloopio | [email protected] Monitoring for Online Services

Upload: others

Post on 14-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

www.dataloop.io | @dataloopio | [email protected]

Monitoring for Online Services

Page 2: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Disclaimer

• Not an Erlang developer!

• May defer questions Tomasz!

• Based on a true story

Page 3: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

What is Dataloop?

PerformanceUp / Down Alerts

Dev Env Enterprise Stuff

Page 4: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Architecture

Page 5: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

First Year

Page 6: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

First Year

Page 7: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Measure

Page 8: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Putting out the fire

rollup workermetric worker

Page 9: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Problems

• NodeJS metrics workers not scaling!

• Memory management was an issue!

• Needed big caches to reduce database load!

• GC cycles too long!

• 8 x single processes on an 8 core server

Page 10: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Languages

• Decided on Erlang!

• Memory management!

• Fault tolerance!

• Good libraries for Rabbit and Riak!

• Live code tracing

Page 11: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Metric worker re-write

• Approximately 6 weeks from no Erlang experience to working version!

• No more crashes!

• Reduced servers needed from 16 to 8

Page 12: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

New Features

Page 13: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Dalmatiner DB

• Open Source Time-Series DB!

• Written in Erlang!

• Based on Riak-Core and uses ZFS!

• Optimised for write throughput!

• Needed for developer analytics features!

• https://dalmatiner.io/

Page 14: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Modifications

• Floating point support!

• Interfaces with C via NIF!

• Lots of fixes for our shape of data

Page 15: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

New metrics worker

• Worked with Erlang solutions!

• Cross trained team (Dave and Tomasz)!

• Removed the Redis!

• Reduced servers needed from 8 to 2

new metrics worker

Page 16: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

New Things

• Lager!

• Pooler!

• Dialyzer!

• Quick Check!

• Rebar3

• Recon!

• Dave

Page 17: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Data Migration

• Used existing NodeJS code with Node_Erlastic!

• Uses ports interface!

• Saved a lot of development time vs writing from scratch!

• Migrated one organisation at a time over several weeks!

• Ran Riak and Dalmatiner in parallel and then switched

Page 18: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Today

Page 19: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Happy Ending

Page 20: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Next

• Convert the other workers to Erlang!

• Add metric dimensions to Dalmatiner DB!

• Make RabbitMQ more robust!

• Hire more Erlang developers!

Page 21: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

Q&A

Page 22: Monitoring for Online Services - Meetupfiles.meetup.com/1512314/erlang-solutions-meetup.pdf · • Used existing NodeJS code with Node_Erlastic! • Uses ports interface! • Saved

www.dataloop.io!

@dataloopio!

[email protected]