Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:litemage:troubleshooting:warmup [2019/06/19 18:52]
Jackson Zhang [Magento system scheduler ''litemage_warmup_cache'' hangs]
litespeed_wiki:cache:litemage:troubleshooting:warmup [2019/06/20 14:51]
Lisa Clarke [Magento system scheduler ''litemage_warmup_cache'' hangs] Copyediting
Line 312: Line 312:
     fi     fi
   fi   fi
-==== Magento ​system scheduler ​''​litemage_warmup_cache'' ​hangs ==== +==== Magento ​System Scheduler ​''​litemage_warmup_cache'' ​Hangs ==== 
-There is one use case related to Magento system scheduler. The user does see litemage_warmup_cache scheduled but it actually hangs there.+Sometimes the LiteMage warmup may hang in the Magento system scheduler.
  
-If you go to Magento Admin -> Scheduler ​-> Scheduler Timeline, you might see a long cross line for ''​litemage_warmup_cache''​ either in red or orange ​color, it actually ​means the cron hangs instead of running ​ok+If you navigate ​to **Magento Admin > Scheduler > Scheduler Timeline**, you might see ''​litemage_warmup_cache'' ​highlighted ​either in red or orange. It means the cron is hanging and is not running ​propery
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-6-scheduler-stunck.png?​800 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-6-scheduler-stunck.png?​800 |}}
  
-or 
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-6-scheduler-stunck-2.png?​800 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-6-scheduler-stunck-2.png?​800 |}}
  
-The user goes to Magento Admin -> System ​-> Scheduler ​-> Job Configuration,​ select ''​litemage_warmup_cache''​ then right top conner ​Actions ​for ''​Run now'',​ then ''​Submit''​.+Navigate ​to **Magento Admin > System > Scheduler > Job Configuration**, select ''​litemage_warmup_cache''​ then in the right top corner ​Actions, select ​''​Run now'',​ then press the **Submit** button.
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-8-scheduler-runnow.png?​800 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-8-scheduler-runnow.png?​800 |}}
    
-then check the litemage ​cron log by+Check the LiteMage ​cron log, like so
-  tail -f /home/user1/​public_html/​var/​log/​litemage_crawler.log+  tail -f /home/jsmith/​public_html/​var/​log/​litemage_crawler.log
  
-  2019-05-29T10:​14:​21+00:​00 DEBUG (7): LiteMage [cron:user1:​1559124843] ​ Generate url map for store1 url count=5320 +  2019-05-29T10:​14:​21+00:​00 DEBUG (7): LiteMage [cron:jsmith:​1559124843] ​ Generate url map for store1 url count=5320 
-  2019-05-29T10:​14:​21+00:​00 DEBUG (7): LiteMage [cron:user1:​1559124843] ​ litemage_runner crawling ​ store1 urls (cur_pos:0) with cookie ​+  2019-05-29T10:​14:​21+00:​00 DEBUG (7): LiteMage [cron:jsmith:​1559124843] ​ litemage_runner crawling ​ store1 urls (cur_pos:0) with cookie ​
   litemage_cron=store1;​ Array   litemage_cron=store1;​ Array
-  LiteMage [cron:user1:​1559124843] ​  ( +  LiteMage [cron:jsmith:​1559124843] ​  ( 
-  LiteMage [cron:user1:​1559124843] ​      [0] => https://​www.example.com/​ +  LiteMage [cron:jsmith:​1559124843] ​      [0] => https://​www.example.com/​ 
-  LiteMage [cron:user1:​1559124843] ​      [1] => https://​www.example.com/​business-office-writing/​ +  LiteMage [cron:jsmith:​1559124843] ​      [1] => https://​www.example.com/​business-office-writing/​ 
-  LiteMage [cron:user1:​1559124843] ​      [2] => https://​www.example.com/​business-office-writing/​conference-business/​business-card-holders/​ +  LiteMage [cron:jsmith:​1559124843] ​      [2] => https://​www.example.com/​business-office-writing/​conference-business/​business-card-holders/​ 
-  LiteMage [cron:user1:​1559124843] ​      [3] => https://​www.example.com/​business-office-writing/​paper/​promotional-calendars-diaries/​ +  LiteMage [cron:jsmith:​1559124843] ​      [3] => https://​www.example.com/​business-office-writing/​paper/​promotional-calendars-diaries/​ 
-  LiteMage [cron:user1:​1559124843] ​      [4] => https://​www.example.com/​business-office-writing/​desk/​promotional-calculators/​ +  LiteMage [cron:jsmith:​1559124843] ​      [4] => https://​www.example.com/​business-office-writing/​desk/​promotional-calculators/​ 
-  LiteMage [cron:user1:​1559124843] ​      [5] => https://​www.example.com/​business-office-writing/​paper/​promotional-notebooks/​ +  LiteMage [cron:jsmith:​1559124843] ​      [5] => https://​www.example.com/​business-office-writing/​paper/​promotional-notebooks/​ 
-  LiteMage [cron:user1:​1559124843] ​  ) +  LiteMage [cron:jsmith:​1559124843] ​  ) 
-  LiteMage [cron:user1:​1559124843] +  LiteMage [cron:jsmith:​1559124843] 
-  2019-05-29T10:​14:​32+00:​00 DEBUG (7): LiteMage [cron:user1:​1559124843] ​ litemage_runner crawling ​ store1 urls (cur_pos:6) with cookie ​+  2019-05-29T10:​14:​32+00:​00 DEBUG (7): LiteMage [cron:jsmith:​1559124843] ​ litemage_runner crawling ​ store1 urls (cur_pos:6) with cookie ​
   litemage_cron=store1;​ Array   litemage_cron=store1;​ Array
-  LiteMage [cron:user1:​1559124843] ​  ( +  LiteMage [cron:jsmith:​1559124843] ​  ( 
-  LiteMage [cron:user1:​1559124843] ​      [0] => https://​www.example.com/​bags-and-travel/​ +  LiteMage [cron:jsmith:​1559124843] ​      [0] => https://​www.example.com/​bags-and-travel/​ 
-  LiteMage [cron:user1:​1559124843] ​      [1] => https://​www.example.com/​clothing-accessories/​ +  LiteMage [cron:jsmith:​1559124843] ​      [1] => https://​www.example.com/​clothing-accessories/​ 
-  LiteMage [cron:user1:​1559124843] ​      [2] => https://​www.example.com/​usb-technology/​ +  LiteMage [cron:jsmith:​1559124843] ​      [2] => https://​www.example.com/​usb-technology/​ 
-  LiteMage [cron:user1:​1559124843] ​      [3] => https://​www.example.com/​food-and-drink/​ +  LiteMage [cron:jsmith:​1559124843] ​      [3] => https://​www.example.com/​food-and-drink/​ 
-  LiteMage [cron:user1:​1559124843] ​      [4] => https://​www.example.com/​health-personal-care/​ +  LiteMage [cron:jsmith:​1559124843] ​      [4] => https://​www.example.com/​health-personal-care/​ 
-  LiteMage [cron:user1:​1559124843] ​      [5] => https://​www.example.com/​bags-and-travel/​travel/​backpacks/​ +  LiteMage [cron:jsmith:​1559124843] ​      [5] => https://​www.example.com/​bags-and-travel/​travel/​backpacks/​ 
-  LiteMage [cron:user1:​1559124843] ​  )+  LiteMage [cron:jsmith:​1559124843] ​  )
  
-It means the warmup ​started ​to run.  +These results mean that the warmup ​did begin to run, so we know it works when started manually''​Run now''​ action won't fix the Magento system scheduler problem, however, ​and the initiated cron will be stopped due to exceeding ​the defined ​**Maximum Run Time** in the configuration. ​
- +
-But ''​Run now''​ action won't fix the Magento system scheduler problem and the initiated cron will be stopped due to exceeding defined Maximum Run Time in the configuration. ​+
  
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-9-litespeed-warmup-stats-stopped-exceeding-defined-max-run-time.png?​800 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-9-litespeed-warmup-stats-stopped-exceeding-defined-max-run-time.png?​800 |}}
  
-litemage_crawler.log ​shows:+Take a look at ''​litemage_crawler.log''​ and you will see something like the following:
   2019-06-19T16:​17:​05+00:​00 DEBUG (7): LiteMage [cron:​brandin1:​1560960721] ​ Stopped due to exceeding defined Maximum Run Time. cron meta end = Array   2019-06-19T16:​17:​05+00:​00 DEBUG (7): LiteMage [cron:​brandin1:​1560960721] ​ Stopped due to exceeding defined Maximum Run Time. cron meta end = Array
  
-it is normal since the user set the cron to stop at 5 minutes ​then it runs again at next scheduled time. If it stopped there completely without further running, there is some Magento system scheduler issue which needs to be fixed.+This is normalsince the cron was set to stop at 5 minutes ​before running ​again at the next scheduled time. If it had stopped there completely without further running, ​then there would be some Magento system scheduler issue which would need to be fixed.
  
-By further checking user1'​s ​crontab: +By taking a look at your crontab ​(assuming your userid is ''​jsmith''​) we see that you have too many of the same crons set up which may conflict with each other
-  crontab -u user1 -e+  crontab -u jsmith ​-e
   ​   ​
   MAILTO=""​   MAILTO=""​
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /​usr/​local/​bin/​php /home/user1/​public_html/​cron.php+  * * * * * /​usr/​local/​bin/​php /home/jsmith/​public_html/​cron.php
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /​usr/​local/​bin/​php /home/user1/​public_html/​cron.sh+  * * * * * /​usr/​local/​bin/​php /home/jsmith/​public_html/​cron.sh
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /bin/bash /home/user1/​public_html/​scheduler_cron.sh --mode always+  * * * * * /bin/bash /home/jsmith/​public_html/​scheduler_cron.sh --mode always
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /bin/bash /home/user1/​public_html/​scheduler_cron.sh --mode default+  * * * * * /bin/bash /home/jsmith/​public_html/​scheduler_cron.sh --mode default
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /bin/bash /home/user1/​public_html/​cron.sh+  * * * * * /bin/bash /home/jsmith/​public_html/​cron.sh
   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​   SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
-  * * * * * /bin/sh /home/user1/​public_html/​cron.sh +  * * * * * /bin/sh /home/jsmith/​public_html/​cron.sh 
-  * * * * * /bin/sh /home/user1/​public_html/​cron.sh cron.php+  * * * * * /bin/sh /home/jsmith/​public_html/​cron.sh cron.php
  
-(noteyou may need ''​SHELL="/​usr/​local/​cpanel/​bin/​jailshell"''​ on cpanel ​for jailshell)+**NOTE**You may need ''​SHELL="/​usr/​local/​cpanel/​bin/​jailshell"''​ on cPanel ​for jailshell.
  
-Too many same crones setup, which may conflict with each other. +The latest ​1.9.x.x version of Magento may prefer to run ''/​home/​jsmith/​public_html/​scheduler_cron.sh''​ instead of ''/​home/​jsmith/​public_html/​cron.sh''​. You can find this in **Magento Admin > System > Scheduler > Insctuctions**:
- +
-Latest ​1.9.x.x version of Magento may prefer to run ''/​home/​user1/​public_html/​scheduler_cron.sh''​ instead of ''/​home/​user1/​public_html/​cron.sh''​. You can find it from Magento Admin -> System ​-> Scheduler ​-> Insctuctions:​+
  
   Run scheduler_cron.sh instead cron.sh (recommended)   Run scheduler_cron.sh instead cron.sh (recommended)
   Run every minute (recommended)   Run every minute (recommended)
   Edit your crontab:   Edit your crontab:
-  sudo crontab -u user1 -e+  sudo crontab -u jsmith ​-e
   Add following configuration:​   Add following configuration:​
-  * * * * * /bin/bash /home/user1/​public_html/​scheduler_cron.sh --mode always +  * * * * * /bin/bash /home/jsmith/​public_html/​scheduler_cron.sh --mode always 
-  * * * * * /bin/bash /home/user1/​public_html/​scheduler_cron.sh --mode default+  * * * * * /bin/bash /home/jsmith/​public_html/​scheduler_cron.sh --mode default
    
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-7-scheduler-instruction2.png?​600 | {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-7-scheduler-instruction2.png?​600 |
 }} }}
  
-Remove all duplicated ​one and only keep the above two configurations. The issue is fixed.+Remove all duplicated ​cron commands ​and only keep the above two configurations. The issue will be fixed, and ''​litemage_crawler.log''​ will look ok. The ''​litemage_warmup_cache''​ cron task will show that it is running in **Scheduler** and **LiteMage Crawler Warm-up Status** will show that it is running ok. 
 + 
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-9-scheduler-litemage_warmup_cache_running.png?​800 |}} 
 + 
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-9-litespeed-warmup-stats-running.png?800 |}}
 ===== Warm Up for logged in users ===== ===== Warm Up for logged in users =====
 Normally logged in users and non-logged in users will share the same cache copies. However, when you enable **Separate Cache Copy per Customer Group** in LiteMage configuration,​ LiteMage will have different cache copies. ​ Normally logged in users and non-logged in users will share the same cache copies. However, when you enable **Separate Cache Copy per Customer Group** in LiteMage configuration,​ LiteMage will have different cache copies. ​
  • Admin
  • Last modified: 2019/06/25 19:54
  • by Jackson Zhang