michael Posted May 8, 2018 Posted May 8, 2018 https://thirtybees.com/blog/thirty-bees-scalability/ Great article, thank you for examples. I have a question about technical things: One thing to notice is we did not sync the config directory. The reason for this is because we want the database on the remote server to act as a slave database to that server only, because accessing a slave across a network is just going to cause slowness. We did use the same settings.inc.php from the master server though, we still want the master write database to be seen as the New York City server. In the dbslaveserver.inc.php of both the Singapore and Frankfurt server we have listed the local host database as the slave. This will allow slaved database requests to come from the database on the server, speeding things up. Next what we did was used MySQL replication to replicate the master database from New York City to both of the remote servers. Since we are not getting to technical, one thing I would like to point out is you need to limit your MySQL connections by ip address, you only want known IP addresses to be able to connect to your database. @lesley may you elaborate how you did setup the database? Do you use some panel, like Webmin/Virtualmin or Cpanel or you do it manually? May you send some further details or something to read? Why Cloudflare? not eg. Amazon Route52 or ns1.com? What are benefits? Thank you in advance.
lesley Posted May 9, 2018 Posted May 9, 2018 I set it up manually. I just used Digital Ocean instances with no panel software on them. The reason I used cloudflare is because that is what we use for our DNS at thirty bees, I have not used the other services, so I am not sure if they provide GeoIP load balancing. I know the Digital Ocean load balancers do not. For the replication this is a good article, https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql The reason I did not want to cover it in depth is the security concerns about opening MySQL up to outside connections. You really need to limit the ip addresses that connect and things like that. I just did not want the article to turn into a security article.
michael Posted May 9, 2018 Author Posted May 9, 2018 Do you use any management panels? https://ns1.com/pricing#managed which is free for 0,5 M queries or Amazon which is pay as you go. Thank you for article. I want to implement geoIP and multiple VPS. Regards MySQL just add IP or encrypt the connections, any recommendations?
lesley Posted May 9, 2018 Posted May 9, 2018 On my personal things and thirty bees things we use plesk. If I were going to use a free panel I would likely use the CentOS one, because I prefer Cent on a server. As far as the database, you need to limit the IPS for the MySQL port to just the main server that will be replicating from. I would go against encrypting the connection, because doing that requires you to connect a domain for an ssl cert to be valid. The negotiation time will also add to the replication along with the dns look up. Just using an IP address will be faster.
michael Posted May 15, 2018 Author Posted May 15, 2018 @lesley https://thirtybees.com/developer-blog/installing-thirty-bees-on-digital-ocean/ I saw that you use Apache, what about nginx? Is there any ngix confirm template? May anyone share it with me? Thank you in advance.
lesley Posted May 15, 2018 Posted May 15, 2018 I don't have one. If I run nginx I usually run it as a reverse proxy over apache.
michael Posted May 23, 2018 Author Posted May 23, 2018 Any experience with database clusters? Master-master, multi-master configuration? Galera MariaDB? I am trying use Galera MariaDB but it's so slow or I am doing something wrong.
lesley Posted May 23, 2018 Posted May 23, 2018 Not really, but I would ask, do you have the need? Or is it just something you are playing with?
michael Posted May 24, 2018 Author Posted May 24, 2018 I want to build a cluster multi master, not using slave database. Master, slave is quite easy. I am wondering if I am doing something wrong or the database is not optimized for such solutions. I was using a digital ocean but ever installation of clean TB there is take so long. Had you the same experiences? 1GBram 1CPU, but now I need to increase the resources. I am wondering is someone i using Galera and TB. In presta forum I read yes. @lesly do you use few servers for TB? How you manage it? Master-slaves?
lesley Posted May 24, 2018 Posted May 24, 2018 I honestly have never done it, because the need has never arose. I don't see your use case for using a system like this, other than just sheer wanting to. I am pretty linear in my thinking and the time I spend with doing things. I generally have an end means for doing it.
michael Posted May 24, 2018 Author Posted May 24, 2018 I want to run my TB on few VPS and use geoDNS. One server in Europe, 2 servers in USA, 4th VPS in Asia. I am looking for a solution how to create it. I know master-slave solution which lesley wrote. Is there anyone have experience with this? I am thinking about Galera cluster MariaDB. Is there anyone who use Galera cluster from MariaDB? I have installed it and imported to Galera but it works very slow. I am wondering if someone is using Galera and can advice. I am wondering if Galera is designed only for HA cluster in e.g 2 local VPS/servers or it could be used with VPS which are in different locations/countries. Is there anyone who have TB in few VPS and can share with his knowledge. How to set up, what do you use etc? Thank you in advance.
KD Posted May 25, 2018 Posted May 25, 2018 @michael We had configured Galera cluster in combination with GlusterFS for shared /html folder, it run well if you have it on SSD's. We did not setup on VSP, it was on our local servers. We end up removing this setup, due to auto increment. Galera controls the auto increment for each server in cluster. Issue is all your ID's ( Customer, login or product ) will be generated randomly based on which server is actively writing to database. If you do not care for the random ID numbers, then Galera works well.
michael Posted May 25, 2018 Author Posted May 25, 2018 @KD is there any other solutions which is worth to consider? Maybe other clusters or solutions? Any workaround for auto increment in Galera?
KD Posted May 25, 2018 Posted May 25, 2018 @michael VMware cluster is another solution, but it is not free. I don't think TB or Prestashop has any solution for auto increment. We are too waiting if there is way to separate auto increment only on server level, so that it dose not affect database tables or to any software in use. Some how magento has manage to fix this issue by installing a hot-fix patch.
lesley Posted May 25, 2018 Posted May 25, 2018 Just out of curiosity how big are the shops you are scaling in this manner? Like order volume and things like that.
michael Posted March 6, 2020 Author Posted March 6, 2020 I am sorry @lesley I did not saw that you have answered. I was testing more for tests and SEO. I get more mess then benefits. Like Learn amazon route53, use Letsencrypt and multi servers, some problems with delays. I keep tow separate database but I give extra work to make a double work on BO. Now I want to change it. Sync it maybe try Master-Slave or something else. Have you run for longer time using one database as master and others like slave? Any further info or experiences after few years later after the article https://thirtybees.com/blog/thirty-bees-scalability/ ? What are your performances after few years of using Master Slaves? Any problems, loose of data?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now