This topic can no longer be replied to because it has been locked.

Is a 14-minute "mailchimp_bulksync_data" job normal?
Gravatar
Joined: 2017-04-13
Posts: 10
I'm finding that the "mailchimp_bulksync_data" job is routinely taking 13 and 14 minutes to complete. Its seems like this can't be normal because I believe by default the job schedules itself to run every 5 minutes, meaning it's taking so long to complete the job that it's missing the next scheduled instance (or next two scheduled instances) of the job.

More urgently, these long runtimes are making our site miss other more important jobs.

My questions are:
1. Are these 13- and 14-minute runtimes normal?
2. Is there anything I can do to reduce these runtimes?
3. If I reduce the frequency of the job to - let's say - every 6 hours, will the job take even longer to complete since it would then theoretically have 6 hours worth of sync data to send?

Thanks,
sean
Gravatar
Joined: 2016-06-09
Posts: 1020
It should not take that long, what version of Mailchimp for Magento are you using? Perhaps your server is processing to much data and bottlenecking? You could check this with your sysadmin to be sure.

If you reduce the frequency for the cronjob it will take the same time to run (assuming after those 14 minutes the cronjob finished successfully), because the number of orders, products and carts to be sent are defined constants in the code, you can see them in app/code/community/Ebizmarts/MailChimp/Model/Api, perhaps you can try and reduce this if you find out that the problem is the server
Gravatar
Joined: 2017-04-13
Posts: 10
I'm on version 1.1.5

My admin says the mailchimp_bulksync_data job is the bottleneck.

The job does complete about 90% of the times it runs, but it's not working right anyway. We're not seeing any order data hit MailChimp. That's a separate issue I need to investigate. I'm sure others in the forum have had this problem too, so I'll look around. Any helpful links for troubleshooting this that you want to provide here would be appreciated though.

Thanks for your reply.
Gravatar
Joined: 2017-04-18
Posts: 1
Same question with a 2 to 3 hours cron runtime.

We notice Mailchimp Module runs very slow db query like this in app/code/community/Ebizmarts/MailChimp/Model/Api/Products.php on line 37:

SELECT `e`.*, `m4m`.* FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = '22' LEFT JOIN `mailchimp_ecommerce_sync_data` AS `m4m` ON m4m.related_id = e.entity_id and m4m.type = 'PRO' AND m4m.mailchimp_store_id = 'xxxxxxxxxxxxxxxxxxxx' WHERE (m4m.mailchimp_sync_delta IS null OR m4m.mailchimp_sync_modified = 1) LIMIT 100

with our catalog of 20000 products it takes 200 seconds to run.

How can we speed up Mailchimp cron?
Gravatar
Joined: 2016-06-09
Posts: 1020
The query is limited to 100 so it should not go through all the products

Make sure you are not blocking Mailchimp IPs in your firewall: https://mailchimp.com/about/ips/
Gravatar
Joined: 2016-04-13
Posts: 9
Save problem over here. Two webshops with long running Mailchimp crons when we want to sync history orderdata.
Gravatar
Joined: 2016-05-06
Posts: 9
My cron job is also failing to run in a timely manner.... so the schedule is getting bogged down by this bulk data sync continuing to run in the background. Where would I look to make the cron run less frequently. I don't see it set in the /etc/modules/Ebizmarts_MailChimp.xml file?

Thanks!
Gravatar
Joined: 2016-06-09
Posts: 1020
Hello,

Try running this query in your database to speed up the cronjob:

alter table mailchimp_ecommerce_sync_data add index idx_related_id (related_id);
Gravatar
Joined: 2016-05-06
Posts: 9
Thanks!

That knocked the run time from 6 minutes to 9 seconds.

NEWSLETTER

Subscribe to our newsletter to receive emails and useful news articles