You are here:  » Import_Feed - Script broken.

Support Forum



Import_Feed - Script broken.

Submitted by James Warren on Tue, 2007-05-01 11:59 in

Hi,
I have been importing feeds into the database. This hasn't been a problem before, however, yesturday I was importing quite a few feeds and it stopped working.
I received the following message from my host:
Hi,
> >
> > A few minutes ago the server that the user account "james" is hosted
> > on reported a much higher level of resource usage than normal. The
> > cause was determined to be the file located here:
> >
> > /home/james/public_html/thehighstreetonline/admin/feeds_import.php
> >
> > Specifically, it was using 100% of the disk I/O (Input/Output) on the
> > server, meaning that basically this 1 script was using 100% of the
> > disk's resources.
> >
> > In an effort to maintain server stability, access to this script has
> > been denied for the time being. If you want to continue to use it,
> you
> > would need to consult with the vendor on this issue. The way it
> > handles how it uses MySQL causes it to completely monopolize the disk
> resources.

Today, the script still wont run so I sent an email asking for the script to run and they said "That script isn't permitted untill it's fixed".

As far as i'm conserned it isn't boken!

Any advice?

Regards,

James Warren.

Submitted by support on Tue, 2007-05-01 13:08

Hello James,

You're correct - nothing is broken, but importing is a processor / disk intensive issue and your host is obviously running monitoring software to make sure that no process is "hogging" resources.

I've emailed you a modification which will cause the import record handler to "sleep" for 2 seconds every 100 products; and this should significantly reduce the resource usage attributable to this script.

The modification is to a different file (includes/admin.php) not the file that your host has blacklisted, so when you have installed the mod tell your host that the vendor has provided a fix even though there is no change to the actual file concerned.

I'll send the file to your registered forum email address.

Cheers,
David.

Submitted by ICH on Mon, 2007-05-07 03:56

Hello David,

just while ago i posted on a different thread regarding this mod...requesting it...

is it possible to send it to me as well?

Brgds

Submitted by ICH on Mon, 2007-05-07 04:13

sorry to follow up

is there an option on the script to change the parameters of the "sleep
mode" ?

i mean instead of every 100 products to set it up to 150 or any other ammount?

Brgds

Submitted by support on Mon, 2007-05-07 04:52

Hi,

I've forwarded the modification to you, along with simple instructions for the configuring the parameters. For the benefit of other users who would like to make this modification, look for the following code at line 288 (original distribution), or line 344 (latest distribution):

    return ($admin_importProductCount == $admin_importLimit);

...and REPLACE with:

    if (!($admin_importProductCount % 100))
    {
      sleep(2);
    }
    return ($admin_importProductCount == $admin_importLimit);

The value 100 controls the number of products between "sleeps", and the value 2 the number of seconds to sleep each time. These can be adjusted as required in order to optimise a reduced server load import on your installation.

Cheers,
David.