Hi,
iam trying to speed up the TSViewer, so yesterday ive spent some time profiling it to find out what takes so long when i query an server and to shorten the time it takes if possible. Ive checked in already with ScP and he advised me to open a thread about it. Here it is.
I found, the cause are the replies from the TS3 server itself. Ive commenced a small testing and integrated debug timing lines into the console output. The findings are suprising for me. I would like to talk about this with you guys. Please take a look at the following test results.
First the connection to the server is being established, the server type verified ("TS3"), the virtual server selected and then, to have uniform results, the same command ("serverinfo") sent 5 times. After every command the data line is read and then the status line ("error id=0 msg=ok"). I sum and display the timings [ms] of everything below.
127.0.0.1
Observation
The server delays the reply of each status line by 38ms. The client and the server are on the same host, the IP is in the whitelist file by default.
Planet TeamSpeak [~ 20ms ping]
Observation
It takes about 20ms to get the data line after every command, which is as expected since this is the ping time. But the status lines get delayed by the server.
USA [~ 200ms ping]
Observation
Here it takes for every line (data & status) the time of the ping time.
Korea [~ 400ms ping]
Observation
Same as with the USA server
Question
Is this the expected behaviour?
Thank you for reading.
Mariusz Bieniek
http://www.tsviewer.com
tcp query -> issue: delay between reply of lines
iam trying to speed up the TSViewer, so yesterday ive spent some time profiling it to find out what takes so long when i query an server and to shorten the time it takes if possible. Ive checked in already with ScP and he advised me to open a thread about it. Here it is.
I found, the cause are the replies from the TS3 server itself. Ive commenced a small testing and integrated debug timing lines into the console output. The findings are suprising for me. I would like to talk about this with you guys. Please take a look at the following test results.
First the connection to the server is being established, the server type verified ("TS3"), the virtual server selected and then, to have uniform results, the same command ("serverinfo") sent 5 times. After every command the data line is read and then the status line ("error id=0 msg=ok"). I sum and display the timings [ms] of everything below.
127.0.0.1
Code:
0.000 connecting to server
0.000 connected
-------------------------------
0.000 verifying ts3 instance, reading 2 lines
0.000 reading 'TS3' line
0.008 reading 'Welcome to TeamSpeak' line
0.009 verification complete, time needed: 0.008s
-------------------------------
0.009 sending CMD: use port=9987
0.009 waiting/reading one line
0.010 read complete, time needed: 0.001s
-------------------------------
0.010 sending CMD: serverinfo
0.010 waiting/reading one line
0.010 read complete, time needed: 0.000s
0.010 waiting/reading one line
0.010 read complete, time needed: 0.000s
-------------------------------
0.012 sending CMD: serverinfo
0.012 waiting/reading one line
0.012 read complete, time needed: 0.000s
0.012 waiting/reading one line
0.050 read complete, time needed: 0.038s
-------------------------------
0.051 sending CMD: serverinfo
0.052 waiting/reading one line
0.052 read complete, time needed: 0.000s
0.052 waiting/reading one line
0.090 read complete, time needed: 0.038s
-------------------------------
0.092 sending CMD: serverinfo
0.092 waiting/reading one line
0.092 read complete, time needed: 0.000s
0.092 waiting/reading one line
0.130 read complete, time needed: 0.038s
-------------------------------
0.132 sending CMD: serverinfo
0.132 waiting/reading one line
0.132 read complete, time needed: 0.000s
0.132 waiting/reading one line
0.170 read complete, time needed: 0.037s
-------------------------------
NET CONNECT (~PING): 0.000s
NET TS3 VERIFICATION: 0.008s
NET DATA LINES TOTAL: 0.000s
NET STATUS LINES TOTAL: 0.152s
NET TOTAL: 0.160s
SCRIPT TOTAL: 0.176s
Observation
The server delays the reply of each status line by 38ms. The client and the server are on the same host, the IP is in the whitelist file by default.
Planet TeamSpeak [~ 20ms ping]
Code:
0.000 connecting to server
0.022 connected
-------------------------------
0.022 verifying ts3 instance, reading 2 lines
0.022 reading 'TS3' line
0.048 reading 'Welcome to TeamSpeak' line
0.066 verification complete, time needed: 0.043s
-------------------------------
0.066 sending CMD: use port=9987
0.066 waiting/reading one line
0.085 read complete, time needed: 0.019s
-------------------------------
0.085 sending CMD: serverinfo
0.085 waiting/reading one line
0.106 read complete, time needed: 0.021s
0.106 waiting/reading one line
0.161 read complete, time needed: 0.055s
-------------------------------
0.163 sending CMD: serverinfo
0.163 waiting/reading one line
0.187 read complete, time needed: 0.024s
0.187 waiting/reading one line
0.241 read complete, time needed: 0.054s
-------------------------------
0.243 sending CMD: serverinfo
0.243 waiting/reading one line
0.263 read complete, time needed: 0.021s
0.263 waiting/reading one line
0.317 read complete, time needed: 0.053s
-------------------------------
0.319 sending CMD: serverinfo
0.319 waiting/reading one line
0.341 read complete, time needed: 0.023s
0.341 waiting/reading one line
0.397 read complete, time needed: 0.055s
-------------------------------
0.399 sending CMD: serverinfo
0.399 waiting/reading one line
0.420 read complete, time needed: 0.021s
0.420 waiting/reading one line
0.474 read complete, time needed: 0.055s
-------------------------------
NET CONNECT (~PING): 0.0220s
NET TS3 VERIFICATION: 0.043s
NET DATA LINES TOTAL: 0.110s
NET STATUS LINES TOTAL: 0.291s
NET TOTAL: 0.466s
SCRIPT TOTAL: 0.481s
Observation
It takes about 20ms to get the data line after every command, which is as expected since this is the ping time. But the status lines get delayed by the server.
USA [~ 200ms ping]
Code:
0.000 connecting to server
0.205 connected
-------------------------------
0.205 verifying ts3 instance, reading 2 lines
0.205 reading 'TS3' line
0.411 reading 'Welcome to TeamSpeak' line
0.616 verification complete, time needed: 0.410s
-------------------------------
0.616 sending CMD: use port=9987
0.616 waiting/reading one line
0.821 read complete, time needed: 0.205s
-------------------------------
0.821 sending CMD: serverinfo
0.821 waiting/reading one line
1.025 read complete, time needed: 0.204s
1.025 waiting/reading one line
1.230 read complete, time needed: 0.205s
-------------------------------
1.232 sending CMD: serverinfo
1.232 waiting/reading one line
1.436 read complete, time needed: 0.204s
1.436 waiting/reading one line
1.639 read complete, time needed: 0.202s
-------------------------------
1.641 sending CMD: serverinfo
1.641 waiting/reading one line
1.846 read complete, time needed: 0.205s
1.846 waiting/reading one line
2.151 read complete, time needed: 0.305s (network fluctuation)
-------------------------------
2.154 sending CMD: serverinfo
2.154 waiting/reading one line
2.357 read complete, time needed: 0.203s
2.357 waiting/reading one line
2.561 read complete, time needed: 0.204s
-------------------------------
2.563 sending CMD: serverinfo
2.563 waiting/reading one line
2.767 read complete, time needed: 0.204s
2.767 waiting/reading one line
2.970 read complete, time needed: 0.203s
-------------------------------
NET CONNECT (~PING): 0.205s
NET TS3 VERIFICATION: 0.41s
NET DATA LINES TOTAL: 1.02s
NET STATUS LINES TOTAL: 1.324s
NET TOTAL: 2.959s
SCRIPT TOTAL: 2.977s
Observation
Here it takes for every line (data & status) the time of the ping time.
Korea [~ 400ms ping]
Code:
0.000 connecting to server
0.392 connected
-------------------------------
0.392 verifying ts3 instance, reading 2 lines
0.392 reading 'TS3' line
0.799 reading 'Welcome to TeamSpeak' line
1.216 verification complete, time needed: 0.824s
-------------------------------
1.216 sending CMD: use port=9987
1.216 waiting/reading one line
1.619 read complete, time needed: 0.402s
-------------------------------
1.619 sending CMD: serverinfo
1.619 waiting/reading one line
2.030 read complete, time needed: 0.411s
2.030 waiting/reading one line
2.438 read complete, time needed: 0.408s
-------------------------------
2.440 sending CMD: serverinfo
2.440 waiting/reading one line
2.849 read complete, time needed: 0.408s
2.849 waiting/reading one line
3.269 read complete, time needed: 0.421s
-------------------------------
3.271 sending CMD: serverinfo
3.271 waiting/reading one line
3.668 read complete, time needed: 0.397s
3.668 waiting/reading one line
4.076 read complete, time needed: 0.408s
-------------------------------
4.078 sending CMD: serverinfo
4.078 waiting/reading one line
4.487 read complete, time needed: 0.409s
4.487 waiting/reading one line
4.896 read complete, time needed: 0.409s
-------------------------------
4.898 sending CMD: serverinfo
4.899 waiting/reading one line
5.306 read complete, time needed: 0.408s
5.306 waiting/reading one line
5.715 read complete, time needed: 0.408s
-------------------------------
NET CONNECT (~PING): 0.392s
NET TS3 VERIFICATION: 0.824s
NET DATA LINES TOTAL: 2.033s
NET STATUS LINES TOTAL: 2.456s
NET TOTAL: 5.705s
SCRIPT TOTAL: 5.721s
Same as with the USA server
Question
Is this the expected behaviour?
Thank you for reading.
Mariusz Bieniek
http://www.tsviewer.com
0 commentaires:
Enregistrer un commentaire