Support » Plugin: Mailchimp for WooCommerce » /wp-json/mailchimp-for-woocommerce/v1/queue/work is slowing the website down

  • Resolved Amir

    (@amirmyb)


    After I installed Mailchimp on my woocommerce, the website is being slowed down by the script /wp-json/mailchimp-for-woocommerce/v1/queue/work.

    Is there any way to resolve this as it is adding an additional 2 seconds to the page lodad time.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 16 through 25 (of 25 total)
  • Demian

    (@demian85)

    Hello @ryanhungate

    We are a store with more than 10 online customers at the same time. The work queue is causing my product pages an extra 3-4s load time. We have a 10 core server, and +80% optimized pages according to GTMetrix. So I can’t optimize more.

    At the same time I am wondering if this job should be present on each page? Could you tell us more what the function does and if it’s possible to offload or dequeue it from pages? And also, are you thinking of a solution, because to me this is a very page unfriendly process of the plugin for WordPress owners.

    With thanks,
    Demian

    @lukefiretoss Do you happen to know how does the combination of configuration work?

    I am running the tasks via cron so I set

    define(‘DISABLE_WP_HTTP_WORKER’, true);

    So if I add the optional on demand queue processing flag:

    define('MAILCHIMP_DISABLE_QUEUE', true);

    Will the orders and all still sync via cron but only single at a time?

    Plugin Author ryanhungate

    (@ryanhungate)

    darnpunk If you’re using the WPCLI version ( which is recommended of course ) you would not need to worry about the DISABLE_QUEUE constant – but no it does not have any impact on that other process. They will process fast on the CLI.

    @demian85 sorry we missed this one earlier – when you say the queue is causing a 3-4 second load time, this process is supposed to be running in another process by the use of the rest-api making an async JS call to the server FROM the page view. No it is not supposed to be happening on every single page view either – it should only be doing that while jobs are in the queue. Are you positive it’s impacting the load time of the page? Or is this just showing up in a profiler somewhere?

    Also – if you have a larger store, making use of the CLI version will completely remove this process from happening on the web visits, and happen in the background completely. That IS the recommended way to run the queue for larger stores. You can find info on that here.

    https://github.com/mailchimp/mc-woocommerce/wiki/Advanced-Queue-Setup-In-CLI-mode

    Hi @ryanhungate ,

    Thanks for coming back, highly appreciated.

    Are you positive it’s impacting the load time of the page? Or is this just showing up in a profiler somewhere?

    The 3-4 seconds is coming from GTMetrix waterfall reports, but also from some other woocommerce experts on codeable.io who pointed this out. Here is an example: http://prnt.sc/pex02m

    No it is not supposed to be happening on every single page view either

    We have on each page the WC registration form in the header of the site. And I reckon that the option to opt in for MailChimp emails on the form is creating that the work is loading on each page.

    Our store has only 9 products, but there are 10-15 live users at the same time the entire day. Is the Github solution still applicable for my situation?

    With thanks,
    Demian

    Plugin Author ryanhungate

    (@ryanhungate)

    @demian85 if you have the ability to run the CLI mode – then yes, that’s pretty much ALWAYS the recommended approach to handle background jobs.

    The default queue, which does make use of a web request, is happening out of the scope of the current request, meaning it WILL show up on your reporting, but it should not be impacting the site visitor. If it IS, we might need to dig deeper into your setup to find out why – but I’m 99% sure this is a false positive.

    The CLI version will run in the background and not play a part of your website’s reporting. It will also get things done faster running in CLI mode. It doesn’t need site traffic to trigger it.

    Please do let us know if that solves the issue – it should be instantly reflected on your reports.

    Also if this solution works for you – we would most certainly appreciate a fair review of the plugin if you have a minute to do so 🙂

    I have had this same issue, but now I have the following showing on my dashboard:

    Mailchimp for Woocommerce
    
    We dectected that this site has the following constants defined, likely at wp-config.php file: MAILCHIMP_DISABLE_QUEUE
    These constants are deprecated since Mailchimp for Woocommerce version 2.3. Please refer to the plugin official wiki for further details.

    What is the new constant to stop so many requests to the server?
    Thank you.

    Plugin Author ryanhungate

    (@ryanhungate)

    @zhayter88 thanks for writing in – this is an easy one. All you have to do is remove that constant from your wp-config because the new version of the queue is making use of something called the Action Scheduler, which does not do any of the older logic which caused issues as you speak of.

    You’re perfectly fine to remove that and let the new plugin do its job 🙂 Thanks.

    @ryanhungate does this mean that the CLI mode is not needed anymore? Sorry if I misunderstand.

    tdcsforeveryone

    (@tdcsforeveryone)

    @ryanhungate I would also like to know this. My specific error msg was as follows:

    We dectected that this site has the following constants defined, likely at wp-config.php file: DISABLE_WP_HTTP_WORKER
    These constants are deprecated since Mailchimp for Woocommerce version 2.3. Please refer to the plugin official wiki for further details.
    Plugin Author ryanhungate

    (@ryanhungate)

    @demian85 no the CLI is not required, but it’s a good idea to use it if you can just because that’s the recommended approach to any background jobs in general. If you would still like to use this, please reference this wiki article here on what to do. https://github.com/mailchimp/mc-woocommerce/wiki/Advanced-Queue-Setup-In-CLI-mode

    @tdcsforeveryone even though your comment wasn’t exactly the same, you may also find this information on that same article above. The short of it is, you can remove the constants without any sort of issues on the 2.3 and above plugin versions.

Viewing 10 replies - 16 through 25 (of 25 total)
  • You must be logged in to reply to this topic.