Weightlifting at SimplySocial
Upcoming SlideShare
Loading in...5
×
 

Weightlifting at SimplySocial

on

  • 432 views

How SimplySocial uses Python

How SimplySocial uses Python

Statistics

Views

Total Views
432
Views on SlideShare
432
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Weightlifting at SimplySocial Weightlifting at SimplySocial Presentation Transcript

  • Weightlifting@
  • @bogdan
  • @SIMPLYSOCIAL View slide
  • + = View slide
  • + =
  • + =?
  • + =
  • ARCHITECTUREapi.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBs
  • LIFE OF A REQUESTapi.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 01 API N...APP 01 APP 01 APP N...BACKEND01BACKEND02BACKENDN...DBsAPI 02APP 02
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsLIFE OF A REQUEST
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsLIFE OF A REQUEST
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsLIFE OF A REQUEST2M x
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsLIFE OF A REQUEST
  • USE OF PYTHONapi.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBs
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • CAN I HEAR ABOOO FOR ?
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • PYTHON ON APPSERVERSAWS EC2Ubuntu 12.04ChefNGINX + PHP FPMFABRICDEPLOYMENTMetricsLogging
  • USE OF PYTHONMETRICSAWS EC2Ubuntu 12.04ChefNGINX + PHP FPMFABRICMetricsLogging
  • INTRODUCING OSSIEMETRICS GATHERINGREPORTING STATS THROUGH A SIMPLEWEB INTERFACEINTERACTION WITH RUNNING PROcessesBACKEND BY STATSD and GRAPHITE
  • INTRODUCING OSSIEimport ossiestat = ossie.Client("arcade.random_worker")stat.gauge("a_metric", 256)stat.timer("random.metric", 1.28)with stat.timer("random.metric.with"):# do something that requires an amount of time# ossie client will report the right time
  • USE OF PYTHONloggingAWS EC2Ubuntu 12.04ChefNGINX + PHP FPMFABRICMetricsLogging
  • logginGFULL JSON loggingEVEN nginx logs jsonpowered by fluentd + S3FUTURE: Logs can be searched byelasticsearch + kibana
  • api.gosimplysocial.comapp.gosimplysocial.comAPI 01 API 02 API N...APP 01 APP 02 APP N...BACKEND01BACKEND02BACKENDN...DBsUSE OF PYTHON
  • AWS EC2Ubuntu 12.04ChefFABRICSUPERVISORDMetricsSUPERVISORDWorkersLogging
  • AWS EC2Ubuntu 12.04ChefFABRICWORKERSMetricsSUPERVISORDWorkersLogging
  • INTRODUCING ARCADEqueue based workers frameworkConvention over configurationsimple deploymentdetailed logging and monitoring
  • INTRODUCING ARCADECRAWL INSIGHTSCRAWL PAGESCRAWL EVENTSARCADEFACEBOOKCRAWL
  • INTRODUCING ARCADECRAWL INSIGHTSCRAWL PAGESCRAWL EVENTSARCADEFACEBOOKCRAWLqueue pythonworkersjob types
  • INTRODUCING ARCADEfacebook/!"" __init__.py!"" common#   !"" __init__.py#   !"" crawler/#   !"" exception.py#   !"" facebook_model.py#   !"" helper.py#   !"" indexer/#   !"" ...!"" config#   !"" __init__.py#   !"" config.yml#   $"" env#   !"" __init__.py#   !"" crawler.py#   !"" ......!"" tests#   !"" __init__.py#   !"" fixtures#   #   !"" crawler_feed.yml#   #   !"" ...#   #   $"" stream_routing.yml#   !"" test_crawler_feed.py#   !"" ...#   $"" test_stream_worker.py$"" workers!"" __init__.py!"" crawler.py!"" ...
  • from arcade.worker import TaskWorkerfrom arcade.helper import retry, task# [...]class FacebookCrawler(TaskWorker):def __init__(self, dependencies):super(FacebookCrawler, self).__init__(dependencies)@task("default", "crawl")def crawl_feed(self, data):"""Job type:* uid* last_crawl"""feed = CrawlerFeedModel(self)feed.crawl(data)def before_each(self, data):# [...]def run(dependencies):try:FacebookCrawler(dependencies).run()except:dependencies.get("exception").capture_exception()
  • AND MANY MORE:continuous integrationRELIABLE ALERTINGCLOUDWATCH to STATSDREAL USER MONITORING
  • Q/A
  • Thanks!