owncloud / owncloud/core

[QA] write to external SFTP storage is slow

Open
#38,420 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

QA:team
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

setup: owncloud core 10.6.0

with

apt-get install pure-ftpd
adduser ftpdata

-> Settings -> Storage
SFTP, Username and password
Configuration
localhost /home/ftpdata

  • A user moves a 200MB file from his primary storage to SFTP using the web UI.
    System loadavg is 0.01
    image
  • strace shows an sshd process with
read(4, "\2432\10\277\0056]\374\237\216\226\362\226w\261\237\24;jS\n\362\345]\21\t\10\253\226\322\36{"..., 16384) = 96
write(11, "\0\0\0(\3\0\0\0\1\0\0\0\27/home/ftpdata/200MB"..., 44) = 44
read(12, "\0\0\0\rf\0\0\0\1\0\0\0\4\0\0\0\0", 16384) = 17
write(4, "Y\247\216\36\16\370#\364%\331\10\0E\31\272\314R\317\220\277W\204\361.[\261\227z\376!\366g"..., 80) = 80
read(4, "\4S\3\320\377\\>\312F\0217\200>\226?\373CQ+!\330\341\351\376\350\353\22\16\303L\364\271"..., 16384) = 8192
read(4, "^\2605\257!R:@\311\364\331\362\1\353\335\221\335\237U\244\36\201\31\224\310c\244p\361\1gy"..., 16384) = 80
write(11, "\0\0 \31\6\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\0\4\332 \0\0\0 \0\266\206\346"..., 8221) = 8221
read(12, "\0\0\0\30e\0\0\0\0\0\0\0\0\0\0\0\7Success\0\0\0\0", 16384) = 28
write(4, "\235\300H\273\341\3314\342s\3\35LL\323\35\25R\337$\361\267\200\256m\247C\25\225\335\263\36\376"..., 80) = 80
read(4, "\346\370T\267\3514\314\245\335\206\241p\344\301\273\17\331F6\303\314\260hY\240\16\234\215\270\276:v"..., 16384) = 80
write(11, "\0\0\0\r\4\0\0\0\1\0\0\0\4\0\0\0\0", 17) = 17
read(12, "\0\0\0\30e\0\0\0\1\0\0\0\0\0\0\0\7Success\0\0\0\0", 16384) = 28
write(4, "\205\345\350z\325\362\372\212\230\21\0107\316\245\201\370\243\237\206Wy\332\333%0R\234 \354\270z\331"..., 80) = 80
read(4, "\252,)u\240\342\1776s0\303\264\275\263\240\311\273&g\t0\243_\24P!N\334\22\21(c"..., 16384) = 96
write(11, "\0\0\0(\3\0\0\0\1\0\0\0\27/home/ftpdata/200MB"..., 44) = 44
read(12, "\0\0\0\rf\0\0\0\1\0\0\0\4\0\0\0\0", 16384) = 17
write(4, "\372Eq\267\"\272A\215\35\377\0\21|\206.\316y\2\16\335O\224\3374\217\220z9\304\316\26l"..., 80) = 80
read(4, "0\333e\2l\311\6\232s\373T\272D4\315\326[A\23 \23\275\179\366\31,\330\2068\330\246"..., 16384) = 8192
read(4, "\207\304#\376\10.\37n\252\353v\22\2610V\233\36\272\320w\354~\213(G\377\213i}a\312\252"..., 16384) = 80
write(11, "\0\0 \31\6\0\0\0\0\0\0\0\4\0\0\0\0\0\0\0\0\4\332@\0\0\0 \0B\266\333"..., 8221) = 8221
read(12, "\0\0\0\30e\0\0\0\0\0\0\0\0\0\0\0\7Success\0\0\0\0", 16384) = 28
write(4, "F2\312l\354\177\323\303r\324\0375\2635\316(\24\0377\337\4\326\356\214\371\371)\222X<\vm"..., 80) = 80
read(4, "\270\4\324\252\327\375\310\341\r&\363@D\376\374\5\324wN6\321\336Z(\202\214I\245-\261\21X"..., 16384) = 80
write(11, "\0\0\0\r\4\0\0\0\1\0\0\0\4\0\0\0\0", 17) = 17
read(12, "\0\0\0\30e\0\0\0\1\0\0\0\0\0\0\0\7Success\0\0\0\0", 16384) = 28
write(4, "~\342\301l4\225U?\222%&\240\231\1]\276'(g\266 \22X\246\36\216ZX\342Y\345\0"..., 80) = 80
read(4, "G\363v\222\354\321#\327`S\324d\354\360\252n5/\261\2202\321]P\2S\377\341\26\220\277\361"..., 16384) = 96
write(11, "\0\0\0(\3\0\0\0\1\0\0\0\27/home/ftpdata/200MB"..., 44) = 44
read(12, "\0\0\0\rf\0\0\0\1\0\0\0\4\0\0\0\0", 16384) = 17
write(4, "\222\251\32\377[\3412\235\334\363B\16E`te\tF\260}\303\267\220v\26V\375\203$\204\360\207"..., 80) = 80

80 byte read write system calls are inefficient. BAD.

  • the move finishes after 22 minutes. BAD

Expected behaviour: Do 8192 byte chunks more often. loadavg ca 1.0 and a few seconds max. (A manual sftp "put" into that storage reaches > 100MBytes / sec)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the web UI flow for moving a 200MB file to configured SFTP storage and trace the external-storage write path. Reproduce with the provided pure-ftpd setup, compare strace output with a manual SFTP put, and verify that the transfer uses larger, repeated chunks and completes in seconds rather than 22 minutes.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.