API Load Testing is a crucial process for assessing how well your application servers handle the expected production traffic. It allows you to systematically apply the anticipated load to your servers and observe how your application behaves. By conducting API Load Testing, you can identify any weaknesses or bottlenecks before your users encounter them, ensuring that your application is robust enough to handle the desired workload.
At Meta, we recognize the importance of API Load Testing and provide a comprehensive feature within our WhatsApp Cloud API that enables you to simulate traffic on the messaging API endpoint and evaluate their performance under various conditions. This feature empowers you to examine the overall performance of your API integration and assess its ability to handle concurrent requests from a large number of virtual users.
We understand the dynamic and demanding landscape of digital communication, and our commitment is firmly rooted in enabling businesses to thrive within it. By offering this feature, we empower our clients to stay ahead of the curve, delivering exceptional messaging services that can withstand the challenges posed by ever-increasing user demands and market fluctuations.
At present, our Cloud API offers "Outbound Load Test." This feature serves as a powerful tool for businesses to evaluate and enhance the resiliency of their WhatsApp Cloud API integration. By conducting Outbound Load Testing, clients can gain insightful measurements regarding their system's performance and identify areas for improvement.
The ability to proactively assess and optimize their systems is paramount for businesses aiming to provide seamless messaging experiences for their customers, even during periods of peak usage. By leveraging the Outbound Load Test feature, clients can gain confidence in the robustness and scalability of their WhatsApp Cloud API integration, ensuring that it can handle high message volumes without sacrificing performance or user experience.
Performing Outbound Load Testing using our Cloud API offers significant benefits in two distinct scenarios:
Solution Partners Tracking: Solution Partners can leverage load testing to track the time series of API requests made and the corresponding responses received. This enables Solution Partners to gain valuable insights into the performance of their systems over time. By monitoring these metrics, Solution Partners can identify patterns, analyze response times, and ensure optimal service delivery to their clients.
Message Status Webhook Monitoring: For businesses, load testing provides a means to monitor the number of message status webhooks received on their designated endpoint during the testing period. By analyzing webhook data, businesses can gauge the responsiveness and reliability of their systems in real-time. This allows them to proactively detect any issues, optimize their webhook handling processes, and ensure seamless message status updates for their users.
In both scenarios, load testing serves as a powerful tool for assessing and improving webhook performance. Whether it is tracking API request-response dynamics or monitoring message status webhooks, load testing empowers businesses and Solution Partners to enhance their services, optimize workflows, and deliver exceptional user experiences.
To ensure a smooth and effective load test experience, appropriate preparation is crucial. In the case of an outbound load test with Meta, we provide essential components to facilitate the process. Specifically, we will furnish you with a designated test number that will serve as the sender of the load test messages. Additionally, a range of dummy numbers will be provided to act as end user numbers for the test.
The test number we provide has been purposefully designed to process all the requests similar to a regular number would, but it will not deliver the messages to actual recipients. This thoughtful design prevents any inadvertent spamming of real numbers during the load test, maintaining the integrity of the process.
To initiate the load test, clients are required to create load test requests via our Direct Support channel. This ensures streamlined communication and enables our team to provide prompt assistance and guidance throughout the testing phase.
To set up the load test successfully, we kindly request the following information from our clients:
Existing Message Template Example: We require a sample of the message template you intend to use for the load test. This includes the associated name and WhatsApp Business Account (WABA) linked to it. Providing us with this information allows us to accurately replicate your messaging setup during the load test, ensuring realistic testing conditions.
Webhook URL: Please provide us with the URL of the webhook endpoint that will receive notifications and data from the load test. This enables us to capture and analyze the responses and behavior of your system during the test, allowing for thorough evaluation and optimization.
Webhook URL verify token: Please provide us the webhook verify token so that we can override your Webhook URL to receive notifications.
Once the load test session is confirmed, our dedicated support team will provide you with the necessary resources on the day of the load test, including:
Test Number: We will furnish you with a dedicated test number that will serve as the sender for the load test messages. This number is specifically designed to process all the requests like a regular number would, without delivering the messages to actual recipients. This ensures the load test is conducted accurately while safeguarding the privacy of real numbers.
Access Token: You will receive an access token that grants you the necessary authorization to initiate and monitor the load test.
Message Template: We will provide the specific message template and its corresponding details to be used during the testing. This includes the content, structure, and any variables or placeholders that need to be included within the messages.
Our support team will be available throughout the load test to provide guidance, address any queries, and ensure a smooth testing experience.
Note: It is crucial to ensure that no incoming messages are sent to the test number when registering or obtaining the ID of the outbound number. Sending a message to the test number during the load test can trigger a circuit breaker mechanism, resulting in the disconnection of the load test number. To maintain a stable and uninterrupted load test session, please refrain from sending any messages to the designated test number during the setup and execution of the load test.
There are certain tools that pair best depending on what development platform you use for load testing. The following are common platforms and their common load testing tools:
To conduct effective load testing, you will need the following tools: InfluxDB, Grafana and JMeter/Locust. Below are the steps to set up each component:
InfluxDB is a time-series database that works seamlessly with JMeter and Grafana. To install InfluxDB, visit InfluxDB download.
Due to known issues with the 2.x version of InfluxDB, you need to download the 1.x version of InfluxDB. You can find the 1.x version if you follow the download link above and then scroll down to the bottom of the webpage and select Are you interested in InfluxDB 1.x Open Source?.
Grafana is an open-source analytics and monitoring solution that supports various databases. The most commonly used approaches involve building Grafana dashboards using InfluxDB and Prometheus. In this section, we will focus on the integration with JMeter and InfluxDB. To install Grafana, please visit the Grafana download page.
JMeter is a powerful open-source load testing tool. To install JMeter, follow the installation guide available at the JMeter website.
Locust provides a flexible and efficient way to simulate user behavior and generate load on your system. Download the load test zip file provided by Meta and extract it.
Once you have installed the necessary components, follow these steps below to configure your setup using JMeter:
To start JMeter, follow these steps:
./jmeter
By executing this command, JMeter will launch, and you will have access to the JMeter application interface, allowing you to create and configure your performance tests.
Next step is to import the test plan. To import a sample test plan into JMeter, follow these steps:
LoadTest.en_US.jmx
test file. You can do this by selecting File > Open and locating the file within the JMeter interface.By following these steps, you will successfully import the sample test plan into JMeter and make the necessary modifications to tailor it to your specific testing requirements. This test plan provides a starting point for load testing your system and collecting performance metrics using JMeter and InfluxDB.
Next start the InfluxDB server and create a new database for storing JMeter readings:
./influxd
./influx
create database demo
With these steps completed, the InfluxDB server will be up and running, and you will have a designated "demo" database ready to store the JMeter readings.
To set up Grafana for JMeter, follow these steps:
./grafana-server
Username: admin Password: admin
With these steps completed, the Grafana configuration is now finished, and you are ready to run your JMeter test. Ensure that both JMeter and InfluxDB are running, and then execute the JMeter test to populate the Grafana dashboard you have just set up.
Once you have completed the setup steps outlined in the previous section, follow these instructions to run the test using JMeter:
Once you have installed the necessary components, follow these steps below to configure your setup using Locust.
To start Locust, follow these steps:
config.json
file included in the extracted files. In this file, you need to specify the template, auth_token, and phone_number_id values to be used for the load test.
{ "template": { "name": "welcome_user", "language": { "policy": "deterministic", "code": "en" } }, "auth_token": "<YOUR_TOKEN>", "phone_number_id": "<YOUR_PHONE_NUMBER_ID>" }
<YOUR_TOKEN>
with the appropriate authentication token and <YOUR_PHONE_NUMBER_ID>
with the corresponding phone number ID.pip3 install locust
locust -V
pip3 install locust-influxdb-listener
Next start the InfluxDB server and create a new database for storing Locust readings:
./influxd
./influx
pyt
.create database pyt
To set up Grafana for Locust, follow these steps:
./grafana-server
Username: admin Password: admin
pyt
locust-grafana-dashboard.json
file provided by Meta in the zip archive.By following these steps, you will have successfully set up Locust for load testing and ensured the necessary dependencies and configurations are in place.
Once you have completed the setup steps outlined in the previous section, follow these instructions to run the test using Locust:
locust -f locustFile.py
In the Locust terminal console, you should see verbose output indicating that the load test is running. Monitor the console for any reported failures. If there are no failures reported, it indicates that your initial test is successful, and you can proceed to configure the Grafana Dashboard.