Support » Plugin: Media Sync » Can only get 50-100 products to sync at a time

  • Resolved remymedranda

    (@remymedranda)


    Process keeps getting cut off, I’m assuming because you’re not sending requests in batches, instead just all at once causing the server to hang. I have a VPS and it normally can handle quite a few image uploads quickly no problems. Wondering if you can chime in and help explain why it keeps getting cut off and if you can fix it.

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author erolsk8

    (@erolsk8)

    Nope, it’s actually being sent in batches. I made some basic calculation to figure out the number of items it should import per batch, depending on how many files were selected. It goes like this:
    – under 10 items it’s 1 item per batch,
    – under 100 items it’s 10 items per batch,
    – under 1000 items it’s 25 items per batch,
    – above 1000 items it’s 50 items per batch.

    But this probably needs to be tweaked to work better. Though I’m not sure what the actual error is. Is it PHP execution timeout, HTTP request timeout, etc. I’d need to see some error to figure out how to improve it. Or if you have a suggestion, I’d be happy to hear it.

    For catching errors, I’ll copy something I wrote in another issue:
    1. disable all other plugins,
    2. turn on as many debugging options as possible (either in code or installing a plugin that does that),
    3. do a screen recording of the import process.

    Biggest priority and the main purpose of this plugin is to import all items at once, so I’d really like to improve that somehow. When I get some time from my full-time job 🙂

    • This reply was modified 1 year, 6 months ago by erolsk8. Reason: typo
    Thread Starter remymedranda

    (@remymedranda)

    jquery.js:4 POST wp-admin/admin-ajax.php 500

    Thats the err I get when it hangs.

    Plugin Author erolsk8

    (@erolsk8)

    Thanks, but that’s not giving me enough details to see what the problem is. To see the actual error, you need to enable debugging. You can do that by adding this to your wp-config.php file:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );

    As described here:

    Debugging in WordPress

    Also, how many files are you trying to import?

    Plugin Author erolsk8

    (@erolsk8)

    Closing due to inactivity. Please reopen if more details are available.

    Got the same issue as well.
    Only 20 images are imported from 200.

    I have very larger image size from 1 – 5 MB plus 2000 px + maybe that is cause an issue big files and resolution of images.

    Plugin Author erolsk8

    (@erolsk8)

    Hi @pornolala, image size shouldn’t matter because the images and all files stay in the same place, but I tried with 330 large images (20-30 MB each) – still couldn’t replicate this issue.

    But since I’m guessing the problem is with the number of files to process per each batch – I reduced that number to see if that might help.

    That update should now be available in 1.0.4 version.

    @remymedranda you can also try it out with 1.0.4 version.

    Please let me know if it works for you now.

    Hello!

    Problem here too I’m afraid. Uploaded some 300 small media files på sftp and now trying to import them to the Media Lib. The files are spread over 124 folders with only a few in each.

    But even though I’m only trying to import 10 folders (equals some 20-30 actual files) per batch every try is hit or miss. Sometimes it works sometimes not. The behaviour is ‘stalling’ where the progress bar stops while the activity indicator keeps rolling.

    Host is DO Droplet with Ubuntu LTS 18.04 and WP is 5.3.x. Tried with other plugins enabled and disabled. PHP mem max set to 256MB. Debug.log contains nothing related to this.

    Any ideas?

    Plugin Author erolsk8

    (@erolsk8)

    Hmm interesting, well, I’d turn on debugging, as I explained above:
    https://wordpress.org/support/topic/can-only-get-50-100-products-to-sync-at-a-time/#post-11866763

    Then I would console log in browser to see what’s actually happening:
    https://support.airtable.com/hc/en-us/articles/232313848-How-to-open-the-developer-console

    If nothing is found in “Console” tab, I’d also check “Network” tab.

    Kipperlenny

    (@kipperlenny)

    Same problem here – on my hoster I cannot get any logs, even with DEBUG_DISPLAY/LOG and print php errors…

    I changed the batch size to 5 in ajax_script.js – because the error 500 came mostly after 42 seconds – now it’s running well.

    perhaps you can add this batch_size as option?

    Kipperlenny

    (@kipperlenny)

    After many many images, I had an error 500 again. even with batch size == 1, id did not help. The image hat 7MB, I reduced it to 2MB, still error 500, I reduced the dimensions to 1920px width (1MB), it worked.

    Guess this was a memory_limit error now…

    perhaps a second option “ignore files over XY MB” ?

    Kipperlenny

    (@kipperlenny)

    And I was able to reproduce it with a small file size (700kb) and big image dimension (3500px width).

    these are the possible problems:

    1. script timeout
    2. big file size
    3. big image dimension

    Plugin Author erolsk8

    (@erolsk8)

    Hi @kipperlenny did you try to increase max_execution_time in php.ini?

    I don’t think that file size or image dimension matters here, only the number of files. Because if it scanned folders successfully and you selected what needs to be imported, it doesn’t look at the actual files anymore, it already has everything it needs to do the import.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Can only get 50-100 products to sync at a time’ is closed to new replies.