Web interface freezing when selecting a file among many others.
Hi,
I am using sftpgo with a S3 backend for storage. The user mounts the bucket on "/". As the bucket contains contains quite a few files (~8k) at the root. It takes a second to load but no issue there. Everything is listed and quite fast.
However, if I try to select a file (or all), the whole page becomes frozen and I have to basically close the tab and restart from another one. The behavior is the same in Safari, Firefox and Chrome.
With a single file in the bucket I don't get the issue, so I suppose selecting even a single element is doing something is the background that does not scales to 8k elements. Not a big issue for me but I wanted to report.
I can't reproduce. I tested with 10k files, it is very slow only if I change the number of entries per page. Changing page, searching, selecting, all works fine for me with both Chromium and Firefox (on Linux)
Since I fixed my file access issue (Using storage S3 + homedir "/" allowed me to list files, but trying to accessing them returned an error) it might be a bit better:
- Downloading a file by clicking on the link or editing a file is fast
- However, clicking on the select box on the left of the file still freezes the tab for a while
- This is wildly dependent on the browser: Safari 5sec, Chrome 10sec, Firefox 35sec(!), but very consistent on my laptop
- This time is the same whether I display 10 or 500 files at once
- Switching from 10 to 500 files per page or the reverse can also be long depending on the browser:
- Safari is < 1sec (!), chrome ~30sec, Firefox > 2min
- This is less of a concern given that it is less likely to be clicked more that once
- In all cases, there is a moderate flat CPU increase during the tab freeze (2 CPUs at ~50%)
- I use a 2017 old Macbook pro (2.3 GHz Dual-Core Intel Core i5) so I imagine a more recent computer might not experience the issue, especially on a non-Firefox browser
More precisions: My files are ~ 14KB CSVs that I can open from the interface without issues.
This seems to indicate that this selection box is triggering an operation proportional to the number of elements in the folder, which is a bit surprising but there might be a good reason.
As it is bad practice to have that many files in a folder, it is not really a significant bug. The sftp client I use also suffers from the file number.
Since I fixed my file access issue (Using storage S3 + homedir "/" allowed me to list files, but trying to accessing them returned an error) it might be a bit better:
Downloading a file by clicking on the link or editing a file is fast
However, clicking on the select box on the left of the file still freezes the tab for a while
This is wildly dependent on the browser: Safari 5sec, Chrome 10sec, Firefox 35sec(!), but very consistent on my laptop
This time is the same whether I display 10 or 500 files at once
Switching from 10 to 500 files per page or the reverse can also be long depending on the browser:
- Safari is < 1sec (!), chrome ~30sec, Firefox > 2min
- This is less of a concern given that it is less likely to be clicked more that once
In all cases, there is a moderate flat CPU increase during the tab freeze (2 CPUs at ~50%)
I use a 2017 old Macbook pro (2.3 GHz Dual-Core Intel Core i5) so I imagine a more recent computer might not experience the issue, especially on a non-Firefox browser
More precisions: My files are ~ 14KB CSVs that I can open from the interface without issues.
This seems to indicate that this selection box is triggering an operation proportional to the number of elements in the folder, which is a bit surprising but there might be a good reason.
it could be, this is only javascript code, no server side calls. For checkboxes this library is used. I cannot replicate on my laptop
As it is bad practice to have that many files in a folder, it is not really a significant bug. The sftp client I use also suffers from the file number.
Maybe the issue is in the select callback here:
var selectedItems = table.column(0).checkboxes.selected().length;
we need to know the number of selected items. Affected users may add some logs to understand the bottleneck
Please re-open if this also happens with the new WebClient UI. Thanks