Web Host Chat
Bringing Hosts & Customers together since 2001
Home QLinks Members Your Profile Register FAQ's Hosts Only Area SMS Alerts Advertising
User Information
»REGISTER NOW!

Go Back   Web Host Chat > Web Hosting Chat > Dedicated Servers, VPS and Colocation
Reply
 
LinkBack Thread Tools
Old 19th July 2008   #1 (permalink)
New User (5)
Brand New!
Join Date: Jul 2008
Posts: 5
to6y is on a distinguished road
US/UK Problem

hi guys

i run a webshop and my customers are roughly split 50% in us and 50% in uk

currently i have a server in softlayer's dallas dc

however i am considering also getting a uk based server as i would like to speed up load times for my uk customers

the problem i seem to have is that even though i have two websites...shop.com and shop.co.uk, they both read/write to the same mysql database

i hear that if i moved shop.co.uk php files to uk, the website loading time would actually increase as having the php files here and the sql files in the states is a very bad idea...is this true?

i do not want to have two separate databases as i have thousands of products and the time it would take copying back and forwards just wont work for me.

does anybody have a solution for me?...i did consider sql clusters a few months ago (when i last thought about this) but i think back then i decided they werent going to help me...cant remember what the problem with them was!!

any help greatly appreciated

many thanks
__________________
Registered User
to6y is offline   Reply With Quote
Old 20th July 2008   #2 (permalink)
I am Staff at
M8 INTERNET
About My Company!

Certified Host
Join Date: Apr 2008
Location: Cumbernauld, Scotland, UK
Posts: 66
M8INTERNET is on a distinguished road
You can read/write to one MySQL database
Firstly you need the IP address of the server using the MySQL database
On the remote server, in config file replace "localhost" with the IP address
Works fine for me
__________________
m8internet.com
__________________
Web Host - Certified Member
M8INTERNET is offline   Reply With Quote
Old 20th July 2008   #3 (permalink)
New User (5)
Brand New!
Join Date: Jul 2008
Posts: 5
to6y is on a distinguished road
recognise that is it possible to read/write to database on different server

i am told though that having php here (uk) and sql there (us) is slower than having both php and sql there
__________________
Registered User
to6y is offline   Reply With Quote
Old 20th July 2008   #4 (permalink)
othellotech's Avatar
Join Date: Mar 2002
Location: London, United Kingdom
Age: 38
Posts: 4,254
othellotech is on a distinguished road
Quote:
Originally Posted by to6y View Post
i am told though that having php here (uk) and sql there (us) is slower than having both php and sql there
It depends on how well written the code is and how many queries needed to generate the page, but no, in general it will be quicker.
__________________
Rob Golding, Othello Technology Systems Ltd AS29527 Company#03894981 VAT#GB-782561410. T:0871 277 6875 F:0871 277 6875
domains email forwarding resellers ecommerce colocation rackspace ip transit secondary mx/dns datacentre ih online/offsite backup
* OthelloHosts.net CPanel/WHM, H-Sphere, Plesk, Ensim, DirectAdmin High-Availability Professional Email / Web Hosting
* OthelloVPS.net Managed Xen4 Enterprise Virtual Private Servers and Dedicated Servers
# Currently buying 123-reg, ukreg, heart-internet and enom domain resellers - www.hostacquisitions.co.uk
__________________
Web Host - VIP Member
othellotech is online now   Reply With Quote
Old 20th July 2008   #5 (permalink)
I am Staff at
Pipe Ten Ltd
About My Company!

Basic Host
Join Date: Jun 2007
Posts: 28
pipeten is on a distinguished road
operating your database and web nodes without replication, security or optimisation in geographically diverse location?!?

you could consider (at this early stage):
sort out a secure tunnel between your sites.
then create a copy of the database to the secondary site.
modify the administration and front-end sql updates and inserts to both sites.
setup rsync between the two web nodes for web data.
modify all sql selects to use the local database (with optional failover off-site).

if you're not keeping your UK customers exclusively on the .co.uk then you'll need to look at geolocation on either the code or dns level.

cdn for images and other media could also be an option.

alot of it depends on how far you want to take it. obviously you need the web node local to take proper advantage of localised search results.

irrespective, to have an e-commerce shop with PHP in one location and SQL in another and no security wrapper is crazy talk
__________________
Web Host (Standard Member)
pipeten is offline   Reply With Quote
Old 20th July 2008   #6 (permalink)
Join Date: Nov 2005
Location: EC1
Age: 27
Posts: 611
goscombtech is on a distinguished road
Quote:
Originally Posted by pipeten View Post
modify the administration and front-end sql updates and inserts to both sites.
setup rsync between the two web nodes for web data.
modify all sql selects to use the local database (with optional failover off-site).
why? Just use NDBCluster... its what its there for. If you are not doing a lot of writes you could even set up a master/master replication system.
__________________
Goscomb Technologies Limited - www.goscomb.net / AS39326

E: sales@goscomb.net P: +44 (0) 203 129 4400 F: +44 (0) 203 129 4410

Free IPv4/IPv6 Dialup! p: 08456043047 u: dial@goscomb.net.uk p: dial
IP Transit :: Colocation :: Dedicated Servers :: Leased Lines :: DSL
Registered in England and Wales No. 05672987 - VAT Registration No. 853 7954 80
__________________
Web Host - Certified Member
goscombtech is online now   Reply With Quote
Old 20th July 2008   #7 (permalink)
I am Staff at
8086 Limited
About My Company!

Certified Host
BurtyB's Avatar
Join Date: Apr 2004
Location: Newark, UK
Posts: 796
BurtyB is an unknown quantity at this point
I have a mysql master-master setup for a clients sites across UK/US servers and it works well for them. I also rsync the html/php/etc files between the servers to allow us to move the sites between the servers if needed.

In my tests running mysql in the US and querying from the UK does harm the sites performance even if it only does a couple of queries you might be looking at a an extra ~150ms which quickly adds up if you need to do a fair few queries to create a page.

ChrisB.
__________________
Chris Burton
8086 Limited (Company No.: 06336617 VAT No.: 920 5102 75)
Ever wanted to know who uses a DNS or MX server ? with DNS History you can find out.
__________________
Web Host - Certified Member
BurtyB is offline   Reply With Quote
Old 20th July 2008   #8 (permalink)
I am Staff at
Pipe Ten Ltd
About My Company!

Basic Host
Join Date: Jun 2007
Posts: 28
pipeten is on a distinguished road
Quote:
Originally Posted by goscombtech View Post
why? Just use NDBCluster... its what its there for
Because the OP gave the impression that he'd tried/considered clustering already and requested alternate solutions?

Quote:
i did consider sql clusters a few months ago (when i last thought about this) but i think back then i decided they werent going to help me
__________________
Web Host (Standard Member)
pipeten is offline   Reply With Quote
Old 20th July 2008   #9 (permalink)
I am Staff at
Dwebs Ltd
About My Company!


Certified Host
Dhosting's Avatar
Join Date: Jan 2006
Location: Blackpool
Age: 20
Posts: 1,261
Dhosting is on a distinguished road
I'd go with Master to Master replication works very well even on windows
__________________
Chris Daley
Dwebs Ltd :: Company No. 05603664 :: 08000 141 942
www.Dhosting.co.uk - Web Hosting, Managed Servers
www.Dwebs.ltd.uk - Web Design & Other Services

My views are my own and not those of my company.
__________________
Web Host - VIP Member
Dhosting is online now   Reply With Quote
Old 20th July 2008   #10 (permalink)
Trusted User (393)
Platinum User
Join Date: Jun 2006
Posts: 384
burble is on a distinguished road
A simple first step would be to shift your media (css, js, images etc) off onto a subdomain, then get a server in the uk to serve the media.shop.co.uk, leaving the www.shop.co.uk pointing at the PHP and DB in the US.

As I imagine most of the download time will be on the media content rather than the page itself, it should help boost performance for UK visitors. This way you'll also have a foot in the UK hosting market, which will let you do real-world performance tests to find your best option for serving your PHP from the uk server too.
__________________
Registered User
burble is offline   Reply With Quote
Old 21st July 2008   #11 (permalink)
I am Staff at
Mooharr
About My Company!


Certified Host
Join Date: Jun 2003
Posts: 1,695
JamesSykes is on a distinguished road
As above, if you split your media files that will speed up the site for your UK visitors.

Also, assuming you have a good connection between your UK DC and your US DC you could run with a single sql as long as you dont have a huge number of queries going on.
__________________
Mooharr
E-Mail Hosting Services

These are not my views and i cannot be held accountable for anything he says.
__________________
Web Host - VIP Member
JamesSykes is offline   Reply With Quote
Old 21st July 2008   #12 (permalink)
New User (5)
Brand New!
Join Date: Jul 2008
Posts: 5
to6y is on a distinguished road
thanks guys for all your comments....

my plan is:
1. more media files to uk
2. run tests to see effect of moving php to uk and leaving sql in us
3. if 2 is no good, will research more into setting up sql cluster

i have done no specific research but i seem to have 2 problems to do with page loading:
a. currently "background" page loads in 1 second, then images load for next 10 seconds
b. for normal browsing of site, everything is fine but after customers adds to cart then checkout each page after that has a noticible slow down...perhaps due to https, perhaps due to move sql queries (work out what shipping should be, write to database, check stock levels etc)

anyway, i guess...
...problem a will be solved by doing 1
...problem b will be solved by doing 2 and/or 3

THANKS AGAIN FOR ALL REPLIES VERY HELPFUL
__________________
Registered User
to6y is offline   Reply With Quote
Old 21st July 2008   #13 (permalink)
I am Staff at
Dwebs Ltd
About My Company!


Certified Host
Dhosting's Avatar
Join Date: Jan 2006
Location: Blackpool
Age: 20
Posts: 1,261
Dhosting is on a distinguished road
Quote:
Originally Posted by to6y View Post
b. for normal browsing of site, everything is fine but after customers adds to cart then checkout each page after that has a noticible slow down...perhaps due to https, perhaps due to move sql queries (work out what shipping should be, write to database, check stock levels etc)
Sounds like poor code either php or sql.

Check the mysql server load when your using those pages.
__________________
Chris Daley
Dwebs Ltd :: Company No. 05603664 :: 08000 141 942
www.Dhosting.co.uk - Web Hosting, Managed Servers
www.Dwebs.ltd.uk - Web Design & Other Services

My views are my own and not those of my company.
__________________
Web Host - VIP Member
Dhosting is online now   Reply With Quote
Old 21st July 2008   #14 (permalink)
New User (5)
Brand New!
Join Date: Jul 2008
Posts: 5
to6y is on a distinguished road
again, i think you have hit the nail on the head...

during day when server does nothing other than run website all is fine (server load 0.5-1.0), at night when server is backing up and running website the load on server increases...obviously mainly due to the backup BUT server guys say that we notice server load more at night due to our shop database being too large! we are no amazon so this database is not large...currently about 150 MiB (if that means anything to anybody)

when i speak to php guys about server load/checkout speed, they say:
1. that we already have a cron that automatically optimises database weekly
2. they are continuously changing/improving code so i guess number of read/write requests will be changed/improved...HOWEVER...they say that we have very old/messy code hacked together over years of work and to see any noticible changes we would have to rewrite everything from scratch...which would take them at least a year!!

as i am way to tight to pay them to re-write everythig again, i guess i will just have to get some more ram!!
__________________
Registered User
to6y is offline   Reply With Quote
Old 21st July 2008   #15 (permalink)
I am Staff at
Dwebs Ltd
About My Company!


Certified Host
Dhosting's Avatar
Join Date: Jan 2006
Location: Blackpool
Age: 20
Posts: 1,261
Dhosting is on a distinguished road
Enable the mysql slow query log.

It will output the queries that take a long time.

Also what PHP version are you using, i would hope 5.2?
__________________
Chris Daley
Dwebs Ltd :: Company No. 05603664 :: 08000 141 942
www.Dhosting.co.uk - Web Hosting, Managed Servers
www.Dwebs.ltd.uk - Web Design & Other Services

My views are my own and not those of my company.
__________________
Web Host - VIP Member
Dhosting is online now   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php - Mysql Problem andyb28 Business and Technical Advice 5 17th April 2008 11:32 AM
Problem login nelsco General Chit Chat & Discussion 9 7th May 2007 11:00 AM
Hosting in the US - a problem? Stevio Discuss a hosting company 15 21st February 2007 01:00 AM


Some great companies!


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0