Windows and Ubuntu HTTP Server time Difference ?
Quote from joedalton on 08/02/2024, 14:39Hello, I work on a project. I take data from http server http://localhost:54664/sample and, when I work on Ubuntu it takes 70ms but I run it on Windows it takes 700-800 ms. What can I do for fast it. (for example : Close firewall)
Hello, I work on a project. I take data from http server http://localhost:54664/sample and, when I work on Ubuntu it takes 70ms but I run it on Windows it takes 700-800 ms. What can I do for fast it. (for example : Close firewall)
Quote from mm_dev on 09/02/2024, 09:27Can you specify your setup (what is receiving + processing the data) and how you're measuring the time it takes so we can validate this issue? Different time measurement methods can lead to very different results.
Do you see a similar difference when transmitting data from one RTSA instance to another with HTTP server and client? When running on the same system, latency there should be below one millisecond ideally, certainly not double- or triple-digit millisecond values.
Can you specify your setup (what is receiving + processing the data) and how you're measuring the time it takes so we can validate this issue? Different time measurement methods can lead to very different results.
Do you see a similar difference when transmitting data from one RTSA instance to another with HTTP server and client? When running on the same system, latency there should be below one millisecond ideally, certainly not double- or triple-digit millisecond values.
Quote from joedalton on 12/02/2024, 07:06I send get request and take it in loop.
I run this same code in ubuntu and windows. ubuntu faster than windows 3 times.
For example : Ubuntu 160ms, windows 450ms
- HTTP server blocks same just their ports are different.
- System is same because, My computer has 2 OS, ubuntu and windows, I select when is opening.
I send get request and take it in loop.
I run this same code in ubuntu and windows. ubuntu faster than windows 3 times.
For example : Ubuntu 160ms, windows 450ms
- HTTP server blocks same just their ports are different.
- System is same because, My computer has 2 OS, ubuntu and windows, I select when is opening.
Quote from mm_dev on 12/02/2024, 09:41And your getData() function does what exactly? Chances are the delay is caused by your processing code, not the data transfer. The following python code returns a transfer time of under two milliseconds on my Windows system:
Parsing the JSON data of the request will usually take much longer, depending on the amount of data returned and how you're processing it. And in case you're printing it to the console then that will be the most significant delay, and also the most likely candidate for a major difference between Windows and Linux.
And your getData() function does what exactly? Chances are the delay is caused by your processing code, not the data transfer. The following python code returns a transfer time of under two milliseconds on my Windows system:
Parsing the JSON data of the request will usually take much longer, depending on the amount of data returned and how you're processing it. And in case you're printing it to the console then that will be the most significant delay, and also the most likely candidate for a major difference between Windows and Linux.
Quote from mm_dev on 13/02/2024, 10:38Can't really reproduce your problem, testing with your code yields a delay of 15-30ms here (not sure why it is that much slower than the python code I posted).
One thing you can try is to limit the process to a single CPU core (Task Manager -> Details -> Right click on process -> Set Affinity), at least here that seems to actually reduce latency from ~25ms to ~15ms.
If you're still seeing >100ms delays you could try to use a network analyzer like Wireshark to check the actual latency between request and reply at the network level. In the image below you can see that the actual network latency is about 10ms, while the time measurement in the code reports an overall latency of about 25ms. So there is apparently quite some overhead imposed by Qt.
Can't really reproduce your problem, testing with your code yields a delay of 15-30ms here (not sure why it is that much slower than the python code I posted).
One thing you can try is to limit the process to a single CPU core (Task Manager -> Details -> Right click on process -> Set Affinity), at least here that seems to actually reduce latency from ~25ms to ~15ms.
If you're still seeing >100ms delays you could try to use a network analyzer like Wireshark to check the actual latency between request and reply at the network level. In the image below you can see that the actual network latency is about 10ms, while the time measurement in the code reports an overall latency of about 25ms. So there is apparently quite some overhead imposed by Qt.