mydreamday-fi / site

mydreamday.fi (Magento 2)
https://upwork.com/fl/mage2pro
0 stars 0 forks source link

«we randomly get times of 100% CPU load, and the whole site becomes unresponsive for 2 - 60 minutes» #8

Closed dmitrii-fediuk closed 9 months ago

dmitrii-fediuk commented 9 months ago

upwork.com/ab/messages/rooms/room_03381db58c36a6b08e81cfd45f6973f4/story_9ca4f137a3835d092195fbef99e67286?companyReference=711981728333447169&atTimestamp=1707135807917

dmitrii-fediuk commented 9 months ago

We found that php processes was querying a quote with ID 11467 all the time. This quote had trigger_recollect set to 1. We manually changed it to 0 and it seems to have helped. Since 9.30 gmt we have not had issues with the server being overloaded.

upwork.com/ab/messages/rooms/room_03381db58c36a6b08e81cfd45f6973f4/story_bceb6fbc5ae4cda5d73fb366d235ded5?companyReference=711981728333447169&atTimestamp=1707424461334

dmitrii-fediuk commented 9 months ago
SELECT entity_id, created_at FROM quote
WHERE 1 = trigger_recollect
ORDER BY created_at DESC
LIMIT 10;

2024-02-09--13-05-50

dmitrii-fediuk commented 9 months ago
SELECT q.entity_id, q.created_at, p.method, q.trigger_recollect FROM
        quote as q
    LEFT JOIN
        quote_payment as p
    ON
        p.quote_id = q.entity_id
WHERE 1 = q.trigger_recollect
ORDER BY q.created_at DESC
LIMIT 15;

2024-02-09--14-34-09

dmitrii-fediuk commented 9 months ago
SELECT
    q.entity_id
    ,q.created_at
    ,r.code as "carrier code"
    ,LEFT(r.carrier_title, 15) as "carrier title"
    ,q.trigger_recollect
FROM
        quote as q
    LEFT JOIN
        quote_address as a
    ON
        a.quote_id = q.entity_id
    LEFT JOIN
         quote_shipping_rate as r
     ON
        r.address_id = a.address_id
WHERE 1 = q.trigger_recollect
ORDER BY q.created_at DESC
LIMIT 15;

2024-02-09--15-02-15

dmitrii-fediuk commented 9 months ago
SELECT
    q.entity_id
    ,q.created_at
    ,p.method as 'payment'
    ,r.code as 'carrier code'
    ,LEFT(r.carrier_title, 15) as 'carrier title'
    ,q.trigger_recollect as 'recollect'
FROM
        quote as q
    LEFT JOIN
        quote_address as a
    ON
        a.quote_id = q.entity_id
    LEFT JOIN
         quote_shipping_rate as r
    ON
        r.address_id = a.address_id
    LEFT JOIN
        quote_payment as p
    ON
        p.quote_id = q.entity_id
WHERE 1 = q.trigger_recollect
ORDER BY q.created_at DESC
LIMIT 15;

2024-02-09--15-05-43

dmitrii-fediuk commented 9 months ago

Solved by https://github.com/mydreamday-fi/site/issues/32