Repository navigation
Description
We are seeing instances of slow syncing between the ownCloud client (1.5.0) and the ownCloud server (6.0.1)
The setup is as follows (3 separate servers):
oC6.0.1 on Ubuntu
Postgresql 9 database
local data is via NFS mount
Client is on MAC
We have taken a variety of traces and upon analyzing them it appears there are delays in the ownCloud server sending requests to the NFS server.
Tests have been done with the following:
- 1000 empty files in one flat folder
- Many files in many folders
It was noted in the traces taken 01_23_2014 that there was delay in the ownCloud server sending a request to the NFS server to open the mount.json file.
True, there was a mount.json file in existance, however, the user in question had no external mounts, and in fact, there were no "working" mounts configured.
In traces taken 01_24_2014, the mount.json file was removed and there was still delay. This time prior to NFS "PUTFH, LOOKUP, GETFH, GETATTR" packets.
As it turns out, it would take about .5 seconds for each file to sync on average. This increased, obviously, with more folders.
In the ownCloud lab, I was unable to reproduce the latency with the same setup as above. I was seeing .20-.25 seconds per file which is acceptable.
Need assistance in figuring out where the delay is and how best to resolve this issue.
ZIP file "traces.zip" is in the following location: s3.ownlcloud.com/owncloud/support/Slow Sync
Contains the following data within:
"Data 01_23_2014"/"Sync Git"
client.pcap -- Wireshark trace taken at the Client's MAC.
Client IP: .219
oC server IP: .166
Shows significant delays up to 0.5 seconds in receiving packets from the oC server.
This basically eliminates the client from being at fault
git.pcap -- Wireshark trace taken between the oC server and the Postgresql server.
oC server IP: .48
SQL IP: .42
Shows no significant delays
This basically eliminates the SQL server from being at fault
nfs.pcap -- Wireshark trace taken between the oC server and NFS server.
oC server IP: .48
NFS IP: .35
Shows significant delay in oC server sending requests to the NFS server as mentioned above
"Data 01_24_2014 No ext storage"
nfs-no-shared-storage -- Wireshark trace taken between oC server and NFS server. mount.json still exists
Shows delay in oC server sending requests to open mount.json to the NFS server
nfs-no-shared-storage-no-mount.pcap -- Wireshark trace taken between oC server and NFS server. mount.json has been deleted.
Shows delay in oC server sending PUTF, LOOKUP, GETFH, GETATTR to NFS server
nfs-no-shared-storage-no-mount-1.pcap -- Wireshark trace taken between oC server and NFS server. mount.json removed
Shows delay in oC server sending LOOKUP DH to NFS server
Then the three access logs associated with the above traces
As it appears, all delays are in the oC server's communication (origination) with the NFS server.
Activity
DeepDiver1975 commentedon Jan 24, 2014
@butonic you have some knowledge about owncloud with nfs. Please share your insights. Thx
Von Samsung Mobile gesendet
-------- Ursprüngliche Nachricht --------
Von: Steve Robinson [email protected]
Datum:24.01.2014 17:59 (GMT+01:00)
An: owncloud/core [email protected]
Betreff: [core] [6.0.1] Slow sync to oC server. Delay in sending packets from
oC server to NFS server (#6937)
We are seeing instances of slow syncing between the ownCloud client (1.5.0) and the ownCloud server (6.0.1)
The setup is as follows (3 separate servers):
oC6.0.1 on Ubuntu
Postgresql 9 database
local data is via NFS mount
Client is on MAC
We have taken a variety of traces and upon analyzing them it appears there are delays in the ownCloud server sending requests to the NFS server.
Tests have been done with the following:
It was noted in the traces taken 01_23_2014 that there was delay in the ownCloud server sending a request to the NFS server to open the mount.json file.
True, there was a mount.json file in existance, however, the user in question had no external mounts, and in fact, there were no "working" mounts configured.
In traces taken 01_24_2014, the mount.json file was removed and there was still delay. This time prior to NFS "PUTFH, LOOKUP, GETFH, GETATTR" packets.
As it turns out, it would take about .5 seconds for each file to sync on average. This increased, obviously, with more folders.
In the ownCloud lab, I was unable to reproduce the latency with the same setup as above. I was seeing .20-.25 seconds per file which is acceptable.
Need assistance in figuring out where the delay is and how best to resolve this issue.
ZIP file "traces.zip" is in the following location: s3.ownlcloud.com/owncloud/support/Slow Sync
Contains the following data within:
"Data 01_23_2014"/"Sync Git"
client.pcap -- Wireshark trace taken at the Client's MAC.
Client IP: .219
oC server IP: .166
Shows significant delays up to 0.5 seconds in receiving packets from the oC server.
This basically eliminates the client from being at fault
git.pcap -- Wireshark trace taken between the oC server and the Postgresql server.
oC server IP: .48
SQL IP: .42
Shows no significant delays
This basically eliminates the SQL server from being at fault
nfs.pcap -- Wireshark trace taken between the oC server and NFS server.
oC server IP: .48
NFS IP: .35
Shows significant delay in oC server sending requests to the NFS server as mentioned above
Then the three access logs associated with the above traces
As it appears, all delays are in the oC server's communication (origination) with the NFS server.
—
Reply to this email directly or view it on GitHub.
butonic commentedon Jan 24, 2014
Hm, what NFS mount options are in use? I personally recommend
Don't use fsc / NFS client caching.
sleinen commentedon Jan 24, 2014
The options used are simply:
rw, tcp, hard are the defaults anyway, not sure about the others.
But I think this is not an NFS performance issue. Upon a closer look, the NFS (RPC) call/reply response times look fine: 70% return in <1ms, 95% <21ms, rare outliers show 210-270ms. The initial analysis looked at the time intervals between arbitrary NFS packets. Sometimes there are gaps before RPC call packets, simply because of some other work/delay between NFS requests. These delays really don't mean anything about NFS performance or its contribution to overall performance.
jcfischer commentedon Jan 30, 2014
I did some tests and performance tuning on the NFS server and the NFS clients.
Here's our current mount options:
This has helped. Also, the NFS server VM had RBD Caching disabled (RBD is the Ceph block device) where both the VM and the data volume are stored. Enabling that has improved throughput massively:
https://docs.google.com/spreadsheet/ccc?key=0AsjockBApInDdFVLRXhXd3ZUbkdPUUpVYkhfN2tzcmc&usp=sharing
I will see, if that changes the behaviour of OwnCloud
ser72 commentedon Feb 3, 2014
@butonic @DeepDiver1975
Zip file showing what functions are causing the delay have been uploaded to S3/Support/Slow Sync
File named UploadOfOneJPG
Two things are remarkable:
There are 235 SELECT statements being executed for this single upload - that alone costs 463ms (which means, our DB server returns a result in 1.9ms on average - that is OK). That many SELECT statements make me suspicious of the code that is being executed.
Another 130 ms is spent in the resize operation (to create a thumbnail I presume). That should go to a background job, IMO
Another 108 + 122 ms are spent in the OCP\Share::getItems call in PHP application code
This is probably in core/lib/public/share.php, the loop at line 1304: https://github.com/owncloud/core/blob/master/lib/public/share.php#L1304
ser72 commentedon Feb 4, 2014
Perhaps related to: #5084??????
DeepDiver1975 commentedon Feb 4, 2014
#5084 is no longer relevant for oc6 - we changed the mimetype detection and no longer read the file content
jcfischer commentedon Feb 4, 2014
I just looked at https://github.com/owncloud/core/blob/master/lib/private/files/type/detection.php#L63 and can see a number of problems with the code. If that isn't in use any more, can this be deleted or should I try to create a PR for those problems?
DeepDiver1975 commentedon Feb 4, 2014
Ouch!
@ser72 Can you please share detailed information on that? @icewind1991 Can I place this into your scope of sql optimications? THX
DeepDiver1975 commentedon Feb 4, 2014
@schiesbn @karlitschek we should put that on the sharing rework task list I guess
DeepDiver1975 commentedon Feb 4, 2014
Hmmm - @georgehrke the thumbnails are generated in a post_write hook - right? Pushing that to a background job should be quite easy and worth trying regarding the impact on performance.
@karlitschek Objections?
DeepDiver1975 commentedon Feb 4, 2014
That function is still needed - the logic has been optimized to not determine the mime-type for known file extensions.
@jcfischer Can I ask you to open a new ticket and describe the problems you see in the code? THX
karlitschek commentedon Feb 4, 2014
previews should be generated lazy in the webinterface. This shouldn't affect sync performance at all. I'm not sure how the gallery app handles thumbnail generation. Should be done lazy too.
georgehrke commentedon Feb 4, 2014
post_write just deletes existing previews. new ones will be generated on demand
see https://github.com/owncloud/core/blob/master/lib/private/preview.php#L610
georgehrke commentedon Feb 4, 2014
it's the gallery app:
https://github.com/owncloud/apps/blob/master/gallery/appinfo/app.php#L46
cc @icewind1991
28 remaining items
shoeper commentedon Mar 3, 2014
Shouldn't it be very fast to store the session in a mysql table using the memory engine?
If not all the session data should get lost on crash/restart the cronjob could mirror the session table by saving it in another table.
moscicki commentedon Mar 3, 2014
@jcfischer: there is a large performance improvement with async NFS exports from the server (NOT the async mount option which I think is a default anyway). AFAIK this means that NFS server writes to the buffer cache without syncing to disk synchronously. With a default sync export my NFS servers are just stuck in infinite I/O wait and load-levels to the moon.
However there is a price to pay: in case the NFS server goes bust the data in transit may be lost...
That's why ultimately owncloud should support object-storage interfaces or having a robust implementation of filesystem interfaces that would allow to recover from operational failures. On top of upcoming and badly needed performance improvements...
enoch85 commentedon Jun 23, 2014
Any progress here?
RobinMcCorkell commentedon Aug 30, 2015
NFS is a server-level filesystem, ownCloud has no control over it. We support object store external storages for larger installations
shoeper commentedon Aug 30, 2015
Obviously you didn't read anything here.
RobinMcCorkell commentedon Aug 30, 2015
@shoeper The original issue is about NFS, but it rapidly derailed from there. Please open a relevant issue with an appropriate description if you are still seeing performance problems.
shoeper commentedon Aug 30, 2015
It is not importand anymore, but it wasn't really about NFS from the beginning on.
And in 2014 those delays were there no matter which storage backend is being used.
RobinMcCorkell commentedon Aug 30, 2015
@shoeper Please open an issue report if you have problems with ownCloud that are not being handled in any existing issues. This issue was (originally) about NFS, which is invalid from an ownCloud perspective, thus it was closed.
shoeper commentedon Aug 30, 2015
This issue wasn't about NFS.