Precautions and Methods for Parallel Execution of HTTP Requests Within LabVIEW Web Services

Updated Jul 6, 2026

Environment

Software

  • LabVIEW

When creating a web service using LabVIEW and hosting the web server on a PC using the NI Web Server, it is possible for client PCs on the same network (such as over the internet) to use HTTP methods to have the server PC execute the processes specified by the client PC.
If you want to improve processing speed by calling a program that performs certain processing in parallel within a web service, it is necessary to call subVIs asynchronously within the web service.
 
Here, we will review the programming methods required for parallel execution in web services. As an example, we introduce a programming method for processing multiple HTTP requests in parallel when sending multiple HTTP requests simultaneously to multiple Web VIs hosted by a web service. In addition, if you want to call the same Web VI of the same web service simultaneously using multiple HTTP requests, please refer to this document.


 

You can check the basics of how to create web services and web applications in this document.

Here, in the web service, a subVI is called as shown below. This subVI performs simple array processing, waits for a specified amount of time, and outputs the start time and end time of the VI execution.
Parallel.png


If a POST request (Parallel.vi) containing this subVI is called multiple times in parallel from a client PC, execution will not be processed simultaneously, but will be processed sequentially. If you need to call/execute the contents of the POST request of Prallel.vi at the same time, create multiple POST requests with the same contents. At this time, the same subVI can be used in each POST request.

As shown above, create three POST requests: Parallel.vi, Parallel2.vi, and Parallel3.vi, and execute them simultaneously as shown below to confirm that they operate as expected.ParallelExecution.png

Red, green, and blue correspond to POST requests to Parallel.vi, Parallel2.vi, and Parallel3.vi, respectively, with wait times of 2 seconds, 3 seconds, and 4 seconds specified. The start time of these processes is approximately the same at 21:02:50, and the end time occurs after the specified wait time has elapsed for each.
 
On the other hand, when calling a subVI multiple times within each POST request or when improving processing speed using a parallel execution mode For Loop, it is necessary to call the subVI within the POST request as shown below, and then perform an asynchronous VI call inside that subVI.
asynccall.png



If you need to call VIs asynchronously or execute them in parallel when creating a Web service, you will need to program as above depending on your purpose.