Skip to content

Cron using too many resources. #26809

Closed
Closed
@bobemoe

Description

@bobemoe

Preconditions (*)

  1. Magento CE 2.3.4
  2. PHP 7.2

Steps to reproduce (*)

  1. Upgrade existing store from 2.2.9 to 2.3.4

Expected result (*)

  1. Site and server continue to function as prior to upgrading

Actual result (*)

  1. Huge increase in CPU and RAM usage.

You can clearly see the increased load on our system graphs here. It has forced the server to start using swap. Graphs showing 12 hours before and after the M2.2.9 -> 2.3.4 upgrade. The upgrade was done at Tue 4 @ 18:00.

cpu-pinpoint=1580787323,1580895323
memory-pinpoint=1580787323,1580895323

Same graphs but for 3 days before and 4 days after the M2.2.9 -> 2.3.4 upgrade.

cpu-pinpoint=1580569819,1581261019
memory-pinpoint=1580569819,1581261019

I did some benchmarking on the memory and duration of the cron before and after the upgrade:

  • 2.2.9 Completed in 2.44 seconds using 330MB RAM
  • 2.3.4 Completed in 6.15 seconds using 714MB RAM

That is over double the time and memory used to do the same thing.

Measured with while [ true ] ; do echo $(date +%s.%3N ; free | tail -n2 ) ; sleep .1 ;done | tee cron.csv and plotted in libre office calc.

2.2.9:

2020-02-05-123012_1520x796_scrot

2.3.4:

2020-02-05-123026_1525x796_scrot

I see similar issues here but the solutions do not make much difference:

#25634
#26507

I did truncate the cron table Wed morning... you can see on the graphs the swap usage is lowered slightly but creeps back up over the next few days, so although that may well also be an issue, I think the increase in mem usage is something different.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions