Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-4342

High CPU usage when calling the collection_id/items REST endpoint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Code Review Needed (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 6.3, 5.10
    • Fix Version/s: 6.4, 5.11
    • Component/s: None
    • Attachments:
      0
    • Comments:
      4
    • Documentation Status:
      Not Required

      Description

      As part of the Symplectic Elements harvesting process, the collection_id/items REST endpoint is called which seems to cause a high CPU load on the DSpace server. 

      We suspect that the high CPU load is caused by the inefficient implementation of the CollectionsResource.getCollectionItems method. This method will retrieve all items for a collection, and just iterate the items for the given offset and limit. 

      https://github.com/DSpace/DSpace/blob/dspace-6.3/dspace-rest/src/main/java/org/dspace/rest/CollectionsResource.java#L276

      Our suggested improvement is to include the limit and offset when calling the findByCollection method, so only the items requested by the REST call are retrieved:

      https://github.com/DSpace/DSpace/blob/dspace-6.3/dspace-api/src/main/java/org/dspace/content/service/ItemService.java#L127

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            philipatmire Philip Vissenaekens (Atmire)
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: