mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
portable mode: add SFTP buffer size
This commit is contained in:
3
.github/workflows/development.yml
vendored
3
.github/workflows/development.yml
vendored
@@ -74,6 +74,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p output/{init,bash_completion,zsh_completion}
|
mkdir -p output/{init,bash_completion,zsh_completion}
|
||||||
cp sftpgo output/
|
cp sftpgo output/
|
||||||
|
chmod 755 output/sftpgo
|
||||||
cp sftpgo.json output/
|
cp sftpgo.json output/
|
||||||
cp -r templates output/
|
cp -r templates output/
|
||||||
cp -r static output/
|
cp -r static output/
|
||||||
@@ -222,6 +223,7 @@ jobs:
|
|||||||
./sftpgo gen man -d output/man/man1
|
./sftpgo gen man -d output/man/man1
|
||||||
gzip output/man/man1/*
|
gzip output/man/man1/*
|
||||||
cp sftpgo output/
|
cp sftpgo output/
|
||||||
|
chmod 755 output/sftpgo
|
||||||
|
|
||||||
- uses: uraimo/run-on-arch-action@v2.0.9
|
- uses: uraimo/run-on-arch-action@v2.0.9
|
||||||
if: ${{ matrix.arch != 'amd64' }}
|
if: ${{ matrix.arch != 'amd64' }}
|
||||||
@@ -259,6 +261,7 @@ jobs:
|
|||||||
./sftpgo gen man -d output/man/man1
|
./sftpgo gen man -d output/man/man1
|
||||||
gzip output/man/man1/*
|
gzip output/man/man1/*
|
||||||
cp sftpgo output/
|
cp sftpgo output/
|
||||||
|
chmod 755 output/sftpgo
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ var (
|
|||||||
portableSFTPFingerprints []string
|
portableSFTPFingerprints []string
|
||||||
portableSFTPPrefix string
|
portableSFTPPrefix string
|
||||||
portableSFTPDisableConcurrentReads bool
|
portableSFTPDisableConcurrentReads bool
|
||||||
|
portableSFTPDBufferSize int64
|
||||||
portableCmd = &cobra.Command{
|
portableCmd = &cobra.Command{
|
||||||
Use: "portable",
|
Use: "portable",
|
||||||
Short: "Serve a single directory",
|
Short: "Serve a single directory",
|
||||||
@@ -192,6 +193,7 @@ Please take a look at the usage below to customize the serving parameters`,
|
|||||||
Fingerprints: portableSFTPFingerprints,
|
Fingerprints: portableSFTPFingerprints,
|
||||||
Prefix: portableSFTPPrefix,
|
Prefix: portableSFTPPrefix,
|
||||||
DisableCouncurrentReads: portableSFTPDisableConcurrentReads,
|
DisableCouncurrentReads: portableSFTPDisableConcurrentReads,
|
||||||
|
BufferSize: portableSFTPDBufferSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Filters: dataprovider.UserFilters{
|
Filters: dataprovider.UserFilters{
|
||||||
@@ -322,6 +324,14 @@ remote SFTP server`)
|
|||||||
portableCmd.Flags().BoolVar(&portableSFTPDisableConcurrentReads, "sftp-disable-concurrent-reads", false, `Concurrent reads are safe to use and
|
portableCmd.Flags().BoolVar(&portableSFTPDisableConcurrentReads, "sftp-disable-concurrent-reads", false, `Concurrent reads are safe to use and
|
||||||
disabling them will degrade performance.
|
disabling them will degrade performance.
|
||||||
Disable for read once servers`)
|
Disable for read once servers`)
|
||||||
|
portableCmd.Flags().Int64Var(&portableSFTPDBufferSize, "sftp-buffer-size", 0, `The size of the buffer (in MB) to use
|
||||||
|
for transfers. By enabling buffering,
|
||||||
|
the reads and writes, from/to the
|
||||||
|
remote SFTP server, are split in
|
||||||
|
multiple concurrent requests and this
|
||||||
|
allows data to be transferred at a
|
||||||
|
faster rate, over high latency networks,
|
||||||
|
by overlapping round-trip times`)
|
||||||
rootCmd.AddCommand(portableCmd)
|
rootCmd.AddCommand(portableCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,14 @@ Flags:
|
|||||||
parallel (default 2)
|
parallel (default 2)
|
||||||
--s3-upload-part-size int The buffer size for multipart uploads
|
--s3-upload-part-size int The buffer size for multipart uploads
|
||||||
(MB) (default 5)
|
(MB) (default 5)
|
||||||
|
--sftp-buffer-size int The size of the buffer (in MB) to use
|
||||||
|
for transfers. By enabling buffering,
|
||||||
|
the reads and writes, from/to the
|
||||||
|
remote SFTP server, are split in
|
||||||
|
multiple concurrent requests and this
|
||||||
|
allows data to be transferred at a
|
||||||
|
faster rate, over high latency networks,
|
||||||
|
by overlapping round-trip times
|
||||||
--sftp-disable-concurrent-reads Concurrent reads are safe to use and
|
--sftp-disable-concurrent-reads Concurrent reads are safe to use and
|
||||||
disabling them will degrade performance.
|
disabling them will degrade performance.
|
||||||
Disable for read once servers
|
Disable for read once servers
|
||||||
|
|||||||
Reference in New Issue
Block a user