Re: Slowing down an array / batch



matpac4@xxxxxxxxx wrote:
The more I learn the more I realize I don't know -


I have an aray looping that's sending info each time it loops to a
remote server, then getting a response and storing the response in a
database.

My problem is that I have a lot of data that I have ready to go
through this loop but more than the remote server can handle if I just
set it loose.

I have about 20,000 rows of data that will be looped through it so
that's 20,000 connections and responses to the remote serve and
storing of the responses locally.

I'm not even sure if arrays are built to handle this much? Do you know
if there's a limit on an array?

My main problam is that the remote server will only allow 250 requests
per minute and 30,000 requests per day.


I've pasted my loop example below, but I need advice on how to either
create a batch system to make sure I onl loop through the array 250
times a minute and no more than 30,000 times a day - or a simple
way to pause the loop.

If anyone has an idea please and can point me in the right direction
it would really help.

// Here's the general idea below, see part of the loop:

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$items = "{$row['data']} <br>";

fputs($fp, "$itementer");

$remote_server_response = fgets($fp, 128);

// the fgets response is then added to a mysql database each time the
array loops

}

You'll need access to both servers. Then you'll need to write a script which can merge multiple requests into one and send them. On the other end, separate the requests, process them and combine the responses into one string for returning to the caller.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: serialized XMLHttpRequests
    ... since you asked me in another message what part of your post I didn't understand, I felt like the response missed I needed to know in response my query. ... given that the requests are handled asynchronously. ... it works for the first loop but doesn't trigger off all the event handlers for the second loop. ...
    (comp.lang.javascript)
  • Re: Do you think NI can fix my PLL? -- Details
    ... One also usually expects that the VCO response, ie., the frequency response of the phase, is not burdened by zeros/poles close to the desired PLL BW, so one can treat it simply as Kvco/s. ... Basically, there needs to be some plan for elucidating if what I have at present is just a mediocre motor characterization, poor choice of loop compensation, or trouble with the slight nonlinearities of the drive. ... If you're not getting any significant jitter at all then you should be able to make a really slow loop and be done with it. ...
    (sci.electronics.design)
  • Re: Cuk converter bizzare control loop
    ... >>Would like to hear a comment on the control loop from someone who has ... I used a convertor with the same response to convey signals at ... frequencies approaching a small submultiple of the switching ... It is the same problem with respect to balancing the bike. ...
    (sci.electronics.design)
  • Re: Slowing down an array / batch
    ... then getting a response and storing the response in a ... through this loop but more than the remote server can handle if I just ... I've pasted my loop example below, but I need advice on how to either ...
    (comp.lang.php)
  • Re: Slowing down an array / batch
    ... then getting a response and storing the response in a ... through this loop but more than the remote server can handle if I just ...
    (comp.lang.php)