This presentation was given to the STL.JS meetup group on May 15, 2014: http://www.meetup.com/STL-JS-meetup/events/151436472/
"Midwestern Mac, LLC has integrated a small, scalable Node.js application into their Drupal-powered Server Check.in service. Jeff will take us on an exploration of integrating the two platforms, and explain how this work has enabled the service to scale to hundreds of thousands of ICMP ping and HTTP status checks per day."
6. Server Check.in
ā¢ Dogfood project
ā¢ Simple, cheap, reliable service
ā¢ Notify me when my servers are down
ā¢ Launched December, 2012
https://servercheck.in
@servercheckin
14. Server Checking
ā¢ Originally: DB Queue + multithreaded cron batch
ā¢ Problems:
ā¢ Wasnāt scaling with growth
ā¢ Synchronous server checking via PHP cURL
(slow even with 8-16 threads)
ā¢ 10 min interval maximum
19. Server Checking
ā¢ Now: External Node.js application
ā¢ Allows:
ā¢ Scalability, geographically-diverse checking
ā¢ Servers are checked asynchronously
ā¢ 1 minute check intervals for everyone (yay!)
20.
21. Server Check Overview
ā¢ Drupal!
ā¢ Callback - JSON list of servers to check
ā¢ Callback - accept POST of JSON server check result data
ā¢ Node.js!
ā¢ Cron-based mini app:
ā¢ retrieve list of servers
ā¢ check all servers (async)
ā¢ post batch of data back to Drupal
23. ā¢ For HTTP requests: mikeal/request
ā¢ For ICMP pings: geerlingguy/jjg-ping
ā¢ For Async control ļ¬ow: caolan/async
24. Hosting on the Cheap
ā¢ Cheap Low End Box servers (~$15/year VPS)
ā¢ Main need: geographically-diverse, decent network I/O - not CPU,
disk, reliability, etc.
ā¢ Infrastructure managed with Ansible
ā¢ New servers in < 10 min. (aside: check out Ansible for DevOps)
ā¢ Cheap service + cheap servers + frequent changes
== 99.9% uptime?
ā¢ (testing + automation == reliability)
27. Launch / Marketing
ā¢ Some things Iāve tried:
ā¢ Drupal.org case study
ā¢ Hacker News post
ā¢ Sponsoring blogs
ā¢ Blogging (servercheck.in/blog)
ā¢ Keep trying new things!
30. Summary
ā¢ Drupal/PHP is a solid platform for user-based
web applications
ā¢ Node.js is a solid platform for lightweight
asynchronous, I/O-heavy work
ā¢ And maybe moreā¦
ā¢ You can do a lot with a little (hosting, marketing,
monitoring)
31. Thanks!
(Use coupon code STL14 for 20% off!)
ā¢ More Resources:
ā¢ Simple Node.js Dev VM (Ansible + Vagrant)
ā¢ Server Check.in Blog / @servercheckin
ā¢ Ansible for DevOps