Very bad performance when deleting files from mediafire backend
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Triaged
|
Medium
|
Unassigned |
Bug Description
Under certain conditions the performance of removing old backups from mediafire backend can be extremely bad - it can take hours to process such request.
The main contributor to this slowdown is a combination of
- using mediafire in multibackend and the fact that file lists are not cached per store
+
- multiple calls to list mediafire folder contents
(e. g. in multibackend.py's _delete function or mediafire backend's delete_file function which is still using API 1.3 for deletion. Unlike the latest version version 1.3 does not allow to delete the file by specifying full path and for each request the whole folder contents must be retrieved)
+
- large amount of files (e. g. 4 000+) in MF directory
duplicity 0.8.18
python 3.9.2
Arch Linux, x86_64
I have made a new branch of what-seems- to-be-unmaintai ned mediafire sdk for python at https:/ /github. com/jose1711/ mediafire- python- open-sdk/ tree/performanc e. The main feature is adding 1.4/1.5 API-specific arguments to functions which may greatly reduce time needed to e. g. delete the file from the service. It would be great if someone more experienced reviews that but the code did pass my tests.
To benefit from the changes mediafirebackend.py would need to be modified, e. g.:
def _delete(self, filename): uri(filename) client. delete_ file(uri)
u"""Delete single file"""
uri = self._build_
self.
would turn into
def _delete(self, filename): client. delete_ file(filename)
u"""Delete single file"""
self.
etc.