Picky Assist Help Desk
Main WebsiteBlogFacebook Community
Picky Assist Help Desk
Picky Assist Help Desk
  • Welcome To Picky Assist 🙏
  • Setting Up Guide
    • Sending First Message
    • Connecting Channels
      • WhatsApp Web Automation to Official API Migration Guide 2024
      • Connecting WhatsApp Web Automation
      • Connecting Facebook Messenger
        • Introduction
        • Getting Start
        • Guidelines & Compliances
        • Messenger Link
      • Connecting WhatsApp Official
        • Introduction
        • Dashboard
        • Profile
        • Templates
      • Connecting WhatsApp Cloud API
      • WhatsApp Official Managed Service
      • Connecting Instagram
      • Phone Bridge (Call Blaze)
      • Connecting SMTP
      • Connecting Amazon SES
      • Connecting Sendgrid
      • Connecting Additional WhatsApp Numbers
      • Porting WhatsApp Number to Picky Assist
      • WhatsApp Official Message Delivery Issues & Solutions
    • Working With Prebuilt CRM Modules
      • Introduction
      • Onboarding
      • Modules
        • Leads
        • Deals
        • Meetings
        • Company
        • Support Cases
        • System Modules
          • Contacts
          • Notes
          • Task
          • Call Logs
          • Tags
          • Activity Logs
      • Automations
        • Workflows
        • Chatbots
        • Funnels
        • Connectors
        • Scheduler
        • Other Prebuilt Features
      • Reports and Dashboard
      • Mandatory Preconditions for Using Prebuilt
      • Testing Prebuilt
    • Managing Organization
    • Setting Up Teambox
      • Introduction
      • Routing Rules
      • Teambox
      • Inbox View
      • Organization Hierarchy
      • Analytics
    • Setting Up Smart Replies
      • Introduction
      • Train Module
        • Training Bot Introduction
        • Topics / Categories
        • Intent & Context
        • Question Variations
        • Uploading Bulk Questions
        • Reply with Media Files
        • Personalising Replies
        • Smart Actions
        • Direct URL
        • Fall Back Response
        • Small Talks
        • Testing the Bot
        • Publishing Bot
      • ChatGPT Integration
      • Learn Module
      • Stats Module
      • Deep Linking
      • Settings
    • Smart Reply V2
      • Introduction
      • ChatGPT Integration
      • Train Module
        • Training Bot Introduction
        • Topics / Categories
        • Intent & Context
        • Question Variation
        • Uploading Bulk Questions
        • Reply with Media Files
        • Personalizing Replies
        • Smart Actions
        • Direct URL
        • Fall Back Response
        • Small Talks
        • Publishing Bot
      • Learn Module
      • Stats Module
      • Deep Linking
      • Settings
    • Setting Up Broadcaster
      • Introduction
      • Creating a Campagin
      • Sending Message to WhatsApp Groups
      • Reports
      • Broadcaster V2
        • Introduction
        • Creating Campaign
        • Reports
    • Setting Up Sequence
      • Introduction
      • Creating New Sequence
      • Sequence Stats
      • Subscribe & Unsubscribe
      • Disabling Sequence Message
    • Setting Up Reminder
    • Setting Up Mobile App
    • Setting Up Connector
      • Introduction
      • Getting Started
      • Steps
        • Introduction
        • Filters
        • Delay
        • Iterator
        • Stats
      • Actions
      • Formatter
        • Date & Time
        • Counter
        • Math Calculation
        • Data Parser
        • Convert File
        • Line Items
      • Building Mini App
      • Email Parser
      • Data Storage
      • Simulate Test
      • Connector Logs
    • Email Builder
    • Setting Up Flow Builder
      • Fundamentals (Must Read)
      • Basic Terminology (Must Read)
      • Guide to Building an Effective Chatbot (Must Read)
      • Create, Manage, Test & Publish Flows
      • Triggering a Chatbot Flow
      • Steps
        • Introduction (Must Read)
        • Send Message
        • Ask A Question
        • Filter
        • Save Data
        • Actions
        • Check WhatsApp Session
        • Delay
        • Smart Delay
        • Formatter
        • Splitter
        • Data Lookup
        • Trigger HTTP API
        • Webhook
        • Apps
        • Match Keywords
        • Route to Chatbot
        • End
      • Saving Data into CRM
      • Analytics
      • Integrations
      • Flow Builder logs and conversational logs
      • Chatbot Best Practices, Ideas & FAQ
    • Setting up Modular CRM
      • Fundamentals (Must Read)
      • Guide to Building and Implementing a Modular CRM (Must Read)
      • Create & Manage Data Modules
      • CRM Macro Buttons
      • Adding Records into CRM
      • Data View & Manage Records
      • Task
      • Workflows
      • Funnels
      • Data Import
      • Integrations
    • Setting Up Scheduler
    • Media Gallery
    • Quick Replies
    • Opt-out Settings
    • Blacklist
    • Global Variables
    • Setting Up Ad-On's
      • Setting Up WhatsMail
      • Setting Up Zendesk
      • Setting Up Zapier
      • Setting Up Zoho CRM
        • Getting Started
        • Working with Extension
        • Integrating with Zoho Workflow
        • Lead Assignment Rules
        • Integrating into Custom Modules
        • Connecting Multiple WhatsApp Numbers into Zoho CRM
        • Integrating WhatsApp with Zoho CRM Mobile App
        • Keyboard Shortcuts
      • Setting Up Facebook Lead Adform
      • Facebook Lead Ad form V2
      • Setting Up WhatsApp Web
      • Setting Up Pabbly Connect
      • Setting Up ChatGPT App
    • Google Chrome Extensions
      • Extension for Sending WhatsApp Messages from any Webpage
      • Chrome Extension V2
      • Extension for Zoho CRM & Teambox
    • Managing Profile
      • Two Factor Aunthentication
      • Login History
      • Delete Account
    • Quick Rollout Guide
      • WhatsApp Official Account
    • Developers & Partners Guide for Deep Integration of Picky Assist
  • API Documentation V2
    • Introduction
    • Quick Start Guide 🏃
    • Global Webhook
      • How Webhook Works
      • Webhook Variables
      • Configuring Webhook URL
      • Webhook Request & Response
      • Getting the Conversation Context
      • Testing Your Webhook
    • Event Webhook
      • How Event Webhook Works
      • Event Webhook Variables
      • Configuring Event Webhook URL
      • Event Webhook Sample Request & Response
    • Push API
      • Introduction
      • API Variables
      • Sending Single Message - Push
      • Sending Dynamic Messages – Push
      • Sending Media Attachments – Push
      • Sending Interactive List & Buttons
      • Sending Stickers
      • Sending Bulk Messages - Push
      • Sending Contacts
      • Sending Location
      • Sending WhatsApp Template Messages
        • Introduction
        • Sending WhatsApp Template Text Messages
        • Sending WhatsApp Template Image
        • Sending WhatsApp Template Document
        • Sending WhatsApp Interactive Buttons
        • Sending WhatsApp Limited Time Offer Templates
      • Sending Message to Groups
      • Sending SMS Using SIM Card
      • Sending Message to Facebook Messenger
      • Normal Post Method
      • Delivery Reports
      • Push API Must Read Instructions
      • Testing API Requests
    • WhatsApp Template API
      • Introduction
      • API Variables
      • Template Request API
      • Template Status API
      • Languages
      • Guidelines
    • WhatsApp Group API
      • Introduction
      • API Variables
      • Create Group
      • Set Group Permission
      • Add Group Admin
      • Add Group Members
      • Fetch Group Details
      • Update Group Info
      • Remove Group Members / Admin
      • Generate New Invite Link
      • Group Delete Actions
    • WhatsApp Settings API's
      • WhatsApp Profile API
      • 2 Step Verification
      • WhatsApp Status Update
      • WhatsApp Contact & Group Fetching
    • Device Manage API’s
      • Fetching Device Status API
      • Device Commands API’s
      • WhatsApp Automation Server Status API
    • Account API
      • Fetch Balance
    • Project Management API
      • Introduction
      • Create Project
      • Get Project Details
      • Set / Update Webhook
      • Create API Token
      • Manage API Token
      • Change Billing Plan
      • Fetch Account Balance
      • Country Code & Timezones
    • References
      • Status & Error Codes
      • Most Frequent Issues & Solutions
      • Formating & Sending Emojis 😊
      • Postman Collection for Picky Assist API's
      • High Volume Messaging Bots - WhatsApp
    • Sample Codes
      • PHP
      • Python
      • Node JS
      • Ruby
      • Java
      • ASP.NET Using C#
      • Javascript
      • Go
      • Swift
      • C
      • C#
      • Objective C
  • General Guidelines
    • Billing
    • Adding Money Into Account
    • Rate Limits
    • Character Limits WhatsApp
    • Best Practices for Media Handling
    • Roadmap
    • Features In the Early Beta Version
  • Changelog
    • 2021
      • February 2021
      • March 2021
      • April 2021
      • May 2021
      • June 2021
    • 2020
      • February 2020
      • March 2020
      • April 2020
      • May 2020
      • June 2020
      • September 2020
      • October 2020
    • 2019
      • November 2019
      • October 2019
      • August 2019
      • September 2019
Powered by GitBook
On this page
  • Understand WhatsApp Docker , Core App & Database
  • Understand Your Allocated TPS
  • Prepare your Server & Application
  • How Queuing Works
  • High Availability & MultiConnect
  • High Availability
  • MultiConnect Instances
  • Groups & Scalability

Was this helpful?

  1. API Documentation V2
  2. References

High Volume Messaging Bots - WhatsApp

PreviousPostman Collection for Picky Assist API'sNextSample Codes

Last updated 5 years ago

Was this helpful?

In this guide we will discuss how to handle high volume messaging bots through API & Webhook's for Official WhatsApp

Understand WhatsApp Docker , Core App & Database

WhatsApp used a very interesting and completely different solution from other messenger like Messenger or Telegram.

To have a bot in the WhatApp we need to rotate a Node (node) in an instance of our own. This node maintains connectivity to WhatsApp over a long-lived TCP connection.

Our backend is attached to this node and not directly to the WhatsApp servers. Below we will explain a little better this architecture.

Instance / Node

Each WhatsApp number needs a dedicated machine to run the WhatsApp client. On this machine we will run

CoreApp MySQL WebApp

CoreApp

CoreApp is the application that does all the magic. It will connect to the WhatsApp servers, it will keep the encryption keys (do not forget that WhatsApp is encrypted end-to-end , the node keeps all these keys in MySQL ), it will manage the messages coming and going, backup contacts, etc.

MySQL

MySQL here WhatsApp stores all incoming and outgoing messages along with media in encrypted format.

WebApp

WebApp is the application that interfaces between the backend and CoreApp. Basically it is a web service authenticated by tokens for sending messages out.

By default all WhatsApp Messaging Accounts are configured on a Single Docker Container and able to handle 10 to 25 Concurrent Messages. WhatsApp Offers to Scale up at extra cost.

Understand Your Allocated TPS

Through Put Per Second (TPS) plays a big role to handle high messaging volumes, based on your selected plan we have allocated dedicated TPS like 10, 15, 20 to each number

The TPS is calculated based on the following events ;

  1. Receiving Message

  2. Sending Message

  3. Getting Delivery Reports

  4. Getting Read Reports

So let's assume that you have 10 TPS this means you can handle upto 10 interactions per second, please note the delivery and read reports also counted in the TPS limit.

Webhook is responsible to push incoming messages to your server on real time basis

Event Webhook is responsible to push delivery and report reports to your server when its available

Push API is responsible to send messages out, recommend to use Webhook Instant reply if you want to give an instant reply back to the user

Prepare your Server & Application

Please make sure your web server and application can handle the concurrent load as per the allocated TPS especially the incoming messages as the load is not predictable.

Below is the basic server configuration needed for your webserver to handle concurrent requests, please note the below is just for your reference and prepared based on Apache Web Server on a Linux Machine considering no other apps running.

Server Configuration

TPS

2 CPU , 2 GB RAM, SSD or IO Optimised Hard disk recommended

10 TPS

4 CPU , 4 GB RAM , SSD or IO Optimised Hard disk recommended

15 TPS

6 CPU, 6 GB RAM , SSD or IO Optimised Hard disk recommended

20 TPS

You need to have enough bandwidth if your bot is sending and receiving many media files

How Queuing Works

Incoming Queue

Incoming messages will be queued at WhatsApp end if it reaches the TPS allocated and if the queue exceeds the core app capability then the WhatsApp starts rejecting the incoming messages and this leads to missing of incoming messages forever.

Delivery & Read receipts also consider as incoming message queue , since WhatsApp push this to the docker when its avaiablle.

If your server gets overloaded try removing the Event Webhook from Settings -> Webhook -> Event Webhook this may decrease the load by 50%, as for each outgoing message there will be 1 - 2 event webhook get triggers to your server i.e (Delivered & Read) , by disabling this you can give more priority to the incoming message webhook.

It's possible to disable Delivery Report Events in WhatsApp Docker which will increase the TPS, if your bot is expecting high volume of messaging then we recommend to disable this , by default delivery reports events are enabled and if you need to disable the same then please contact us. Currently it's not possible to disable delivery reports for the group messages.

Outgoing Queue

There will be no queue at WhatsApp end for outgoing messages so you need to manage the outgoing message queue at your end based on your avaiablle TPS and message priority

By default we dont manage the message queue from an API request as we dont know the message priority however if you wish to enable the queue at our end then please keep in touch with us. We can manage the queue only from PUSH API i.e we will not able to queue messages which is coming as an instant response of the webhook.

High Availability & MultiConnect

The standard WhatsApp Business API Client solution runs on a single Docker container. In case you want to split the load and have multiple servers send and receive messages to WhatsApp, you can make use of the multiconnect solution on top of it offered by WhatsApp

High Availability

The standard WhatsApp Business API Client solution runs on a single Docker container. High availability, allowing you to have Docker containers on stand-by in case the primary Docker container goes down.

A high availability cluster requires at least two Master nodes and two Coreapp nodes as seen in the following diagram:

High Availability setup does not increase the TPS but it ensures business continuity even one WhatsApp docker goes down automatically another docker will start processing the messages.

We charge extra for configuring high availability WhatsApp Infra

MultiConnect Instances

With high availability, only one Docker container is responsible for sending and receiving messages from WhatsApp servers. If messaging traffic exceeds the maximum throughput of a single Docker container, there will be backlog of message sends and message delivery latency will increase. To scale out the WhatsApp Business API Client, multiconnect supports sharding to spread loads across multiple Docker containers. Currently, WhatsApp only support static sharding with a shard number of 1, 2, 4, 8, 16, or 32. High availability is a special case of multiconnect where the shard number is 1.

Please contact us if you wish to setup multiconnect infrastructure, this service will cost you extra.

Groups & Scalability

If you are using WhatsApp Groups in your WhatsApp Official Account then please aware about the following limitations ;

  1. WhatsApp Groups is in beta

  2. Delivery / Read reports cant be disabled in Docker

If you have large number of groups and high engaging users in the group this can affect your TPS badly , see how it affects your TPS ;

Let's assume you have 10 Groups with 256 members in each group i.e total 2560 members and when you or someone sends a message to the group and when each user reads the message an event webhook will trigger to your server so one message in a group leads to 2560 event triggers. This will consume your TPS.

Please consider the above limitations while you create and manage the groups , currently its not possible to disable delivery / read report events in the docker.

High Availability and Multiconnect