tags:

views:

34

answers:

3

I have a database server on host A, and some applications also on host A, on host B hosted by mediatemple i have application that needs to retrieve data from host A, this app works fine and super fast when on host A, but when on host B it's A LTO slower, it sometimes take 10 seconds to generate the page.

Because slow SQL queries. I tried persistent connections, it made the app load twice as fast, also i setup a ssh tunnel, it also improved the speed a bit, but it is still extremely slow!

Any solution to my problem?

A: 

I suggest making a cache. Make a local copy of important host B data on A server, then use a cron job to synchronize it every 15-60seconds. Synchronization can be make in both sides.

Thinker
A: 

Try experimenting with mysql replication or a ndb node.

Quamis
A: 

Well since no other method worked as well, i decided to setup a Master => Slave relationship and use database replication. Works like a charm, quite fast, and i can use SSL for data transfer!

Tnx a lot

Sinisa Valentic