Hi guys,

I have a website which, a few times a day (8am, 4pm and 8pm) exports around 30-40mb of images to an external server via the PHP FTP extension. The transfer process normally only takes 4-5 minutes but during this time the rest of the site freezes up for anyone else trying to view it.

At the moment im not sure whether the problem is php freezing up or the fact that all the servers bandwidth is being used for the FTP transfer.

What i'd like to know is:

  • If php is using all of its resources for the FTP transfer how do i fix it? OR
  • If the problem is with the limited bandwidth on the server is there a way to throttle the amount of bandwidth used during the FTP PUT operation.

Many thanks

Jimbo

    I expect you need to talk to your network admin / sysadmin to answer these questions.

    I assume you're running this off cron - in which case it is definitely a case of bandwidth exhaustion. Your network admin may be able to install traffic shaping rules on to their routers to throttle outgoing FTP data in some way. talk to them.

    Alternatively, it may be possible to use a FTP application which will throttle stuff for you, or get the FTP server to do it (I assume the FTP server is under your exclusive control).

    30-40 megs of images 3 times a day sounds like a lot. If they are not all new images, you may want to consider using rsync instead or ftpmirror, which may avoid sending images which have not changed / aren't new.

    Mark

      u have a php script exporting the images to the external server? how is the scheduling done? cron? wget?

      have you looked at the server when it runs to see if the processor is getting hammered?

        MarkR:

        Unfortunatly, we do not have control of the external FTP server.

        I will speak to our server admin and see what he can do.

        Thanks guys.

          Write a Reply...