General advice needed for high load testing Ubuntu instance

Ubuntu Support Template

Ubuntu Version:
22.04 LTS Desktop

Desktop Environment (if applicable):
GNOME

Problem Description:
I am looking for an advice in how Ubuntu optimizes if at all incoming TCP requests.

Is there anything in the Ubuntu (Linux) kernel—such as buffering, caching, or other optimizations—between the event when the initial TCP SYN packet received from the client during TCP connection and another event which sends the final HTTP response, that could artificially decrease latency per request when testing from a single client?
In other words, Are there any optimizations in the network stack of Ubuntu that depend on using the same client IP address and port?

Details about my situation:
I have created a simple Java application and I need to perform high-load testing after deploying it on Ubuntu 24.04.2 LTS Desktop.

I have connected 2 laptops through Ethernet cable. Both laptops are running on the same Ubuntu flavor(24.04.2 LTS). One laptop plays role of a server and another one sends millions of requests for the sake of testing.

Everything is going smoothly and I have already achieved desired throughput in my testing. But the requests are coming from only 1 client(using virtual IPs and different local ports) and there is a chance that Ubuntu(from server/receiver side) is able to recognize it and somehow optimize it, so that I’m getting false positive results about throughput.

I’d like to understand if there is any mechanism in Ubuntu which could do this and how much it may affect final result of such kind of tests?

Relevant System Information:
I’m using HTTP requests between 2 instances running on Ubuntu 24.04.2 LTS

In a stock network stack on Linux it’s usually up to the receiving application to optimize requests (such as an NGINX webserver that is set to cache response data or such).

There are numerous load tester apps out there to do what you are looking at.

However, there are other factors to consider such as system resources on the server system, network connection limits, intermediate network hops between Client and Server, and a numerous number of other potential factors including I/O of system disks for read/write or CPU pressure or such that goes beyond the network stack.

(It is thus impossible to give you any completely definitive answer because of the plethora of impacting variables)

2 Likes

Hi @teward

Thanks for your answer.

Yes, I understand there are a lot of different factors to be considered for optimization. I am going through this with my test Java app. I experiment with different configurations including for Ubuntu, Webservers, network, etc. The question I’m asking is about one of those experiments.

My question is not about “how to optimize” I would like to understand how Ubuntu is implemented at that place(while TCP handshake and sending packets).

Have a look please at the sequence diagram which I draw to give a clue what I mean. I am asking about any optimizations based on the same IP/port by Ubuntu between red squares.

I fail to see how I was misunderstood:

In a default environment there is nothing special compared to any other Linux network stack. There are no special optimizations in the network stack for any of what you’re asking. There are no special handling rules for initial TCP handshakes or responses during a packet transfer.

Again, how those packets are interpreted by an application is at the Application’s socket implementations. I did not say anything about you needing to optimize your code, or anything along those lines.

To quote your original question:

I am answering you directly: there is nothing in the general kernel / Linux / default Ubuntu network stack that impact this in a default stock setup. ANY socket implementations or optimizations would have been done either in the Java implementations of socket handling or in your application.

1 Like

Thanks for the reply

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.