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

XMLUI Performance problem with validity cache on large pages

    Details

    • Type: Bug
    • Status: Volunteer Needed (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 6.3
    • Fix Version/s: None
    • Component/s: XMLUI
    • Attachments:
      0
    • Comments:
      4
    • Documentation Status:
      Needed

      Description

      There is very bad performance since hibernate was introduced. It's not Hibernate only related problem, it's with validity system.

      This dspace has 354 collections and 215 communities.

      A browse of 100 items make 1726 jdbc queries:

      1852847 nanoseconds spent acquiring 1 JDBC connections;
      0 nanoseconds spent releasing 0 JDBC connections;
      278114458 nanoseconds spent preparing 1726 JDBC statements;
      6359241648 nanoseconds spent executing 1726 JDBC statements;
      0 nanoseconds spent executing 0 JDBC batches;
      9388344 nanoseconds spent performing 123 L2C puts;
      306476 nanoseconds spent performing 3 L2C hits;
      3809820 nanoseconds spent performing 108 L2C misses;
      118797578 nanoseconds spent executing 2 flushes (flushing a total of 6224 entities and 5600 collections);
      3822857177 nanoseconds spent executing 105 partial-flushes (flushing a total of 311200 entities and 311200 collections)

      This is 6.3 seconds to get data. In production environment, with a remote database, its 35 seconds long.

      (not exact numbers due to hibernate cache, I suppose)

      354 - /* load org.dspace.content.Collection */
      530 - /* load one-to-many org.dspace.content.DSpaceObject.metadata */
      100 - /* load collection org.dspace.content.Item.bundles */
      742 - /* load collection org.dspace.content.Bundle.bitstreams */
      215 - /* load org.dspace.content.Community */
      100 - /* load one-to-many org.dspace.content.DSpaceObject.handles */

      This is because the DSpaceValidity class invalidate all the lazy configuration. The item fragment do:

      Item item = (Item) dso;
      validityKey.append("Item:");
      validityKey.append(item.getHandle());  <---- a query to Handle table
      validityKey.append(item.getOwningCollection()); <---- query to collection table AND add the collection (reenter this method and proccess the object)
      validityKey.append(item.getLastModified());
      // Include all metadata values in the validity key.
      List<MetadataValue> dcvs = itemService.getMetadata(item, Item.ANY, Item.ANY,Item.ANY,Item.ANY);   <----- Query to get metadata
      for (MetadataValue dcv : dcvs)
      {
        validityKey.append(dcv.getMetadataField().toString('.'));
        validityKey.append(dcv.getLanguage()).append("=");
        validityKey.append(dcv.getValue());
      }

      for(Bundle bundle : item.getBundles())   <---- Query to get bundles
      {
        // Add each of the items bundles & bitstreams.
        this.add(context, bundle);  <---- Reenter this method to add Bundle Object. (and for each bundle enter for each bitstream)
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adan.roman Adan Roman
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: