I'd suggest a shell script - a couple of them, actually.  Have a shell
script on the Europe machine that runs continually.  It checks for the
existence of the cmd.sql file.  If it finds it, it FTPs it to the US server
and then deletes or archives the file locally.  If it doesn't find it, it
sleeps for 5 minutes, wakes up and looks again - minimum cpu cycles wasted.

The second script would be on the US server.  It would check every 5 minutes
for the cmd.sql file.  If it finds it, it would load it into MySQL and then
either delete or archive the file.  If it doesn't find the file, it goes
back to sleep.

Jack

-----Original Message-----
From: William Wang [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 1:43 PM
To: Jack Coxen; [EMAIL PROTECTED]
Subject: RE: many updates really slow


Thanks Jack and Jeremy.

But this is part of my application and I need to do
this automatically. I don't want to write a
server-client application to just to handle file
transimission and do pass the update cmd to local
server. Any idea? Thanks.

William

--- Jack Coxen <[EMAIL PROTECTED]> wrote:
> I'm guessing here but it sounds like you have the
> cmd.sql file on your local
> machine (in Europe).  If that's the case, compress
> the file, ftp it to the
> US server, uncompress it and do the load locally on
> the US server.
> 
> If you're doing the update remotely, you're probably
> being killed by
> transmission time.  Transferring the file in toto to
> the US server will be
> quicker than having the communications lag of doing
> sending a command from
> Europe to the US, having the command execute and
> then receiving the status
> back in Europe...times 5000 records.
> 
> Hope this helps,
> 
> Jack
> 
> -----Original Message-----
> From: William Wang [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 06, 2004 1:12 PM
> To: [EMAIL PROTECTED]
> Subject: many updates really slow
> 
> 
> Hi everyone,
> 
> Please help.
> 
> I have MySQL server running on host A in US and I am
> using it on host B in Europe. Every query takes
> about
> 0.3 seconds.
> 
> Now I want to do update db with 5000 updates. So I
> put
> all the "UPDATES" commands in a file cmd.sql and do:
> 
> mysql -hA < cmd.sql
> 
> and it takes 30 MINUTES which is reasonable: 0.3 *
> 5000 but unbearable.
> 
> Is there any better way to do this? Am I doing
> something stupid? Thanks a lot.
> 
> 
>       
>               
> __________________________________
> Do you Yahoo!?
> Win a $20,000 Career Makeover at Yahoo! HotJobs  
> http://hotjobs.sweepstakes.yahoo.com/careermakeover 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:   
>
http://lists.mysql.com/[EMAIL PROTECTED]
> 



        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

Reply via email to