You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upload performance OC 8.2.1 (50 mysql queries per file) #20967
Upload of many small files is very slow. I tested on a raspbery pi 2 which is known to have a bad i/o-performance. During uploads, mysql-operation create an important io-wait on the system. It was worse with journaling of ext4, so I disabled it (it's a test system).
Uploading a folder with 1180 files (18 MB) via the oc-client takes about 20-30 minutes (pictures, a lot of text files, take any php code of a project), but the number of sql-queries is extremely high (>50 queries per uploaded file!):
command
number
select
49,681
update
11,523
insert select
2,487
set option
1,526
delete
511
insert
423
begin
17
commit
17
For upload, a smaller number of queries can be obtained when files are uploaded in an external folder via ftp (takes a few seconds) then this folder is included into owncloud, the scanning process takes a few minutes (it's hard to tell, 5 minutes?) and the number of queries (some queries are due to handling the web-interface):
command
number
select
11,054
update
3,040
insert select
3,004
set option
425
delete
138
I remember you worked on the deletion process for OC 8.0, this scales much better: 3000 files take 3500 update and 1400 select queries. Perhaps there is a similar improvement possible for upload operations ;-)
Redis seems to be used as the warning the the database is used for file-locking disappeared. Before I could see many queries for a file-locking table, but such queries disappeared as well. Unfortunately the performance got worse:
command
number
select
114 k
update
27,946
set option
4,465
insert select
1,313
commit
133
begin
133
I only used the standard redis-configuration, I perhaps I need to tune some parameters to use memory more efficiently. Is this normal in the logs?
[7522] 08 Dec 00:07:05.004 * 10 changes in 300 seconds. Saving...
[7522] 08 Dec 00:07:05.006 * Background saving started by pid 11366
[11366] 08 Dec 00:07:05.484 * DB saved on disk
[11366] 08 Dec 00:07:05.487 * RDB: 0 MB of memory used by copy-on-write
[7522] 08 Dec 00:07:05.508 * Background saving terminated with success
[7522] 08 Dec 00:12:06.090 * 10 changes in 300 seconds. Saving...
[7522] 08 Dec 00:12:06.091 * Background saving started by pid 11883
[11883] 08 Dec 00:12:06.135 * DB saved on disk
[11883] 08 Dec 00:12:06.138 * RDB: 0 MB of memory used by copy-on-write
@tflidd Would it be possible for you to install the free blackfire.io tool on your server?
Then just upload the file in your browser, open the developer tools, go to the network console, copy the request as cURL (to upload.php) and in the command line type "blackfire curl theRestOfTheCurlCommand"
After this sharing the trace (there is an option for public sharing) would help us a lot. (ah. And technically there is also a 15day trial for the paid version. You might try to enable that one as well as it gives more infos ;))
Thanks for your ideas. I will have to verify my caching-setup with the docs, it's possible that I missed something. If it doesn't improve, I will try to install blackfire.io on my RPi2.
Well, I was using APCu with the same drawback: large amount of small files takes forever. Ps. I was using Debian 8, which has release 8.1.4. And previously I ran Apache webserver.
I now setup Redis with memcached and Transactional File Locking enabled. I also switched to Nginx server and php-fpm. Let me check if I see any improvements or not.
Ok, it took a bit longer. Problem was, that blackfire.io does not work on ARM. So I installed OC 8.2.1 on a virtual machine (Debian 8 system, it is apache+mod_php instead of nginx+php-fpm). There are still a lot of SQL queries.
Now, I run blackfire.io like @LukasReschke described (hopefully I understood correctly):
The fastest local memcache would be APCU, on the Pi it's a bit more complicated as APCU eats more memory (two caches instead of one). But on the VM, APCU should speed things up a little more. Only for memecache.local!
@PVince81 You mean, trying to reduce the number of inserts or optimize the query? Probably this is yet another big project. I think I could have a look and analyse this as a next project.
However, I am big fan of what guys at CERN have with EOS.
Activity
melroy89 commentedon Dec 7, 2015
We have indeed a big MySQL issue here... I can confirm this.
DeepDiver1975 commentedon Dec 7, 2015
@icewind1991 @LukasReschke some more profiling? 🙊
LukasReschke commentedon Dec 7, 2015
Is Redis enabled as file locking provider? If no: Pretty sure it's file locking. 🙊
tflidd commentedon Dec 8, 2015
Indeed, I used only APCu. But I can't disable filelocking, I tried
'filelocking.enabled' => 'false',that didn't work.So, I tried to enable file-locking using a redis-server. I installed from debian (jessie) which comes in version 2.8.17. I run more or less the standard config, except that I use the socket to connect to redis. I disabled apcu (https://www.en0ch.se/how-to-configure-redis-cache-in-ubuntu-14-04-with-owncloud/) but the admin page now complains
No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.Redis seems to be used as the warning the the database is used for file-locking disappeared. Before I could see many queries for a file-locking table, but such queries disappeared as well. Unfortunately the performance got worse:
I only used the standard redis-configuration, I perhaps I need to tune some parameters to use memory more efficiently. Is this normal in the logs?
LukasReschke commentedon Dec 8, 2015
@tflidd Would it be possible for you to install the free blackfire.io tool on your server?
Then just upload the file in your browser, open the developer tools, go to the network console, copy the request as cURL (to upload.php) and in the command line type "blackfire curl theRestOfTheCurlCommand"
After this sharing the trace (there is an option for public sharing) would help us a lot. (ah. And technically there is also a 15day trial for the paid version. You might try to enable that one as well as it gives more infos ;))
tflidd commentedon Dec 8, 2015
Thanks for your ideas. I will have to verify my caching-setup with the docs, it's possible that I missed something. If it doesn't improve, I will try to install blackfire.io on my RPi2.
melroy89 commentedon Dec 8, 2015
Why are we talking about Redis, when the problem started with MySQL database. Even so, MySQL is default.
melroy89 commentedon Dec 8, 2015
Well, I was using APCu with the same drawback: large amount of small files takes forever. Ps. I was using Debian 8, which has release 8.1.4. And previously I ran Apache webserver.
I now setup Redis with memcached and Transactional File Locking enabled. I also switched to Nginx server and php-fpm. Let me check if I see any improvements or not.
tflidd commentedon Dec 12, 2015
Ok, it took a bit longer. Problem was, that blackfire.io does not work on ARM. So I installed OC 8.2.1 on a virtual machine (Debian 8 system, it is apache+mod_php instead of nginx+php-fpm). There are still a lot of SQL queries.
Now, I run blackfire.io like @LukasReschke described (hopefully I understood correctly):
Now I get this profile: https://blackfire.io/profiles/be638d4d-6887-49a9-9a5d-f2b0b05d913c/graph
22 remaining items
jospoortvliet commentedon Apr 15, 2016
The fastest local memcache would be APCU, on the Pi it's a bit more complicated as APCU eats more memory (two caches instead of one). But on the VM, APCU should speed things up a little more. Only for memecache.local!
melroy89 commentedon Aug 9, 2016
Still not fixed?
PVince81 commentedon Aug 10, 2016
@Danger89 is this happening for you in a recent OC version ?
Some queries were optimized meanwhile.
PVince81 commentedon Dec 8, 2016
@mrow4a what do you think ?
mrow4a commentedon Dec 8, 2016
@PVince81 You mean, trying to reduce the number of inserts or optimize the query? Probably this is yet another big project. I think I could have a look and analyse this as a next project.
However, I am big fan of what guys at CERN have with EOS.
PVince81 commentedon Apr 6, 2017
@mrow4a is already working on optimizing SQL queries on upload and other file operations for 10.0, some fixes made it in already. Please retry there.
lock commentedon Aug 2, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.