All Products
Search
Document Center

Performance Testing:Send Protobuf binary request bodies over HTTP(S) in JMeter

Last Updated:Mar 10, 2026

When your HTTP(S) API accepts Protocol Buffers (Protobuf) binary payloads, you need a way to load-test it with real .pb files rather than text-based request bodies. Performance Testing (PTS) runs Apache JMeter-based tests at scale, so you can build and verify the test plan locally, then upload it to PTS for full-scale performance testing.

Note

This guide covers sending Protobuf over HTTP(S). If your service uses gRPC (which transmits Protobuf over HTTP/2), the configuration differs and is not covered here.

How the request is sent

JMeter's HTTP Request sampler has a Files Upload tab that can send a binary file as the raw request body. The key: leave the Parameter Name field blank. This tells JMeter to send the file content directly as the body instead of wrapping it in a multipart form upload. Combined with the application/x-protobuf Content-Type header, the Protobuf binary payload reaches your server exactly as expected.

The workflow has two phases:

  1. Build and verify locally -- Configure and debug the JMeter test plan on your machine.

  2. Run at scale on PTS -- Upload the test plan and binary files to PTS, then start the performance test.

Prerequisites

Before you begin, ensure that you have:

  • An activated PTS instance

  • Apache JMeter 5.6.3 installed locally (PTS supports JMeter 5.0 and 5.6.3)

  • A Protobuf binary file (.pb) to use as the request body

Build the JMeter test plan

Configure the HTTP Request sampler

  1. Add an HTTP Request sampler to your test plan. On the Basic tab, configure the target endpoint:

    FieldDescriptionExample
    Protocolhttp or httpshttps
    Server name or IPAPI hostname or IP addresslocalhost
    Port NumberService port9889
    MethodHTTP methodGET

    HTTP Request Basic tab configuration

Attach the Protobuf binary file

  1. Switch to the Files Upload tab and add the .pb file:

    FieldValueWhy
    File Pathtest.pb (filename only, no local path)JMeter resolves the file relative to the test plan
    Parameter Name*(leave blank)*An empty parameter name tells JMeter to send the file as the raw request body, not as a multipart form upload
    MIME Typeapplication/octet-streamIdentifies the file as binary data

    Files Upload tab configuration

Set the Content-Type header

  1. Add an HTTP Header Manager to the HTTP Request sampler. Set the Content-Type header to application/x-protobuf so the server knows the body contains Protobuf-encoded data.

    HTTP Header Manager with Content-Type

Verify the request locally

  1. Run the test plan and check the results in View Results Tree. Confirm that: View Results Tree showing request and response

    • The request body contains the binary Protobuf data.

    • The Content-Type header is application/x-protobuf.

    • The server returns the expected response.

  2. After debugging succeeds, save and export the test plan (for example, test.jmx).

Configuration summary

Verify your JMeter settings before uploading to PTS:

ComponentSettingValue
HTTP Request > BasicProtocolhttp or https
HTTP Request > BasicServer name or IPYour API hostname
HTTP Request > BasicPort NumberYour service port
HTTP Request > BasicMethodGET (or your target method)
HTTP Request > Files UploadFile Pathtest.pb (filename only)
HTTP Request > Files UploadParameter Name*(blank)*
HTTP Request > Files UploadMIME Typeapplication/octet-stream
HTTP Header ManagerContent-Typeapplication/x-protobuf

Create and run the performance test on PTS

Upload the test plan

  1. Log on to the PTS console. Go to Performance Test > Create Scenario, then click JMeter.

  2. Enter a scenario name on the Scenario Settings page. Upload both the .jmx test plan file and the .pb binary file exported in the previous section.

    Scenario Settings with uploaded files

  3. Select the Jmeter Version that matches the version used to create your script (for example, 5.6.3).

    Important

    The JMeter version in PTS must match the version used to create the test plan. A version mismatch can cause script parsing errors or unsupported function calls.

    JMeter Version selection

Configure the stress testing model

  1. Set the stress source and parameters. This example uses Alibaba Cloud VPC as the stress source. Set the concurrency level, ramp-up period, and test duration based on your requirements. For details, see Configure the stress testing model and level and Billing overview.

    Stress testing configuration

Debug and start the test

  1. Debug the stress testing scenario before running a full test. Debugging catches configuration issues early and avoids wasted runs.

  2. After debugging succeeds, click Save and Test. On the Tips page, select Trigger Now and Make sure that the test is approved and complies with local laws, then click Start Testing.

Analyze the results

After the test completes, PTS generates a performance report that includes:

  • Scenario metrics -- throughput, response time, and error rate

  • Business details -- per-API performance breakdown

  • Monitoring details -- resource utilization during the test

  • API sampling logs -- request and response samples

For a full walkthrough, see View a JMeter performance testing report.

What's next