For our file transmission and manual storage we have a simple RHEL server on which all other Linux clients are connecting by SSH.
Whenever any client wants to access/store data, they connect to the server via nautilus
and the connection remain established even if data transmission ceases, until its unmounted manually OR the client shuts down their system.
When I monitored the CPU usage on the server, most of CPU usage is due to these established connections.
[root@server]# top
top - 11:22:13 up 2:36, 6 users, load average: 2.79, 2.19, 1.90
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
17247 share 20 0 55640 1924 972 S 26.7 0.1 7:36.72 sftp-server
17900 share 20 0 55640 1932 972 S 17.5 0.1 10:16.45 sftp-server
26152 share 20 0 55596 1872 972 S 17.5 0.1 8:12.04 sftp-server
17487 share 20 0 55636 1864 972 R 15.5 0.1 9:58.56 sftp-server
2852 root 20 0 195m 55m 7872 R 13.8 2.7 17:01.72 X
11768 share 20 0 55560 1684 832 S 8.9 0.1 3:12.00 sftp-server
17486 share 20 0 98172 1884 784 R 8.2 0.1 4:48.35 sshd
26151 share 20 0 98236 1872 784 S 7.9 0.1 4:03.29 sshd
17899 share 20 0 98204 1916 784 S 7.2 0.1 5:00.17 sshd
12569 tejas 20 0 322m 11m 7808 S 5.9 0.6 0:28.12 gnome-system-mo
17246 share 20 0 98204 1840 784 S 5.9 0.1 3:33.18 sshd
11767 share 20 0 98008 1716 772 S 4.3 0.1 1:28.73 sshd
15168 tejas 20 0 989m 64m 18m S 0.7 3.2 0:01.31 chrome
4077 tejas 20 0 109m 9312 5584 S 0.3 0.5 24:26.08 App
11360 tejas 20 0 304m 10m 5144 S 0.3 0.5 0:05.23 gnome-terminal
14236 root 20 0 15168 1380 928 R 0.3 0.1 0:00.36 top
1 root 20 0 19324 1056 844 S 0.0 0.1 0:00.67 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
So I am looking for a automatic way to unmount that ssh connection if no data is flowing say for 10 minutes or so, Or any other idea to minimize this CPU usage.
EDIT: After slm's comment,can you explain how they're connecting from Nautilus?
Here is how clients normally connected to the server by SSH.
- Enter required Fields and enter Password :
- Transfer/Create File/s.
- Wait for 30 Min after closing the directory.
- Still showing connection...
tcpdump
,wireshark
, …)? What are thesftp-server
processes doing (strace
)? Could this be a known bug in your version?