Skip to content

[6.0.1] Slow sync to oC server. Delay in sending packets from oC server to NFS server #6937

Closed

Description

@ser72

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:

  1. 1000 empty files in one flat folder
  2. 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

  1. DeepDiver1975 commented on Jan 24, 2014

    @DeepDiver1975
    Contributor

    @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:

    1. 1000 empty files in one flat folder
    2. 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.

    —
    Reply to this email directly or view it on GitHub.

  2. butonic commented on Jan 24, 2014

    @butonic
    Contributor

    Hm, what NFS mount options are in use? I personally recommend

    rw,nfsvers=3,mountvers=3,hard,intr,tcp,rsize=32768,wsize=32768,addr=w.x.y.z (Personally, I would add noacl)
    

    Don't use fsc / NFS client caching.

  3. sleinen commented on Jan 24, 2014

    @sleinen

    The options used are simply:

        rw,vers=4,addr=w.x.y.z
    

    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.

  4. jcfischer commented on Jan 30, 2014

    @jcfischer
    Contributor

    I did some tests and performance tuning on the NFS server and the NFS clients.

    Here's our current mount options:

    rw,async,rsize=1048576,wsize=1048576
    

    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

  5. ser72 commented on Feb 3, 2014

    @ser72
    Author

    @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

  6. ser72 commented on Feb 4, 2014

    @ser72
    Author

    Perhaps related to: #5084??????

  7. DeepDiver1975 commented on Feb 4, 2014

    @DeepDiver1975
    Contributor

    #5084 is no longer relevant for oc6 - we changed the mimetype detection and no longer read the file content

  8. jcfischer commented on Feb 4, 2014

    @jcfischer
    Contributor

    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?

  9. DeepDiver1975 commented on Feb 4, 2014

    @DeepDiver1975
    Contributor

    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.

    Ouch!

    @ser72 Can you please share detailed information on that? @icewind1991 Can I place this into your scope of sql optimications? THX

  10. DeepDiver1975 commented on Feb 4, 2014

    @DeepDiver1975
    Contributor

    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

    @schiesbn @karlitschek we should put that on the sharing rework task list I guess

  11. DeepDiver1975 commented on Feb 4, 2014

    @DeepDiver1975
    Contributor

    Another 130 ms is spent in the resize operation (to create a thumbnail I presume). That should go to a background job, IMO

    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?

  12. DeepDiver1975 commented on Feb 4, 2014

    @DeepDiver1975
    Contributor

    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?

    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

  13. karlitschek commented on Feb 4, 2014

    @karlitschek
    Contributor

    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.

  14. georgehrke commented on Feb 4, 2014

    @georgehrke
    Contributor
  15. 28 remaining items

  16. shoeper commented on Mar 3, 2014

    @shoeper

    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.

  17. moscicki commented on Mar 3, 2014

    @moscicki

    @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...

  18. enoch85 commented on Jun 23, 2014

    @enoch85

    Any progress here?

  19. modified the milestone: backlog on Mar 21, 2015
  20. RobinMcCorkell commented on Aug 30, 2015

    @RobinMcCorkell
    Contributor

    NFS is a server-level filesystem, ownCloud has no control over it. We support object store external storages for larger installations

  21. shoeper commented on Aug 30, 2015

    @shoeper

    Obviously you didn't read anything here.

  22. RobinMcCorkell commented on Aug 30, 2015

    @RobinMcCorkell
    Contributor

    @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.

  23. shoeper commented on Aug 30, 2015

    @shoeper

    It is not importand anymore, but it wasn't really about NFS from the beginning on.

    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. - from the initial issues text

    And in 2014 those delays were there no matter which storage backend is being used.

  24. RobinMcCorkell commented on Aug 30, 2015

    @RobinMcCorkell
    Contributor

    @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.

  25. shoeper commented on Aug 30, 2015

    @shoeper

    This issue wasn't about NFS.

  26. locked as resolved and limited conversation to collaborators on Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions