Legacy Knowledge Base
Published Sep. 10, 2025

A Large Amount of Expired Records in SamlSpMessages and SamlSpAuthRequests Table Should be Cleaned up

Written By

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • The high CPU usage is observed every hour in the database server and a large amount of data exists in SamlSpMessages and SamlSpAuthRequests table. 

Environment

  • DXP 7.1

Resolution

  • The root cause could be that the following two listeners somehow were not working for a while and a huge amount of expired records are not cleaned up. When the listeners are reactivated again, they require extensive resources to clean up these tables.

    com.liferay.saml.runtime.internal.messaging.SamlSpMessageMessageListener

    It's deleting expiredSamlSpAuthRequets by comparing the createDate in DB and the SpAuthRequestMaxAge configuration in Liferay.


    com.liferay.saml.runtime.internal.messaging.SamlSpAuthRequestMessageListener

    It's deleting ExpiredSamlSpMessages by checking the Expiration date.

  • To clean up the expired records in SamlSpMessages and SamlSpAuthRequests table, consider using the following API. It is recommended to do the clean up during non-peak hours.

    com.liferay.saml.persistence.service.SamlSpMessageLocalServiceUtil.deleteExpiredSamlSpMessages();

    com.liferay.saml.persistence.service.SamlSpAuthRequestLocalServiceUtil.deleteExpiredSamlSpAuthRequests();
Did this article resolve your issue ?

Legacy Knowledge Base