Using JMeter with Presto

Apache JMeter is an open source application written in Java that is designed for load testing. This article presents how to install it, and how to create and run a test plan for testing SQL workloads on Presto clusters.

You will need Java on the system you are installing JMeter on. If you do not have Java installed on your system, see How do I install Java?

You will need a Presto cluster to configure JMeter to connect to and run the test plan on. You can create a Presto cluster for free in Ahana Cloud Community Edition.

Installing JMeter

To install Jmeter, start by downloading the latest JMeter build and unzipping the downloaded file into a new directory. For this article, the new directory’s name is jmeter.

Next, download the version of the Presto JDBC driver that matches your Presto version. The file you want to download is called presto-jdbc-X.XXX.jar

💡 As of this writing, the Presto JDBC driver version to use with an Ahana Presto cluster is presto-jdbc-0.272.jar. To find the Presto version for a cluster in Ahana, open the Manage view of the Presto cluster and look for Version of Presto in the Information section. The version shown will be similar to 0.272-AHN-0.1. Use the first four numbers to choose the Presto JDBC driver to download.

Copy the downloaded Presto JDBC driver jar file into the jmeter directory’s lib folder.

To run JMeter, change directories to the directory and run the command


Create a Test Plan in JMeter

In JMeter, select the Templates icon to show the Templates window. In the dropdown of the Templates window, select JDBC Load Test, then select Create.

Enter the JDBC endpoint in Database URL. In Ahana, you can find and copy the JDBC endpoint in Connection Details of the Presto cluster.

You can include either or both of the catalog and schema names in the Database URL separated by slashes after the port number. For example:


If not, you must specify the catalog and schema names in the SQL query in JDBC Request.

Enter com.facebook.presto.jdbc.PrestoDriver in JDBC Driver class.

Enter Username and Password of a Presto user attached to the Presto cluster.

In the navigation bar on the left, expand Thread Group, select JDBC Request, and enter the SQL query in Query.

💡 Do not include a semicolon at the end of the SQL query that you enter, or the test plan run will fail.

Set how many database requests run at once in Number of Threads (users).

In Ramp-up period (seconds), enter the time that JMeter should take to start all of the requested threads.

Loop Count controls how many times the thread steps are executed.

For example, if Number of Threads (users) = 10, Ramp-up period (seconds) = 100, and Loop Count = 1, JMeter creates a new thread every 10 seconds and the SQL query runs once in each thread.

You can add a report of the performance metrics for the requests to the test plan. To do so, right-click Test Plan in the left navigation bar, then select AddListenerSummary Report.

Select the Save icon in JMeter and enter a name for the test plan.

Run the Test Plan and View Results

To run the test plan, select the Start icon.

In the left navigation bar, select View Results Tree or Summary Report to view the output of the test plan.

Using JMeter with Presto_Summary Report Image

Run JMeter in Command Line Mode

For best results from load testing it is recommended to run without the GUI. After you have created and configured a test plan using the GUI, quit JMeter then run it from the command line.

For an example, to run JMeter with a test plan named testplan, and create a report in a new directory named report, run the following command:

bin/jmeter -n -t bin/templates/testplan.jmx -l log.jtl -e -o report

When the test plan is run, JMeter creates an index.html file in the report directory summarizing the results.