Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    ProGet log deletion query takes 26 hours

    Scheduled Pinned Locked Moved Support
    5 Posts 3 Posters 15 Views 1 Watching
    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.
    • J Offline
      jerome.jolidon_1453
      last edited by jerome.jolidon_1453

      Hello all,

      We had a small issue in production today that forced us to restart the container: the ancient log deletion query ran over 26 hours, with 15% cpu used on the DB instance.

      The service eventually collapsed into unresponsiveness due to database DTU throttling when the second identical query started and the workers started using the service intensively (around 9:45 local time).

      The culprit is this query:

      WITH LM AS (
              SELECT RN = ROW_NUMBER() OVER (PARTITION BY [Message_Level]
                                                 ORDER BY [LogMessage_Id] DESC)
                FROM [LogMessages]
          )
          DELETE
            FROM LM
           WHERE RN > 1000
      

      The deployment is the container image v6.0.19 on Azure with an Azure SQL server instance.

      Here are some screenshots of the app and db performance logs:
      DTU during outage
      DTU_during_outage.png
      DB query stats
      DB_DTU_stats.png
      DTU at the end of outage
      DTU_end_of_outage.png
      App perfs during outage
      App_cpu_memory_traffic_during_outage.png
      Run logs for this query
      7a9e04ad-1c10-49ca-9433-2f2ef281f411-image.png

      1 Reply Last reply Reply Quote 0
      • J Offline
        jerome.jolidon_1453
        last edited by

        Could this be related to this issue? https://inedo.myjetbrains.com/youtrack/issue/PG-2189

        atrippA S 2 Replies Last reply Reply Quote 0
        • atrippA Offline
          atripp inedo-engineer @jerome.jolidon_1453
          last edited by

          Hi @jerome-jolidon_1453 ,

          Looks like you found the place where that was fixed; that query is a weak point when there's intensive database logging. About the only time that happens is when the server is overloaded with a traffic spike and starts running into database connection errors. So those just pile up.

          It could also happen if some one left on Feed-level logging (Admin > Advanced setting, we do not recommend it).

          Cheers,
          Alana

          1 Reply Last reply Reply Quote 0
          • J Offline
            jerome.jolidon_1453
            last edited by

            I checked, we don't have feed-level logging enabled.

            Very well then, I'll push to have our instance upgraded quickly so we don't run into it in the future.

            Thanks for the confirmation.

            Sincerely,
            Jérôme Jolidon

            1 Reply Last reply Reply Quote 0
            • S Offline
              summercurrants_4154 @jerome.jolidon_1453
              last edited by summercurrants_4154

              @jerome-jolidon_1453 said in ProGet log deletion query takes 26 hours:

              Could this be related to this issue?foodlehttps://inedo.myjetbrains.com/youtrack/issue/PG-2189

              Ok, that is clear now. Thank you for your answer.

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post
              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation