Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-34478

Poor Docker repository performance with postgresql DB

    Details

    • Story Points:
      3
    • Sprint:
      NXRM Sentinels Sprint 42, NXRM Sentinels Sprint 49
    • Notability:
      3

      Description

      ISSUE: 

      Docker manifest requests takes 20 seconds with concurrent queries. 

       

      CAUSE:

      Customer have close to 1mil docker layers and thread dump shows most of the time spent on waiting for postgresql DB.

       

      DB schema tunings for nexusdb (docker_asset) might  help with improving performance.

      We see below query is slow on DB side, when concurrent requests are made.

       

      2022-07-29 02:39:02,483+0000 DEBUG [qtp987409992-69209]  *UNKNOWN org.sonatype.nexus.repository.docker.internal.datastore.store.DockerAssetDAO.browseAssets - ==>  Preparing: SELECT * FROM docker_asset as asset WHERE repository_id = ? AND (attributes::text LIKE ?) ORDER BY asset_id LIMIT ?;
      

       

      REPRODUCE STEPS:
      1. Deploy nexus 3.38.0 with postgresql DB
      2. Create a hosted docker repository and upload images
      3. Initiate concurrent queries to the hosted docker repo.

      while true; do curl -I http://nexusrepo:8081/repository/docker-hosted/v2/alpine/manifests/test; done
      

      4. Monitor request.log file for response.

      EXPECTED BEHAVIOR:

      Tuned DB query on large tables to help improving nexus performance.

       

        Attachments

          Activity

            People

            Assignee:
            mpiggott Matthew Piggott
            Reporter:
            sappusamy Srinivasan Appusamy
            CC:
            Yimin Zheng
            Last Updated By:
            Olu Shiyanbade Olu Shiyanbade
            Team:
            NXRM - Sentinels
            Owner:
            Matthew Piggott Matthew Piggott
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title