apache / apache/mina-sshd

sftp-server 'ls' command takes too long to execute

Open
#633 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.1k
Forks
400
Avg merge
5d 1h
Merged PRs (30d)
1

Description

### Version

2.14.0

### Bug description

When the account directory file has a thousand tickets (all small files), it will be very slow when in ‘ls’ directory, taking about 30-40 seconds.

### Actual behavior

When there are more and more files, the time for **‘ls**’ is also very long. In actual production environments, as long as the number of files exceeds 3000, the more time will be spent.

### Expected behavior

1, Hope to refactor the relevant methods to improve the speed of '**ls**' files
2, Is there a relevant API that can modify the value of the segmented upload buffer? Its default value now is 16 * 1024.

### Relevant log output

_No response_

### Other information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the sftp-server 'ls' operation with directories containing 1,000 and 3,000 small files, then trace the relevant SFTP server methods involved in directory listing. Measure the current 30–40 second behavior and separately identify where the segmented upload buffer's 16 * 1024 default is defined. Done means faster listings and a clear answer on whether that buffer value is configurable.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.