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
litespeed_wiki:cache:litemage:troubleshooting:warmup [2018/06/26 13:15]
Jackson Zhang [Warm Up for logged in users]
litespeed_wiki:cache:litemage:troubleshooting:warmup [2019/06/25 19:54] (current)
Jackson Zhang [Magento System Scheduler ''litemage_warmup_cache'' Hangs]
Line 229: Line 229:
  
 ===== Warm Up Still Not Working ===== ===== Warm Up Still Not Working =====
-If you have tried all of the above and LiteMage is still not working properly and showing the Warm-up List details, it is likely that incorrect values in Magento'​s Cron (Scheduled Tasks) setting is blocking cron jobs.+==== Magento System Cron issue ==== 
 +If you have triell ​of the above and LiteMage is still not working properly and showing the Warm-up List details, it is likely that incorrect values in Magento'​s Cron (Scheduled Tasks) setting is blocking cron jobs.
  
 We suggest returning these settings, located under **System > Configuration > Advanced > System > Cron (Scheduled Tasks)**, to their defaults below to fix the problem. ​ We suggest returning these settings, located under **System > Configuration > Advanced > System > Cron (Scheduled Tasks)**, to their defaults below to fix the problem. ​
Line 274: Line 275:
   dealwel+ 4489 1 10 04:23 pts/0 00:00:17 /​usr/​local/​lsws/​fcgi-bin/​lsphp5 /​home/​dealwellne/​domains/​example.com/​public_html/​cron.php   dealwel+ 4489 1 10 04:23 pts/0 00:00:17 /​usr/​local/​lsws/​fcgi-bin/​lsphp5 /​home/​dealwellne/​domains/​example.com/​public_html/​cron.php
  
-We did see some case that system cron seems to be showing in the cron log in /​var/​log/​cron but actually there is no such progress running. It did start to run when we change to documentroot and manuualy ​run the cron job.+==== cron.sh script issue ==== 
 +We did see some case that system cron seems to be showing in the cron log in /​var/​log/​cron but actually there is no such progress running. It did start to run when we change to documentroot and manually ​run the cron job.
        
 vi /​home/​dealwellne/​domains/​example.com/​public_html/​ vi /​home/​dealwellne/​domains/​example.com/​public_html/​
Line 310: Line 312:
     fi     fi
   fi   fi
 +==== Magento AOE Scheduler doesn'​t mark completion of ''​litemage_warmup_cache''​====
 +[[https://​github.com/​AOEpeople/​Aoe_Scheduler|Magento AOE Scheduler extension]] sits on top of Magento'​s default cron functionality allowing the users to manage the jobs and visualize the timeline. ​
  
 +LiteMage works with AOE scheduler most of the time. However, occasionally,​ Magento AOE scheduler sometimes believers the LiteMage warmup process is always running while it has stopped by the max execution time hence AOE scheduler doesn'​t start next ''​litemage_warmup_cache''​ at all.
 +
 +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-2.png?​800 |}}
 +
 +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 |}}
 + 
 +Check the LiteMage cron log, like so:
 +  tail -f /​home/​jsmith/​public_html/​var/​log/​litemage_crawler.log
 +
 +  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:​jsmith:​1559124843] ​ litemage_runner crawling ​ store1 urls (cur_pos:0) with cookie ​
 +  litemage_cron=store1;​ Array
 +  LiteMage [cron:​jsmith:​1559124843] ​  (
 +  LiteMage [cron:​jsmith:​1559124843] ​      [0] => https://​www.example.com/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [1] => https://​www.example.com/​business-office-writing/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [2] => https://​www.example.com/​business-office-writing/​conference-business/​business-card-holders/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [3] => https://​www.example.com/​business-office-writing/​paper/​promotional-calendars-diaries/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [4] => https://​www.example.com/​business-office-writing/​desk/​promotional-calculators/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [5] => https://​www.example.com/​business-office-writing/​paper/​promotional-notebooks/​
 +  LiteMage [cron:​jsmith:​1559124843] ​  )
 +  LiteMage [cron:​jsmith:​1559124843]
 +  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:​jsmith:​1559124843] ​  (
 +  LiteMage [cron:​jsmith:​1559124843] ​      [0] => https://​www.example.com/​bags-and-travel/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [1] => https://​www.example.com/​clothing-accessories/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [2] => https://​www.example.com/​usb-technology/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [3] => https://​www.example.com/​food-and-drink/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [4] => https://​www.example.com/​health-personal-care/​
 +  LiteMage [cron:​jsmith:​1559124843] ​      [5] => https://​www.example.com/​bags-and-travel/​travel/​backpacks/​
 +  LiteMage [cron:​jsmith:​1559124843] ​  )
 +
 +These results mean that the warmup did begin to run, so we know it works when started manually. A ''​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. ​
 +
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-9-litespeed-warmup-stats-stopped-exceeding-defined-max-run-time.png?​800 |}}
 +
 +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
 +
 +This is normal, since 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 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 jsmith -e
 +  ​
 +  MAILTO=""​
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /​usr/​local/​bin/​php /​home/​jsmith/​public_html/​cron.php
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /​usr/​local/​bin/​php /​home/​jsmith/​public_html/​cron.sh
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /bin/bash /​home/​jsmith/​public_html/​scheduler_cron.sh --mode always
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /bin/bash /​home/​jsmith/​public_html/​scheduler_cron.sh --mode default
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /bin/bash /​home/​jsmith/​public_html/​cron.sh
 +  SHELL="/​usr/​local/​cpanel/​bin/​jailshell"​
 +  * * * * * /bin/sh /​home/​jsmith/​public_html/​cron.sh
 +  * * * * * /bin/sh /​home/​jsmith/​public_html/​cron.sh cron.php
 +
 +**NOTE**: You may need ''​SHELL="/​usr/​local/​cpanel/​bin/​jailshell"''​ on cPanel for jailshell.
 +
 +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**:​
 +
 +  Run scheduler_cron.sh instead cron.sh (recommended)
 +  Run every minute (recommended)
 +  Edit your crontab:
 +  sudo crontab -u jsmith -e
 +  Add following configuration:​
 +  * * * * * /bin/bash /​home/​jsmith/​public_html/​scheduler_cron.sh --mode always
 +  * * * * * /bin/bash /​home/​jsmith/​public_html/​scheduler_cron.sh --mode default
 + 
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-7-scheduler-instruction2.png?​600 |
 +}}
 +
 +Remove all duplicated cron commands and only keep the above two configurations. {{ :​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 |}}
 +
 +{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​781630-10-aoe-scheduler-stop-litemage_warmup_cache-3-highlight.png?​|800}}
 +
 +The above-scheduled tasks view show the AOE scheduler'​s problem. ''​litemage_warmup_cache''​ was scheduled for 17:02 and run for 5 mins. However, AOE scheduler did not mark the task as "​completed"​ at 17:07 and treats it running all the time. Then 17:12, 17:22, 12:32 etc scheduled ''​litemage_warmup_cache''​ never run due to the incorrect status issue for 17:02 's job.  It may need your Magento developer or AOE developer to fix such issue to make ''​litemage_warmup_cache''​ run without any problem until the completion. ​
 ===== Warm Up for logged in users ===== ===== Warm Up for logged in users =====
-Normally logged in user and non-logged in user will share the same copies. However when you enable ​LiteMage configuration->​ "Separate Cache Copy per Customer Group" setting, LiteMage will have different cache copies. ​+Normally logged in users and non-logged in users will share the same cache copies. Howeverwhen you enable ​**Separate Cache Copy per Customer Group** in LiteMage configuration, LiteMage will have different cache copies. ​ 
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-when-separatecachcopy.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-when-separatecachcopy.png?​600 |}}
  
-The crawler warmup guide above only shows how to warm up for non-login user. However, if you don't enable crawler for logged-in users, the Logged-in page may be running ​slow during the first visit when cache miss. +The crawler warmup guide above only shows how to warm up the cache for non-logged in users. However, if you don't enable ​the crawler for logged-in users, the logged-in page may run slow during the first visit when there'​s a cache miss. 
  
-How to enable cache warmup for logged in users?You should use "Crawl on Behalf of Logged-in Users" setting in LiteMage "Cache Warm Up" configuration. Place a user ID/User IDs from representative group/​groups,​ separating by space or comma. There is no need to place all user IDs, any user ID from that user group will do since that group will share the same cache copy. If you have enabled multi-customer groups, one user id from each group will do.  ​ 
  
-For the example from the above, "only distinguish between logged-in vs logged-out user" selected all logged-in users will be in one same group, any logged-in user ID will do the job+==== Enabling Cache for Logged-in Users ==== 
 +You should use the **Crawl on Behalf of Logged-in Users** setting in LiteMage'​s **Cache Warm Up** configuration. Enter user IDs from representative groupsseparating them by space or comma. There is no need to place all user IDs. Any single user ID from that user group will do, since every user in that group will share the same cache copy. If you have enabled multi-customer groups, one user id from each group will do.  
  
-You should be able to get user ID from Magento admin customer menu. You can search for any particular email to find ID.+For the example from the above, with ''​only distinguish between logged-in vs logged-out user''​ selected, all logged-in users will be in the same group, and any logged-in user ID will do the job.  
 + 
 +You should be able to get user ID from the Magento admin customer menu. You can search for any particular email to find an ID.
    
-{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-user-id-search.png?​800 |}}+{{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-user-id-search.png?​1000 |}}
  
-Once you have the ID/IDs, you can place it/them to "Crawl on Behalf of Logged-in Users".+Once you have the IDs, you can place them in **Crawl on Behalf of Logged-in Users**.
 {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-onbehalfofloggedinuser.png?​600 |}} {{ :​litespeed_wiki:​cache:​litemage:​troubleshooting:​litemage-logged-in-user-warm-up-onbehalfofloggedinuser.png?​600 |}}
  
-Save the configuration ​and refresh ​the configuration from Magento Admin "Cache Management"​ to make it effective. +**Save the configuration** will make the change ​effective. ​ 
-   +
 ===== LiteMage Cache Warm Up configuration Reference ===== ===== LiteMage Cache Warm Up configuration Reference =====
 Please refer [[ litespeed_wiki:​cache:​litemage:​configuration:​cache_warm_up|this]] for LiteMage Cache Warm Up configuration Reference Please refer [[ litespeed_wiki:​cache:​litemage:​configuration:​cache_warm_up|this]] for LiteMage Cache Warm Up configuration Reference
  • Admin
  • Last modified: 2018/06/26 13:15
  • by Jackson Zhang