• Resolved bammichael

    (@bammichael)


    I’ve been working to develop a Python script that serves as a “database sync” between a database the company operates and a WooCommerce product database. I use the WooCommerce REST API to push data to the site, but I’ve run into a small issue.

    First, I should note, we have a cheap server we currently are renting with very rough specs and a maximum IO allowed speed of 10 MB/s. As soon as development/testing finishes, we will be upgrading.

    The issue is this: if I push a product to the WooCommerce product database, it is possible that the images sent in the “post” command are simply too big and the server tries to download all 8 of them at the same time, surpassing the 10 MB/s cap on the machine. I’ve noticed that with some 4k pixel images, it simply gives up and returns a server 503 error. I’ve come to three possible solutions and would like input.
    1. I simply ignore this issue because we do intend to use a stronger server for live.
    2. By some means, I instruct either the Python code OR the WordPress website to never allow any action to hit or pass this 10 MB/s cap.
    3. I split the post command into a post command with 1 image and then however many updates necessary to push each image one at a time to the product.

    Our test machine is rented from GoDaddy. We don’t plan on using GoDaddy once we roll the site out to a larger audience.

    Thank you for your time!

    • This topic was modified 2 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    4K images could possibly exceed other limits like “upload_max_filesize”. But if the I/O speed really is the issue, the simplest solution is to use your browser’s network developer tool to throttle connection speed to simulate a mobile or poor internet connection. You’ll need to always have this tool open when performing uploads. This solution is even more attractive since it’s a temporary situation. Not ideal as a permanent solution.

    For a permanent solution, #2 would be ideal, but I don’t think it’s possible with Python or PHP. I/O happens at a lower level. #1 would make it difficult to ensure your dev work is functioning properly, which leaves us with #3. I’m unsure if limiting POST request size would have a direct impact on I/O speed. It will help with upload_max_filesize and post_max_size, but not I/O speed itself.

    Thread Starter bammichael

    (@bammichael)

    I’ll look into the max filesize value, good call.

    The main reason I believe it to be the IO speed is from another forum post that showcased images of the “IO” bar on the cPanel dashboard hitting 100% when they performed IO actions, and I was able to verify the same on our testing site.

    Ideally this python script will be setup to run x times a day from a Windows server machine inside our network. I’ve considered running this on an Amazon AWS machine, but my calculations had it being costly to keep a machine running 24/7 for Python scripts, even if it was solely a Linux server. I’m unsure how I could configure browser controls onto such a machine, I’m less practiced at cloud hypervisors. I would guess the reason to consider going cloud would be the uptime and guarantee none of our local machines get knocked out in a thunderstorm or such.

    I personally want to solve it using #2. #3 is an incredibly inefficient and imo overkill response to this limitation, and for #1 I do not want to just “hope” it doesn’t happen on other machines.

    • This reply was modified 2 years, 8 months ago by bammichael.
    Moderator bcworkz

    (@bcworkz)

    I’m unaware of any way to throttle I/O with PHP. I don’t know enough about Python to even speculate. I don’t really even understand an I/O limitation in hosting. I thought it’s established as part of the TCP handshake. Why would a server accept a higher speed if there’s some sort of limitation? I looked at one of my client’s cPanel (not GoDaddy, but shared hosting). It doesn’t appear to have any sort of I/O limitation. There’s an overall bandwidth limitation per month, but no speed limitation I could see.

    What happens when allowable I/O is exceeded? How are we expected to stay within the limit? A 1 MB file could exceed the limit if it’s pushed through in less than 0.1 sec. These are all rhetorical questions, I’m not expecting any answers. I’m unclear what a proper solution would entail. Whatever it might be, is it really worth developing such a solution for something that’s temporary?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress “Max IO Speed” Issue’ is closed to new replies.