euromickey Posted November 25, 2011 Share Posted November 25, 2011 We have a multilingual e-commerce (12 languages) ready to combine into a multi-store system. In order to enhance page load times as well as to benefit from local IP addresses, we need to run the sites on 3 separate server locations across the globe (1 master and 2 slaves). Each store has the same inventory (250 categories, 25.000 products). Question is, will PrestaShop allow a multi-server setup based on MySQL replication? We would love to see this feature in one of the next versions. Link to comment Share on other sites More sharing options...
tuk66 Posted December 1, 2011 Share Posted December 1, 2011 What about XML export and import? Whole database synchronization is not possible. Some data are different - cart, customers, orders, statistics. Link to comment Share on other sites More sharing options...
Trip Posted December 25, 2012 Share Posted December 25, 2012 Anyone managed todo such a setup? MySql replication is to slow as far as I know. Files maybe could be synced with rsync or scp but what is the best way to keep the product stock in sync? Any ideas. Thanks in advance, trip Link to comment Share on other sites More sharing options...
Dh42 Posted December 25, 2012 Share Posted December 25, 2012 Trip, Why not run a dedicated mysql server, different frontend servers and if the need is present off load the media to other servers? Link to comment Share on other sites More sharing options...
Trip Posted December 27, 2012 Share Posted December 27, 2012 (edited) Hi DH42, thanks for your answer. How exactly would you setup such a thing? I have tested a mysql replication setup of the whole database on my localhost which was far to slow. I assume the whole result sets were transmitted between the two hosts and therefore a lot of traffic is generated. The only think I stumbled upon was Federated tables http://en.wikipedia....MySQL_Federated whiche might be worth a shot. From experience I only need to share product and customer(address and so on) tables which I realised with mysql views atm. But this only works if the different installations work on the same host with one db server. Another downside is, that the setup is hard to mantain (e.g. update installation). So if you have other solutions or expirience it would be nice to have new input on howto realize something like that prefomant. Best regards, trip Edited December 27, 2012 by Trip (see edit history) Link to comment Share on other sites More sharing options...
jenifertaler Posted December 27, 2012 Share Posted December 27, 2012 May I get Your website link? Link to comment Share on other sites More sharing options...
Trip Posted December 27, 2012 Share Posted December 27, 2012 Hi there. Look at my signature Link to comment Share on other sites More sharing options...
suenda Posted December 27, 2012 Share Posted December 27, 2012 Well for product stock synchronization you can use webservices. But, it would be slow. Why not have a single site installation and use a CDN ? Link to comment Share on other sites More sharing options...
Dh42 Posted December 28, 2012 Share Posted December 28, 2012 The easiest way that I can think of doing it is to get a couple dedicated servers, one for running mysql and one for your website compiled files. Then I would use something like cloudflare for serving your static files. Running tests on your local machine is close to useless depending on what your machine is. I have a dedicated server, it has 32 cores running at 3.2 ghz 16 gig of ram and high speed sata drives. My work pc is a lot slower and runs a different operating system so its not really a comparison. What kind of traffic numbers and transactions per day are you getting that makes you think you would need something like this? 1 Link to comment Share on other sites More sharing options...
Trip Posted December 28, 2012 Share Posted December 28, 2012 Hi there, thanks for your input. I am already using cloudflare on one of my installations which is performing great e.g. in USA but compared to other websites which are hosted in my case in Thailand there is still remarkable network latency as my server is located in europe. If there is no easy way around I will use cloudflare with country tld to geotarget my websites but if possible I would prefer to host some installations in the targeted contries at least one for europe and one for asia to also profit from the thailand server ip. As I said, the performance of a cloudlare setup is acceptable but not very well compared to servers located in thailand. Another way around might be to just host the static files here on a cheap webspace and keep files in sync with rsync,scp or stuff like that but it would not benefit from a country server ip and still network latency, dns resolving and so on might have negative impact. I think I will start with a simple cloudflare setup but anyway when I was researching the question I and maybe other people are curious how to solve such problems and what is best practise to keep databases in sync over long distance server installations? So some ideas sound good. I think I will have to make more benchmarks to see where exactly the bottlenecks(static files, dns, network latency) are and see if there are possible optimisations. Best regards, Trip Link to comment Share on other sites More sharing options...
Dh42 Posted December 28, 2012 Share Posted December 28, 2012 I think that you are over thinking the problem. You can use dns entries to point servers to your static files. Link to comment Share on other sites More sharing options...
El Patron Posted August 14, 2014 Share Posted August 14, 2014 The easiest way that I can think of doing it is to get a couple dedicated servers, one for running mysql and one for your website compiled files. Then I would use something like cloudflare for serving your static files. Running tests on your local machine is close to useless depending on what your machine is. I have a dedicated server, it has 32 cores running at 3.2 ghz 16 gig of ram and high speed sata drives. My work pc is a lot slower and runs a different operating system so its not really a comparison. What kind of traffic numbers and transactions per day are you getting that makes you think you would need something like this? I ran across this and thought I'd share. it's from rackspace but using cloud servers.. http://www.rackspace.com/knowledge_center/article/mysql-replication-masterslave Link to comment Share on other sites More sharing options...
Trip Posted August 15, 2014 Share Posted August 15, 2014 (edited) Hi El Patron, thanks for the input but I would second Dh42 now. There are lots of possilbilitis like fast DNS service, cdn etc.pp. die reduce latency. Mysql replication is great but I think really for absolute "pros". Afaik a master slave setup is complicated as you would have to take into account that you read the results from the slave but have to write your orders, customers, shopping carts on the master server. Otherwise they will not be present on every slave node. You could use a master-master setup but then you need to use a different autoincrement offsets. If you are using master-slave replication, than most likely you will design your application the way to write to master and read from slave or several slaves. But when you are using master-master replication you are going to read and write to any of master servers. So, in this case the problem with autoincremental indexes will raise. When both servers will have to add a record (different one each server simultaneously) to the same table. Each one will assign them the same index and will try to replicate to the salve, this will create a collision. Simple trick will allow to avoid such collisions on MySQL server. From http://erlycoder.com/43/mysql-master-slave-and-master-master-replication-step-by-step-configuration-instructions- Bottom line.. I think this is far to complicated Greetz, Trip Edited August 15, 2014 by Trip (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted August 15, 2014 Share Posted August 15, 2014 Hi El Patron, thanks for the input but I would second Dh42 now. There are lots of possilbilitis like fast DNS service, cdn etc.pp. die reduce latency. Mysql replication is great but I think really for absolute "pros". Afaik a master slave setup is complicated as you would have to take into account that you read the results from the slave but have to write your orders, customers, shopping carts on the master server. Otherwise they will not be present on every slave node. You could use a master-master setup but then you need to use a different autoincrement offsets. From http://erlycoder.com/43/mysql-master-slave-and-master-master-replication-step-by-step-configuration-instructions- Bottom line.. I think this is far to complicated Greetz, Trip after looking at this, I agree for the most part on legacy host this requires to much access and am surprised thatI did not see a api for hosting control panel.. but I did see how some cloud hosting solves this without having to set up the environment manually. I was hoping for simple solution that might work for smaller business where we run two db's on same sever instead of two servers. for anyone reading this, ps does support the reads on slave and even many modules have coded for it. Link to comment Share on other sites More sharing options...
Dh42 Posted August 15, 2014 Share Posted August 15, 2014 In case anyone wants to read it I finished an article last on on the subject of how to scale PrestaShop up and some of the issues you might face. It talks about using slave replica's and a load balancer and using cache replicas across the network. http://dh42.com/blog/prestashop-scalability/ 1 Link to comment Share on other sites More sharing options...
Trip Posted August 16, 2014 Share Posted August 16, 2014 Nice read DH42 although I would be carefull with the term "concurrent users". Concurrent users without a time frame is not very accurate. Anyway, I don't want to quarrel about that. I am more interested in - you recommend enabling apc in the performance settings. Do you have experience with that on a production server? The last time I've tested that I think I noticed that some values at least in the backend were not updated with APC user variables cache enabled possibly because the values we not flushed after update. Maybe this is fixed now but I did not want to risk it in on my live shop that such things happen. Thanks in advance, Trip Link to comment Share on other sites More sharing options...
Dh42 Posted August 16, 2014 Share Posted August 16, 2014 Concurrent means at once, like that is how many people are actively connected to the site in a session. Like here is a traffic shot of where I get the concurrent from, http://i.imgur.com/rQra1RF.png that, coupled with GA where you can see how many active poeple are on the site. Plus when you are load testing you can pick the number of active browsers viewing the site. As for the APC in production I have not had any issues with it. You can make apc not cache the backend by adjusting the configuration of it. 2 Link to comment Share on other sites More sharing options...
Josele Hernández Posted June 24, 2017 Share Posted June 24, 2017 I don't know if you found any solution for that, in that case please tell us I've found that on the web: https://severalnines.com/blog/how-setup-high-availability-prestashop-multiple-servers-mariadb-galera-cluster Best regards. -- Josele Link to comment Share on other sites More sharing options...
Recommended Posts