0

Few days ago, we moved our mysql database to another host because of some limitations with our current host. Everything is fine (Seem same performance and speed on our PHP framework based website) except one script that executes a mass update between two tables and excel files. This script would take less than 3 hours to update inventory before(PHP and mysql were hosted on same company). But, same script is taking about 9/10+ hours to update inventory in new database server(that's the only change we made and database is now hosted on another company). I just know that performance can depend on mysql server version too. But, is not that too much? Could I improve that?

codelogn
  • 103
  • 4
  • Do you have the same type of connectivity between the two hosts as you did before? – NickW Jun 21 '13 at 14:16
  • Yes, it is php PDO and mysql. – codelogn Jun 21 '13 at 14:17
  • No, I mean physical connectivity, what makes you think that a long distance connection should run as well as something hosted on the same machine? – NickW Jun 21 '13 at 14:18
  • I do not know. But i just guessed that our website could have slower speed than before since it is totally hosted on another different server. Is that normal? even 3x/4x slower speed? – codelogn Jun 21 '13 at 14:23
  • Considering it's pulling tons of data across the Internet *then* to you, it's normal and expected. That's why you normally have databases and web servers together. – Nathan C Jun 21 '13 at 14:25

1 Answers1

0

If the servers are no longer located together in the same hosting, it is fairly normal that things will be slower. There are things you can do to reduce overhead, like connection pooling, and ensuring that the mysql connection has dedicated bandwidth, but it's doubtful you'll be able to reproduce the sort of speed and bandwidth you had between two machines in a single data center.

The other thing you could try is running the update script entirely on a machine located in the same DC as your MySQL server.

NickW
  • 10,263
  • 1
  • 20
  • 27