SlideShare une entreprise Scribd logo
1  sur  17
Web Performance & Operations Meetup
2 march 2012




Ahmed Omar – omar@nimbuzz.nl
Nico Klasens – nico@nimbuzz.nl

                                      2
What is Nimbuzz?


Nimbuzz is a communication platform which provides
  services
     to make calls (Audio and Video), Internet and normal numbers
     send instant messages
     share files
On any mobile device, desktop computer or Internet
  browser if possible.

It connects with popular instant messaging and social
    networks
     Facebook, Windows Live Messenger (MSN), GoogleTalk, Yahoo!,
     and SIP/VoIP accounts

                                                                    3
Architecture
Guidelines


•   Implement business features in external components,
    not modules inside xmpp router

•   Bundle functionality in small services

•   Implement services as stateless as possible

•   Communicate with users over XMPP

•   Communicate internal data over other connections

This makes it possible to do multiple deployments to
  Nimbuzz every day.

                                                          4
High level architecture




                          5
What is XMPP?
eXtensible Message and Presence Protocol, Formerly known as Jabber

A full XMPP session is one XML document.
   Client opens a <stream> and exchanges xml packets
   At the end closes </stream>.
   This requires long running TCP connections

Packets always have a

    •   From JID (JabberID : user@nimbuzz.com /resource)
    •   To JID (JabberID : user@nimbuzz.com /resource)
Three subtypes (Message, Presence and IQ)

    •   Message (type=normal/chat, subject, body)
    •   Presence (type=unavailable/subscribe/probe, show=chat/away/dnd)
    •   IQ (id, type=get/set/result/error,
        one child element with extension namespace)

                                                                          6
What is XMPP?
Instant Messaging and Presence extension

•   Roster - central point of focus is a list of one's contacts or
    "buddies"

    •   Local Nimbuzz friends
    •   Transports (gateways to external IM systems)
    •   Transport friends
•   Presence information - network availability of particular
    contacts

•   Presence subscription – authorize contacts to receive
    “presence”

•   PrivacyList

                                                                     7
Ejabberd / Erlang


Ejabberd is a XMPP instant messaging server, written in
  Erlang/OTP. Nimbuzz runs a modified version with its
  own extensions.

Erlang is a programming language
   Erlang's runtime system has built-in support for
   concurrency, distribution and fault tolerance.

OTP is a set of Erlang libraries It includes its own
  distributed database, debugging and release
  handling tools.

                                                          8
Erlang/OTP


 - Quick History

 - Why Erlang?

   o   Concurrency
   o   Fault tolerance
   o   Distribution
   o   Hot code swapping/ High Availability
 - Who uses Erlang?
XMPP in action

•   XML stanzas (presence, iq, message)

<presence to=‘user3@server-x’ type=‘subscribe’/>
  <presence> <show> chat </show><status>Just
  talk</status></presence>

    <iq from='user2@server-x/pc' type='get' id='roster_req1'>
        <query xmlns='jabber:iq:roster'/>
    </iq>

    <message to='user3@server-x' from ='user1@server-x/pc'
    type = 'chat‘>
       <body> Hey </body>
    </message>
Ejabberd


Why XMPP?
   o   Real time communication
   o   Extensibility
Why Ejabberd?
   o   Flexible
           easy to setup a cluster
           easy to configure
           easy to extend
           support for external services.
   o   Powerful
   o   Scalable... with caution.
Persistence Bridge


Application introduced to migrate to ejabberd, while still
  using the old database schema of the old xmpp server.

  data requests 1.839.333.853 per day = 21.288 per second

  A REST service written in java

     Apply validation/business rules and enhance data.
     Cache most accessed data in memcached what is stored in
     MySQL
     Cache community gateway rosters in Redis
     Migrate data to more efficient storage backends or database
     tables.

                                                                   12
Cache server Practices

Use a naming convention for your keys: namespace:sequence@identifier
       Sequence has to be configurable

Choose a good balance between memory size, expiry and number of
  servers.
       Memcached is/was single-threaded

Decide on connection, read and data retrieval timeouts.
       Use command pipelining on every connection.
       Use different connections for different namespaced keys.

Only write to MySQL, try to only read from cache server. update cache
  server on write

Use Check And Set (CAS) command for partial updates and back out
  after retries.
                                                                        13
MySQL Practices

Use connection pooling (mysql driver for java creates
  connections slow)

Test connections with a mysql ping not with a statement
  “SELECT 1”

Make every transaction a single sql-statement and turn
 autocommit on by default

Split read and write statements to different connections.

Add requesting host and application as sql comment to
  statement

                                                            14
MySQL Practices


Put statements outside programming code.

Never use "SELECT *" column order might change and hard to check
  which are still used

Never use "INSERT INTO table_name VALUES( ... )“
   Use "INSERT INTO column1, colum2 table_name VALUES( ... )“

Do not rely on database DEFAULT values. Provide all values on INSERT.
  An exception on this is a TIMESTAMP field.

All columns in the database have to be NOT NULL and a DEFAULT value

Use Primary Keys as much as possible.



                                                                        15
Data tweaks

    Users send a lot of junk. Validate and drop. Do not try to correct
    Do not store data which is implied like + of phonenumbers
    Bulk insert, update and delete.
       INSERT INTO table (data) VALUES(?), (?)
       INSERT INTO table (id, data) VALUES(?,?), (?, ?)
       ON DUPLICATE KEY UPDATE data = VALUES(data)
       Do not use REPLACE if you don’t want to DELETE and INSERT.
       Very bad IO performance
    Sort rows based on primary key before update and delete Improves
    InnoDB page locks
    Use compound primary key to store records of one user together on
    disk (user_id, auto_increment_id)
    A mysql index on large table with text columns do not perform. Use
    fulltext search engines to have an index which is not fully in memory.
    Remove foreign keys to reduce storage. Trust the application to update
    and delete

                                                                             16
Wanna play? We hire

Contenu connexe

Tendances

Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppScaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppmustafa sarac
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with pythonImam Omar Mochtar
 
Fixing Domino Server Sickness
Fixing Domino Server SicknessFixing Domino Server Sickness
Fixing Domino Server SicknessGabriella Davis
 
Nginx internals
Nginx internalsNginx internals
Nginx internalsliqiang xu
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016Marcus Merrell
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerSharon James
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamerWannes Rams
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.jsXie ChengChao
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web serverMd Waresul Islam
 
Intro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew KirchIntro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew Kirchbuildacloud
 
Game server development in node.js
Game server development in node.jsGame server development in node.js
Game server development in node.jsXie ChengChao
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant MessagingMickaël Rémond
 
Game server development in node.js in jsconf eu
Game server development in node.js in jsconf euGame server development in node.js in jsconf eu
Game server development in node.js in jsconf euXie ChengChao
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dumpejlp12
 

Tendances (17)

Linux Servers
Linux ServersLinux Servers
Linux Servers
 
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsAppScaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
Scaling to Millions of Simultaneous Connections by Rick Reed from WhatsApp
 
Zimbra scripting with python
Zimbra scripting with pythonZimbra scripting with python
Zimbra scripting with python
 
Fixing Domino Server Sickness
Fixing Domino Server SicknessFixing Domino Server Sickness
Fixing Domino Server Sickness
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
How to be a lion tamer
How to be a lion tamerHow to be a lion tamer
How to be a lion tamer
 
Building fast,scalable game server in node.js
Building fast,scalable game server in node.jsBuilding fast,scalable game server in node.js
Building fast,scalable game server in node.js
 
14 FILE Server
14 FILE Server14 FILE Server
14 FILE Server
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web server
 
Intro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew KirchIntro to Zenoss by Andrew Kirch
Intro to Zenoss by Andrew Kirch
 
Game server development in node.js
Game server development in node.jsGame server development in node.js
Game server development in node.js
 
Real life XMPP Instant Messaging
Real life XMPP Instant MessagingReal life XMPP Instant Messaging
Real life XMPP Instant Messaging
 
Game server development in node.js in jsconf eu
Game server development in node.js in jsconf euGame server development in node.js in jsconf eu
Game server development in node.js in jsconf eu
 
Java troubleshooting thread dump
Java troubleshooting thread dumpJava troubleshooting thread dump
Java troubleshooting thread dump
 
Domino Adminblast
Domino AdminblastDomino Adminblast
Domino Adminblast
 

Similaire à Nimbuzz march2012

Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applicationsDing Li
 
MySQL HA Alternatives 2010
MySQL  HA  Alternatives 2010MySQL  HA  Alternatives 2010
MySQL HA Alternatives 2010Kris Buytaert
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introductionRandy Abernethy
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerMichael Rys
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMakerKris Buytaert
 
MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) Frazer Clement
 
Database Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfDatabase Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfShyam Anand
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'EnterprisePyCon Italia
 
Integrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesIntegrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesNovell
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...netvis
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUGKeith Hollman
 
Cassandra presentation
Cassandra presentationCassandra presentation
Cassandra presentationSergey Enin
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeTimothy Spann
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBasedarach
 

Similaire à Nimbuzz march2012 (20)

Software architecture for data applications
Software architecture for data applicationsSoftware architecture for data applications
Software architecture for data applications
 
MySQL HA Alternatives 2010
MySQL  HA  Alternatives 2010MySQL  HA  Alternatives 2010
MySQL HA Alternatives 2010
 
Apache Thrift, a brief introduction
Apache Thrift, a brief introductionApache Thrift, a brief introduction
Apache Thrift, a brief introduction
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL ServerSQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
 
Ice
IceIce
Ice
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
Dev381.Pp
Dev381.PpDev381.Pp
Dev381.Pp
 
MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014) MySQL Cluster overview + development slides (2014)
MySQL Cluster overview + development slides (2014)
 
Cassandra
CassandraCassandra
Cassandra
 
Sql material
Sql materialSql material
Sql material
 
Database Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdfDatabase Architecture - Case Study - SMS Gyan.pdf
Database Architecture - Case Study - SMS Gyan.pdf
 
Django è pronto per l'Enterprise
Django è pronto per l'EnterpriseDjango è pronto per l'Enterprise
Django è pronto per l'Enterprise
 
Integrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell TechnologiesIntegrating Apple Macs Using Novell Technologies
Integrating Apple Macs Using Novell Technologies
 
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
The sFlow Standard: Scalable, Unified Monitoring of Networks, Systems and App...
 
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA -   UKOUGEmbracing Database Diversity: The New Oracle / MySQL DBA -   UKOUG
Embracing Database Diversity: The New Oracle / MySQL DBA - UKOUG
 
Cassandra presentation
Cassandra presentationCassandra presentation
Cassandra presentation
 
Music city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lakeMusic city data Hail Hydrate! from stream to lake
Music city data Hail Hydrate! from stream to lake
 
MongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOLMongoDB: How We Did It – Reanimating Identity at AOL
MongoDB: How We Did It – Reanimating Identity at AOL
 
Complex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBaseComplex Er[jl]ang Processing with StreamBase
Complex Er[jl]ang Processing with StreamBase
 

Plus de nlwebperf

MeasureWorks - eCommerce Live - Designing Time & Conversion
MeasureWorks -  eCommerce Live - Designing Time & ConversionMeasureWorks -  eCommerce Live - Designing Time & Conversion
MeasureWorks - eCommerce Live - Designing Time & Conversionnlwebperf
 
Aaron Peters aug2012
Aaron Peters aug2012Aaron Peters aug2012
Aaron Peters aug2012nlwebperf
 
Jinspired june2012
Jinspired june2012Jinspired june2012
Jinspired june2012nlwebperf
 
Usabilla june2012
Usabilla june2012Usabilla june2012
Usabilla june2012nlwebperf
 
Steve Souders
Steve SoudersSteve Souders
Steve Soudersnlwebperf
 
Aspects of Modern APM Solutions
Aspects of Modern APM SolutionsAspects of Modern APM Solutions
Aspects of Modern APM Solutionsnlwebperf
 
Nimsoft Web performance monitoring
Nimsoft Web performance monitoringNimsoft Web performance monitoring
Nimsoft Web performance monitoringnlwebperf
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascriptnlwebperf
 
NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better nlwebperf
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Sitenlwebperf
 

Plus de nlwebperf (11)

MeasureWorks - eCommerce Live - Designing Time & Conversion
MeasureWorks -  eCommerce Live - Designing Time & ConversionMeasureWorks -  eCommerce Live - Designing Time & Conversion
MeasureWorks - eCommerce Live - Designing Time & Conversion
 
Aaron Peters aug2012
Aaron Peters aug2012Aaron Peters aug2012
Aaron Peters aug2012
 
Fashiolista
FashiolistaFashiolista
Fashiolista
 
Jinspired june2012
Jinspired june2012Jinspired june2012
Jinspired june2012
 
Usabilla june2012
Usabilla june2012Usabilla june2012
Usabilla june2012
 
Steve Souders
Steve SoudersSteve Souders
Steve Souders
 
Aspects of Modern APM Solutions
Aspects of Modern APM SolutionsAspects of Modern APM Solutions
Aspects of Modern APM Solutions
 
Nimsoft Web performance monitoring
Nimsoft Web performance monitoringNimsoft Web performance monitoring
Nimsoft Web performance monitoring
 
Hyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and JavascriptHyves: Mobile app development with HTML5 and Javascript
Hyves: Mobile app development with HTML5 and Javascript
 
NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better NLCMG - Performance is good, Understanding performance is better
NLCMG - Performance is good, Understanding performance is better
 
2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site2deHands.be - Tuning a Big Classifieds Site
2deHands.be - Tuning a Big Classifieds Site
 

Dernier

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 

Dernier (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 

Nimbuzz march2012

  • 1.
  • 2. Web Performance & Operations Meetup 2 march 2012 Ahmed Omar – omar@nimbuzz.nl Nico Klasens – nico@nimbuzz.nl 2
  • 3. What is Nimbuzz? Nimbuzz is a communication platform which provides services to make calls (Audio and Video), Internet and normal numbers send instant messages share files On any mobile device, desktop computer or Internet browser if possible. It connects with popular instant messaging and social networks Facebook, Windows Live Messenger (MSN), GoogleTalk, Yahoo!, and SIP/VoIP accounts 3
  • 4. Architecture Guidelines • Implement business features in external components, not modules inside xmpp router • Bundle functionality in small services • Implement services as stateless as possible • Communicate with users over XMPP • Communicate internal data over other connections This makes it possible to do multiple deployments to Nimbuzz every day. 4
  • 6. What is XMPP? eXtensible Message and Presence Protocol, Formerly known as Jabber A full XMPP session is one XML document. Client opens a <stream> and exchanges xml packets At the end closes </stream>. This requires long running TCP connections Packets always have a • From JID (JabberID : user@nimbuzz.com /resource) • To JID (JabberID : user@nimbuzz.com /resource) Three subtypes (Message, Presence and IQ) • Message (type=normal/chat, subject, body) • Presence (type=unavailable/subscribe/probe, show=chat/away/dnd) • IQ (id, type=get/set/result/error, one child element with extension namespace) 6
  • 7. What is XMPP? Instant Messaging and Presence extension • Roster - central point of focus is a list of one's contacts or "buddies" • Local Nimbuzz friends • Transports (gateways to external IM systems) • Transport friends • Presence information - network availability of particular contacts • Presence subscription – authorize contacts to receive “presence” • PrivacyList 7
  • 8. Ejabberd / Erlang Ejabberd is a XMPP instant messaging server, written in Erlang/OTP. Nimbuzz runs a modified version with its own extensions. Erlang is a programming language Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance. OTP is a set of Erlang libraries It includes its own distributed database, debugging and release handling tools. 8
  • 9. Erlang/OTP - Quick History - Why Erlang? o Concurrency o Fault tolerance o Distribution o Hot code swapping/ High Availability - Who uses Erlang?
  • 10. XMPP in action • XML stanzas (presence, iq, message) <presence to=‘user3@server-x’ type=‘subscribe’/> <presence> <show> chat </show><status>Just talk</status></presence> <iq from='user2@server-x/pc' type='get' id='roster_req1'> <query xmlns='jabber:iq:roster'/> </iq> <message to='user3@server-x' from ='user1@server-x/pc' type = 'chat‘> <body> Hey </body> </message>
  • 11. Ejabberd Why XMPP? o Real time communication o Extensibility Why Ejabberd? o Flexible  easy to setup a cluster  easy to configure  easy to extend  support for external services. o Powerful o Scalable... with caution.
  • 12. Persistence Bridge Application introduced to migrate to ejabberd, while still using the old database schema of the old xmpp server. data requests 1.839.333.853 per day = 21.288 per second A REST service written in java Apply validation/business rules and enhance data. Cache most accessed data in memcached what is stored in MySQL Cache community gateway rosters in Redis Migrate data to more efficient storage backends or database tables. 12
  • 13. Cache server Practices Use a naming convention for your keys: namespace:sequence@identifier Sequence has to be configurable Choose a good balance between memory size, expiry and number of servers. Memcached is/was single-threaded Decide on connection, read and data retrieval timeouts. Use command pipelining on every connection. Use different connections for different namespaced keys. Only write to MySQL, try to only read from cache server. update cache server on write Use Check And Set (CAS) command for partial updates and back out after retries. 13
  • 14. MySQL Practices Use connection pooling (mysql driver for java creates connections slow) Test connections with a mysql ping not with a statement “SELECT 1” Make every transaction a single sql-statement and turn autocommit on by default Split read and write statements to different connections. Add requesting host and application as sql comment to statement 14
  • 15. MySQL Practices Put statements outside programming code. Never use "SELECT *" column order might change and hard to check which are still used Never use "INSERT INTO table_name VALUES( ... )“ Use "INSERT INTO column1, colum2 table_name VALUES( ... )“ Do not rely on database DEFAULT values. Provide all values on INSERT. An exception on this is a TIMESTAMP field. All columns in the database have to be NOT NULL and a DEFAULT value Use Primary Keys as much as possible. 15
  • 16. Data tweaks Users send a lot of junk. Validate and drop. Do not try to correct Do not store data which is implied like + of phonenumbers Bulk insert, update and delete. INSERT INTO table (data) VALUES(?), (?) INSERT INTO table (id, data) VALUES(?,?), (?, ?) ON DUPLICATE KEY UPDATE data = VALUES(data) Do not use REPLACE if you don’t want to DELETE and INSERT. Very bad IO performance Sort rows based on primary key before update and delete Improves InnoDB page locks Use compound primary key to store records of one user together on disk (user_id, auto_increment_id) A mysql index on large table with text columns do not perform. Use fulltext search engines to have an index which is not fully in memory. Remove foreign keys to reduce storage. Trust the application to update and delete 16