Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-20316

npm search queries with MSSQL can cause high resource utilization on the DB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 6.10.2
    • Fix Version/s: None
    • Component/s: Database, NPM
    • Labels:
      None

      Description

      Steps to reproduce:

      1. Have a large npm repository with million artifacts
      2. issue curl requests with

      curl -Lvv "http://artifactory_url:8081/artifactory/api/npm/npm/-/v1/search?text=ansi"

      3. Inspect CPU utilization on the DB

      The problematic query is:

      2019-07-24 16:34:29,942 [http-nio-127.0.0.1-8081-exec-6329] [DEBUG] (o.j.s.JdbcHelper    :78) - Executing SQL: 'select distinct  n.repo as itemRepo,n.node_path as itemPath,n.node_name as itemName,n.created as itemCreated,n.modified as itemModified,n.updated as itemUpdated,n.created_by as itemCreatedBy,n.modified_by as itemModifiedBy,n.node_type as itemType,n.bin_length as itemSize,n.node_id as itemId,n.depth as itemDepth,n.sha1_actual as itemActualSha1,n.sha1_original as itemOriginalSha1,n.md5_actual as itemActualMd5,n.md5_original as itemOriginalMd5,n.sha256 as itemSha2  from  nodes n left outer join node_props np100 on np100.node_id = n.node_id  where ( n.repo = 'npm-local' and( np100.prop_key = 'npm.description' and  np100.prop_value like '%angular2%')) and n.node_type = 1 '.
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            andreik Andrei Komarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: