SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais 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
 

Mais 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
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

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