Skip to content

Commit 0ea8f47

Browse files
Update README.md
1 parent 82b601f commit 0ea8f47

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,54 @@ If you're using Gradle, that looke like this:
2424
```gradle
2525
implementation group: 'io.github.DarkAssassinator', name: 'ssh-spring-boot-starter', version: '1.0.0'
2626
```
27+
And you should add ssh session configuration in your yml file:
28+
```yml
29+
ssh:
30+
session:
31+
# ACP session pool config
32+
pool:
33+
# The maximum number of active ssh session instances in the pool.
34+
maxTotal: 20
35+
# The maximum number of active ssh session of per ssh host in the pool.
36+
maxTotalPerKey: 10
37+
# The maximum number of sleeping instances of per ssh host in the pool.
38+
maxIdlePerKey: 4
39+
# When borrow an ssh session, whether to block waiting for a session when the pool is exhausted
40+
blockWhenExhausted: true
41+
# The maximum waiting time for the caller when the pool session is exhausted, it will be ignored if blockWhenExhausted is false
42+
maxWaitDuration: 500ms
43+
# The minimum time to allow idle session to live (or not be evicted)
44+
minEvictableIdleDuration: 60s
45+
# The interval at which the eviction thread pool scans the pool for free sessions
46+
durationBetweenEvictionRuns: 60s
47+
# Whether borrowObject performs abandoned session removal
48+
removeAbandonedOnBorrow: true
49+
# How long the object has been unused and returned after it was lent out and used for the last time is considered a leak
50+
removeAbandonedTimeoutDuration: 30s
51+
sftp:
52+
# enable upload monitor thread when upload files to remote host
53+
enableUploadMonitor: true
54+
# max upload rate (KB), if negative, will not limit
55+
maxUploadRate: 256
56+
# max file size (MB), if negative, will not limit
57+
maxFileSize: 100
58+
```
59+
Please check the :
60+
| Parameter | Default | Desc |
61+
|-------------------------------------------------|-------|-----------------------------------------------------------------------------------------------------------------------------------|
62+
| ssh.session.pool.maxTotal | 20 | The maximum number of active ssh session instances in the pool. |
63+
| ssh.session.pool.maxTotalPerKey | 10 | The maximum number of active ssh session of per ssh host & account in the pool. |
64+
| ssh.session.pool.maxIdlePerKey | 4 | The maximum number of sleeping instances of per ssh host in the pool. |
65+
| ssh.session.pool.blockWhenExhausted | true | When borrow an ssh session, whether to block waiting for a session when the pool is exhausted |
66+
| ssh.session.pool.maxWaitDuration | 500ms | The maximum waiting time for the caller when the pool session is exhausted, it will be ignored if `blockWhenExhausted` is `false` |
67+
| ssh.session.pool.minEvictableIdleDuration | 60s | The minimum time to allow idle session to live (or not be evicted) |
68+
| ssh.session.pool.durationBetweenEvictionRuns | 60s | The interval at which the eviction thread pool scans the pool for free sessions |
69+
| ssh.session.pool.removeAbandonedOnBorrow | true | Whether borrowObject performs abandoned session removal |
70+
| ssh.session.pool.removeAbandonedTimeoutDuration | 30s | How long the object has been unused and returned after it was lent out and used for the last time is considered a leak |
71+
| ssh.session.sftp.enableUploadMonitor | true | enable upload monitor thread when upload files to remote host |
72+
| ssh.session.sftp.maxUploadRate | 256 | max upload rate (KB), if negative, will not limit |
73+
| ssh.session.sftp.maxFileSize | 100 | max file size (MB), if negative, will not limit |
74+
2775
Next, you can instantiate a SSH Session pool like
2876
```java
2977
@Autowired

0 commit comments

Comments
 (0)