Re: Slowing down an array / batch
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 15 Nov 2008 09:22:37 -0500
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
==================
.
- Follow-Ups:
- Re: Slowing down an array / batch
- From: matpac4
- Re: Slowing down an array / batch
- References:
- Slowing down an array / batch
- From: matpac4
- Slowing down an array / batch
- Prev by Date: Re: onewaylinkexchange.net / linkshighway.net is a fraud website
- Next by Date: Re: How to send email using the mail function on Windows XP?
- Previous by thread: Slowing down an array / batch
- Next by thread: Re: Slowing down an array / batch
- Index(es):
Relevant Pages
|