Limitation of server for scalability

manish8 years ago

What are the limitations of server for scale-ability ? or How can I scale the server to support unlimited concurrent connections ?

Current how many concurrent connections does it support with/without scaling ?

Anton Tananaev8 years ago

Traccar has been tested with 100k+ devices.

If you want to scale more than that, I guess you should run several server instances.

manish8 years ago

Can you please share what load/stress testing tool/environment did you use ? Can I replicate the same at my end ? what is process to do so ?

What changes do I need to make in Traccar server to scale for more than 100K+ devices ? or would you be able to give me some pointers that how can I configure several server instances with Traccar server to scale for more than 100K+ devices say for 1M devices ?

Anton Tananaev8 years ago

There is a script that you can use for performance testing:

https://github.com/tananaev/traccar/blob/master/tools/test-performance.py

I think it was a 32GB server with 8 cores, or something similar to that.

The bottleneck was database, so the thing you need to scale is the database. Traccar server itself can handle much more.

manish8 years ago

Ok, so you mean we can use the given python script to simulate as many devices TCP clients as we want that will connect concurrently.
Does this script pretend same device or different devices ?
How database insert part is tested for different devices along with Traccar TCP listener ?

Can you please share the testing results of testing done with 100K+ devices ?
How are you handling database bottleneck for 100K+ devices ?
How can I scale database at my end ?
If I scale database more much more concurrent connections more than 100K+ Traccar can support ?
How did you benchmark/profile rest of parts of the Traccar solution that how much load/stress each part can take ?
How many concurrent connections can I test with 2GB server with dual core ?

Can I perform load/stress testing on one of the demo servers (https://www.traccar.org/demo-server/) for 100K+ devices ?

Anton Tananaev8 years ago

This script just sends same message over and over. It can create as many concurrent connection as you want.

As far as I remember, with 100k devices we managed to handle about 8k messages per second. Best results were with MySQL database. PostgreSQL was much slower with about 1-2k messages per second.

I haven't done any testing without database, but my guess is that with proper connection it can handle up to 1M connections. Not sure about more than that.

With 2GB server I don't think you can expect to handle more than 10k devices, but it also depends on frequency or reporting.

Please don't perform any load testing on demo servers!!! They are overloaded already as it is.

manish8 years ago

What changes do I need to make in Traccar server to scale for more than 100K+ devices ?
or would you be able to give me some pointers that how can I configure several server instances with Traccar server to scale for more than 100K+ devices say for 1M devices ?

Does this script pretend same device or different devices ?
How database insert part is tested for different devices along with Traccar TCP listener ?
Were you sending same message over and over from same device or different devices ?

How are you handling database bottleneck for 100K+ devices ?
How can I scale database at my end ?
If I scale database more much more concurrent connections more than 100K+ Traccar can support ?
How did you benchmark/profile rest of parts of the Traccar solution that how much load/stress each part can take ?

Anton Tananaev8 years ago

That's too many questions. I haven't done much performance testing myself. I would recommend you to get a VPS and start testing yourself if you want any specific numbers and answers.

Why do you need so many devices? I'm sure there will be no single user with more than 100k devices. If that's the case, then horizontal scaling is the answer.

manish8 years ago

I have users with bulk devices that may add upto 1M in future thats why I want to test for that many devices.

Its ok that there will be no single user with more than 100K devices but what if multiple users all devices add up 100K ? you mean if every user have less than 100K devices then they can be served by horizontal scaling and if devices per user are more than 100K then even horizontal scaling can also not work, in that case what will be next step solution for scaling (vertical scaling ? ) ?

Do I really need VPS to test that many devices ?

I want to consider Traccar for Enterprise level solution and for that I need to test it very keenly for every aspect. I am ready to contribute my efforts in this to make this solution more robust and scale-able if it has got some of the features for good tracking solution. so I am seeking some help to prepare test environment for testing it in all aspects.

Anton Tananaev8 years ago

VPS is easy because you can quickly test different hardware configurations and see how they handle load.

As I said, I don't really have specific number, but I'm happy to help with performance testing.

renaud8 years ago

If you have users which have more than 100K concurrent devices, it might be worth dedicating them a whole server. That's what Anton meant by horizontal scaling. You can scale horizontally further by putting more than 1 server per user, but then, their devices will need to be configured with different IPs.

manish8 years ago

I mean I don't have single user having 100K devices, I have multiple several users having all devices that sums up 100K devices, so do I need to keep limit 1 server upto no. of users that adds up 100K devices and then move more users to different server ?

Anton Tananaev8 years ago

Yes, that's what I meant. You fill up a server up to 100k (or whatever the limit is), and then deploy next server.

There is no strict limit. Maybe you can make 200k devices work on one server, not 100k.

jaimzj8 years ago

@tananaev Would you be able to help me with performance testing? I can setup a server (VPS) where I want to test how much load the VPS Can take, and try to scale up to the maximum possible using traccar on vpsdime.

Is there a easy, no programmer doable way to do performance testing using that script?

Anton Tananaev8 years ago

You don't need to be a programmer to use that script. If you open the file, you will see a few parameters:

host = 'localhost' - this is server ip address or domain name
port = 5027 - this is port (this script sends Teltonika messages)
devices = 100 - number of devices to emulate
period = 1 - frequency of messages from devices (in this case every second)

Adjust those parameters and run the script from command line. That's pretty much it.

Note that if you want to emulate more than ~60k devices, you might need to have a separate IP address for each instance of the script. Basically run it from different machines. So, to emulate 100k, you can have 2 machines running the script and each would have 50k devices.