구차니 2025. 9. 8. 12:20

ssh를 통해 iperf3 -s 옵션으로 실행 했는데

결과 내용이 ssh 터미널을 통해 나오지 않아서 3 ai들에게 물어보니

cluade가 알려줌. 그 와중에 gemini는 도움이 안되고 chatGPT는 파일로 떨구라고 알려줌.. (야이 -_-)

 

아무튼 -t 라는 옵션을 주면 잘 나온다. 신기하네..

     -T      Disable pseudo-terminal allocation.

     -t      Force pseudo-terminal allocation.  This can be used to execute
             arbitrary screen-based programs on a remote machine, which can be
             very useful, e.g. when implementing menu services.  Multiple -t
             options force tty allocation, even if ssh has no local tty.

 

iperf3 가 취소되어 종료되고 나서 한번에 iperf3 서버쪽 결과가 나옴. 일종의 버퍼링 상태인가..

ssh localhost "iperf3 -s"  
  iperf3 -c localhost
Connecting to host localhost, port 5201
[  5] local 127.0.0.1 port 43416 connected to 127.0.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  5.94 GBytes  51.0 Gbits/sec    0   1.31 MBytes       
[  5]   1.00-2.00   sec  6.09 GBytes  52.3 Gbits/sec    0   1.31 MBytes       
[  5]   2.00-3.00   sec  5.79 GBytes  49.7 Gbits/sec    0   1.31 MBytes       
^C[  5]   3.00-3.37   sec  2.26 GBytes  51.8 Gbits/sec    0   1.31 MBytes 
iperf3: the client has terminated
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 127.0.0.1, port 43412
[  5] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 43416
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.72 GBytes  49.1 Gbits/sec                  
[  5]   1.00-2.00   sec  6.09 GBytes  52.3 Gbits/sec                  
[  5]   2.00-3.00   sec  5.81 GBytes  49.9 Gbits/sec                  
[  5]   2.00-3.00   sec  5.81 GBytes  49.9 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-3.00   sec  20.1 GBytes  57.5 Gbits/sec                  receiver
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-3.37   sec  20.1 GBytes  51.1 Gbits/sec    0             sender
[  5]   0.00-3.37   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated

 

그 와중에 iperf3 -s 를 실행한 ssh를 종료하면 PPID 1번으로 붙어 버린다. 야이 -_-

마치 -D / --daemon 옵션을 주고 한 것 같아지냐

$ ps -ef | grep iperf3
falinux   811482       1  2 12:12 ?        00:00:02 iperf3 -s

 

딱이네.. 머지? 터미널이 없으면 자동으로 daemon 모드로 작동하나?

$ iperf3 -D -s
$ ps -ef | grep iperf3
user   811482       1  1 12:12 ?        00:00:02 iperf3 -s

 

아무튼 대망의(?) -t 옵션. 잘 된다.

ssh -t localhost "iperf3 -s"
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
 
Accepted connection from 127.0.0.1, port 60822
[  5] local 127.0.0.1 port 5201 connected to 127.0.0.1 port 60830
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.48 GBytes  47.0 Gbits/sec                  
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  5.48 GBytes  47.0 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  7.60 GBytes  65.3 Gbits/sec                  receiver
iperf3: the client has terminated
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
iperf3 -c localhost
Connecting to host localhost, port 5201
[  5] local 127.0.0.1 port 60830 connected to 127.0.0.1 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  5.70 GBytes  49.0 Gbits/sec    0   1.25 MBytes       
^C[  5]   1.00-1.32   sec  1.90 GBytes  50.5 Gbits/sec    0   1.25 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.32   sec  7.60 GBytes  49.4 Gbits/sec    0             sender
[  5]   0.00-1.32   sec  0.00 Bytes  0.00 bits/sec                  receiver
iperf3: interrupt - the client has terminated

[링크 : https://stackoverflow.com/questions/42505339/why-use-t-with-ssh]