Horizontal Scaling

henry beltran2 years ago

Regarding the horizontal scalability of this new version. I have never worked with servers with horizontal scalability, I understand that the common way to improve the performance of a server is to increase the hardware capacity, that is, increase memory, improve the CPU, SSD, etc.
With horizontal scalability I understand that it is something like putting two or more servers in parallel with similar or better capacity, that makes it "without limits".
Now in the specific case of traccar, let's suppose that I have a server1 running with its domain, its ip address and it is with LEGACY WEB, obviously the gps devices are configured to report to this server1, I can configure a server2 with its own ip address and both properly configured to use horizontal scalability mode .
Questions:

  1. Should new GPS devices be configured to report to the server2?
  2. You can login to server2 using the MODERN WEB?
  3. On server 1 and server 2 will be the information of ALL gps devices?.
  4. API services are indifferent to which server the query is made to?
Anton Tananaev2 years ago
  1. You need to use a load balancer.
  2. You should use the same setup on both servers. You shouldn't use legacy app on one server and modern on another.
  3. Information is in the shared database.
  4. Yes.
control taken2 years ago

Adding what Antón says, I have only 1 database on 3 different machines for load balancing using nginx, I have only 1 mysql and the 3 virtual machines where each one has its traccar installation which facilitates, I also recommend that when you configure your gps devices configure it so that they send information by DNS and not by IP so as to avoid complications and that all devices in case of something can connect automatically, this horizontal scaling implementation looks excellent and with nginx you can do it without problems, I also have SSL certificate installed and all is well. And at night I update to 5.4, currently I have 96GPS and they report at 20 seconds ON and 006H OFF and I have 1core 2gb of ram 35SSD and I occupy the total of 60% capacity of the server, it should be noted that I made some optimizations in the virtual machine and it works super well I calculate with this hardware you can have 140gps to start thinking about another one with greater hardware.

control taken2 years ago

https://prnt.sc/4BcZmzXABp5z
It should be noted that I am somewhat new to using traccar, but I have some basic knowledge in configuring virtual machines and the optimization has worked for me without any problem.

Track-trace2 years ago

Hi @control taken

Is it possible that you show how you have done this setup with Nginx?: "I have only 1 database on 3 different machines for load balancing using nginx"

Im very interested.

jesusle4 months ago

Hi @control taken @Track-trace ,

Would you have the settings to share about load balancing? Regards.