FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

4167 questions

4739 answers

3460 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
420 views
in Vehicle tracking by
Hello !

Firstly, I want to say that I ask this question because I am curious...and I think for later also, so I have no urgent needs for the moment.

I have created a Java server to support Teltonika trackers. For the moment, it seems to works well for my tests.
One tracker is connected to one single port and create one thread. (also, I don't know if creating a lot of threads is a good idea...).

However, I have read on some forums that I can't connect more than 65536 trackers (clients). For the moment, I am far of this number.

Is it true ?

Also, if "yes", is it possible to redirect a tracker on an other server, like a load balancing method ? Because we have to assign an IP and port to the tracker.

So to sum up, I am thinking about the scalability of my server and how works the other servers to take huge amount of trackers.

I am sorry to ask this type of question.

Thanks a lot for your help,
Sincerely.

1 Answer

0 votes
by
Use a load balancer + multiple servers. The units will connect to a single IP address managed by the balancer, and it will distribute connections to your servers. This way is a lot easier to manage and scale.

There are services offered by AWS or GCP for this. Alternatively you can roll your own, can use HAProxy, for example.

Also, using a thread per connection does not scale that well, as each thread allocates a lot of RAM for its stack and context switching. And you are right, there is a limit to the number of simultaneous connection to a machine. This depends on the OS used.
by
Hello !

Thanks for your answer.

I will look at HAProxy.

So, in fact, I have to configure this software and after, I "just" have to change the destination IP and port inside the tracker ? So when I have to send an ACK to the tracker, it will pass through the load balancer (HAProxy) again.
Like...
Tracker -> HAProxy -> Server
Server -> HAProxy -> Tracker

So, HAProxy should do "all" the work without a lot of modifications to my Java server, no ?

In order to avoid threads, I have seen asynchronous functions. But it seems to be complicated to read/maintain.
And for Java, there is Project Loom with Fibers (little threads) which is being developed.
So, I don't no if there is "simples" alternatives for the moment.

Thanks for your help !
I will try to learn more about this.