FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    How to prevent performance issues from unbounded login history growth?

    Scheduled Pinned Locked Moved Solved
    Frequently Asked Questions (FAQ)
    performance login-records database retention configuration
    1
    2
    5
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FASupportBot
      last edited by

      Our FusionAuth instance has accumulated a large volume of login history records over time. We currently have Login Record Settings configured with unlimited retention, and we've been advised that this unbounded growth could eventually impact system performance and stability.

      What is the recommended approach for managing login history retention to maintain optimal performance? Is there a best practice retention period, and what should we expect when implementing a retention policy on an existing large dataset?

      If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

      1 Reply Last reply Reply Quote 0
      • F
        FASupportBot
        last edited by

        To prevent performance degradation from unbounded login history growth, you should configure a retention period in your Login Record Settings rather than keeping unlimited history.

        Recommended Configuration

        1. Navigate to Settings → System → Advanced → Login Record Settings
        2. Enable auto-deletion of login records
        3. Set a retention period (365 days is a common best practice)
        4. Once configured, records older than your specified retention period will be removed on a rolling basis

        What to Expect

        • Zero downtime: This is a simple configuration change that does not require any system downtime
        • Initial cleanup: After setting the retention period, FusionAuth will automatically delete existing records that exceed the retention threshold. Any existing login records older than the configured number of days become eligible for deletion based on this configuration — they are not grandfathered in.
        • Rolling maintenance: Going forward, old records are automatically cleaned up, preventing the tables from growing indefinitely

        Implementation Options

        You can make this configuration change yourself during a convenient time. The change can be applied through:

        • Admin UI: Navigate to Settings → System → Advanced → Login Record Settings
        • System Configuration API: Use a PATCH or PUT request to /api/system-configuration with the loginRecordConfiguration settings
        • Terraform: Configure the login_record_configuration block in your system configuration resource

        This proactive maintenance helps ensure your FusionAuth instance remains performant as your user base and login volume grow over time.

        Related Documentation

        • Update System Configuration API - Request Body - Details on configuring login record retention via API, including the loginRecordConfiguration.delete.enabled and numberOfDaysToRetain parameters
        • Terraform System Configuration Resource - Configuration reference for managing login record settings with Terraform
        • Search Login Records API - API for searching and paginating through login records
        • Export Login Records API - API for exporting login records to CSV format

        If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

        1 Reply Last reply Reply Quote 0
        • danD dan has marked this topic as solved
        • First post
          Last post