Cleanup Job crashes MySQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tim
    Junior Member
    • Aug 2024
    • 21

    Cleanup Job crashes MySQL

    I observe quite an interesting behavior. If "Cleanup" job is executed via cron once a week (default schedule) it crashes MySQL (MySQL has gone away). If I run it manually via "bin/command run-job Cleanup" it does take a while but finishes fine. If I run it manually day before scheduled job the cron job also finishes fine on the next run.

    Any ideas what could cause it? Any workarounds? Maybe changing the schedule to run the job on a daily basis?
  • yuri
    Member
    • Mar 2014
    • 8535

    #2
    It could because of different environment used when running from cron – different parameters applied. But have not no idea what is exact reason.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • tim
      Junior Member
      • Aug 2024
      • 21

      #3
      What would be the proper way to change Cleanup job schedule to run every hight?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8535

        #4
        Administration > Scheduled Jobs > Cleanup. Then, you can edit Scheduling in crontab notation.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • goingUp
          Junior Member
          • Sep 2024
          • 8

          #5
          Originally posted by tim
          Any ideas what could cause it?
          Maybe Mysql uses too much memory and is killed by OOM killer. It can cause "MySQL has gone away" error. Fix is to adjust memory limits in Mysql.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8535

            #6
            Or timeout. The Cleanup job should not consume a lot of memory as far as I know.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • tim
              Junior Member
              • Aug 2024
              • 21

              #7
              Yes. It is heavy on CPU, not memory:

              Click image for larger version

Name:	image.png
Views:	15
Size:	6.9 KB
ID:	113896Click image for larger version

Name:	image.png
Views:	12
Size:	8.8 KB
ID:	113897

              Curiously enough is that slowest queries are scheduled_job_log_record select and delete

              Click image for larger version

Name:	image.png
Views:	15
Size:	7.0 KB
ID:	113898
              Those are just log records, right?

              Comment

              • yuri
                Member
                • Mar 2014
                • 8535

                #8
                Hope it will be taking less resources in v9.0. These are scheduled job log records.
                If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

                Comment

                Working...