As repository size grows with Hyrax 5/Fedora 6, time to save a new work becomes unmanageable (>2 minutes). This is not counting the time to ingest the file set, create the derivative, etc. Hyrax spends minutes just creating the metadata for the work itself.
{'method_iteration': 1,
'resource_type': '#<GwEtd',
'attributes': {'id': None,
'internal_resource': 'GwEtd',
'created_at': '2026-03-27T13:47:47.683Z',
'updated_at': '2026-03-27T13:47:47.684Z',
'new_record': True,
'alternate_ids': [],
'embargo_id': None,
'lease_id': None,
'title': ['IGNORE manually created'],
'date_modified': '2026-03-27T13:47:47.339+00:00',
'date_uploaded': '2026-03-27T13:47:47.339+00:00',
'depositor': 'admin@example.com',
'admin_set_id': {'id': 'acf631b0-5611-42b8-84ee-52cecc81e9b2'},
'member_ids': [],
'member_of_collection_ids': [],
'on_behalf_of': None,
'proxy_depositor': None,
'state': {'@id': 'http://fedora.info/definitions/1/0/access/ObjState#active'},
# .... additional attributes
},
'graph_size': 0,
'start_time': '2026-03-27T13:47:47.685+00:00',
'end_time': '2026-03-27T13:47:47.707+00:00',
'duration': 0.022
}
{'method_iteration': 2,
'resource_type': '#<Hyrax::AccessControl',
'attributes': {'id': None,
'internal_resource': 'Hyrax::AccessControl',
'created_at': '2026-03-27T13:47:49.784Z',
'updated_at': '2026-03-27T13:47:49.784Z',
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'permissions': [{'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/public',
'mode': 'read'},
{'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'admin@example.com',
'mode': 'edit'}]},
'graph_size': 0,
'start_time': '2026-03-27T13:47:49.785+00:00',
'end_time': '2026-03-27T13:47:49.823+00:00',
'duration': 0.038
}
{'method_iteration': 3,
'resource_type': '#<Hyrax::Permission',
'attributes': {'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/public',
'mode': 'read'},
'graph_size': 0,
'start_time': '2026-03-27T13:47:49.798+00:00',
'end_time': '2026-03-27T13:47:49.808+00:00',
'duration': 0.01
}
{'method_iteration': 4,
'resource_type': '#<Hyrax::Permission',
'attributes': {'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'admin@example.com',
'mode': 'edit'},
'graph_size': 0,
'start_time': '2026-03-27T13:47:49.812+00:00',
'end_time': '2026-03-27T13:47:49.820+00:00',
'duration': 0.008}
{'method_iteration': 5,
'resource_type': '#<Hyrax::AccessControl',
'attributes': {'id': {'id': '2a337d6c-0302-4cee-a55a-1dfcdaed95f9'},
'internal_resource': 'Hyrax::AccessControl',
'created_at': '2026-03-27T13:47:49.784+00:00',
'updated_at': '2026-03-27T13:47:52.006Z',
'new_record': False,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'permissions': [{'id': {'id': '#g599160'},
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': False,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/public',
'mode': 'read'},
{'id': {'id': '#g599220'},
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': False,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'admin@example.com',
'mode': 'edit'},
{'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/admin',
'mode': 'edit'}]},
'graph_size': 24,
'start_time': '2026-03-27T13:47:52.127+00:00',
'end_time': '2026-03-27T13:51:53.041+00:00',
'duration': 240.914
}
{'method_iteration': 6,
'resource_type': '#<Hyrax::Permission',
'attributes': {'id': {'id': '#g599160'},
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': False,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/public',
'mode': 'read'},
'graph_size': 27362,
'start_time': '2026-03-27T13:48:54.350+00:00',
'end_time': '2026-03-27T13:49:56.201+00:00',
'duration': 61.851
}
{'method_iteration': 7,
'resource_type': '#<Hyrax::Permission',
'attributes': {'id': {'id': '#g599220'},
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': False,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'admin@example.com',
'mode': 'edit'},
'graph_size': 27362,
'start_time': '2026-03-27T13:50:46.324+00:00',
'end_time': '2026-03-27T13:51:53.038+00:00',
'duration': 66.714
}
{'method_iteration': 8,
'resource_type': '#<Hyrax::Permission',
'attributes': {'id': None,
'internal_resource': 'Hyrax::Permission',
'created_at': None,
'updated_at': None,
'new_record': True,
'access_to': {'id': 'c7e10119-26cc-4726-ba10-c733124bf635'},
'agent': 'group/admin',
'mode': 'edit'},
'graph_size': 0,
'start_time': '2026-03-27T13:51:53.038+00:00',
'end_time': '2026-03-27T13:51:53.039+00:00',
'duration': 0.001
}
Descriptive summary
As repository size grows with Hyrax 5/Fedora 6, time to save a new work becomes unmanageable (>2 minutes). This is not counting the time to ingest the file set, create the derivative, etc. Hyrax spends minutes just creating the metadata for the work itself.
Steps to reproduce the behavior in User Interface (UI)
Actual behavior (include screenshots if available)
Hyrax 5 (
hyrax-81f74086cf84), Fedora 6.5.1 (Docker image:fcrepo/fcrepo:6.5.1-tomcat9), Dockerized application.Using
rbspyandTracePoint, I've determined that the app spends a lot of time in this Valkyrie method which calls this method of theruby-rdfgem. The bottlenecking behavior occurs during the saving of the ACL object associated with a new work.I patched
Valkyrie::Persistence::Fedora::Persister::ModelConverter.convertto log some information at the completion of the method. Below are the logs from creating a single work in the UI (without attached files). A few things jump out at me:GwEtd) metadata, then once for each instance of aHyrax::Permissionapplied to the work (for thepublic/readanddepositor/editpermissions) and once for an instance ofHyrax::AccessControlthat owns those two permission objects.durationvalues are in seconds).graph_sizeis 0 -- this is a metric I added, a result of callinggraph_resource.graph.countwithin theconvertmethod (but after calculating the duration).convertmethod is called twice with (presumably) the same instances ofHyrax::Permissionas above, but this time the size of the graph has exploded.rest/development, which returns all top-level containers on the graph. Probably as a result of processing so many nodes, each of these two iterations costs 60 seconds.Hyrax::Permissionthat sets theadmin/editpermission.graph_resource.graph.deletein iterations 6 and 7, and of callinggraph_resource.graph.countwithin those same two iterations.I am not sure why those two additional calls (iterations 6 and 7) to the
convertmethod occur, nor why they pass in the full repository graph, as it were. That doesn't seem like it should be necessary to persist an ACL that points to a single work. If it weren't for this bottleneck, I think the step of saving a work would complete in a reasonable amount of time.Acceptance Criteria/Expected Behavior