Enabling Auto Scaling

38 views
Skip to first unread message

ayhan

unread,
May 29, 2024, 12:57:10 PMMay 29
to Tinode General
Hey Guys,
 As a Cloud Computing Course Project, I ran Tinode in multiple configurations and decided to play with the architecture a little bit to enable autoscaling. What I did was transforming the docker-compose setup into a Google Kubernetes Engine(GKE) managed environment with horizontal pod autoscaling. I managed to ran and also Implemented an IaC on Terraform to deploy the app on GCP with GKE. The problem is even though when I don't enable the autoscaling, (I believe because of the load balancer service sends the users to different instances), Messages sent by other people sometimes seen only when I refresh my connection. But sometimes It can be seen directly when the user sends it. I didn't have much time to examine the implementation but I know sometimes sticky sessions might cause session affinity problems in Auto-scaled workloads. Still, I'd like to remind you that It causes this issue also when autoscaling is not enabled and I thought to myself it should work since it works on a docker-compose cluster. Can you give me any recommendations to handle it. The repository is private for now because the course still is in progress but I will make it public and I want to contribute to the project by making it autoscalable because I really liked your perspective. I will be glad for any kind of recommendations you'll make.

Best Regards,

Gene

unread,
May 29, 2024, 1:06:21 PMMay 29
to Tinode General
Tinode instances are stateful. Automatic autoscaling though GKE is not going to work. You need to reconfigure and restart the cluster to add nodes. Hot expansion of a cluster is currently not supported.

As for 


|  Messages sent by other people sometimes seen only when I refresh my connection.

I have no idea what you are doing and consequently can't suggest anything. Debug it. If you find that the problem is with Tinode, then open an issue:

Thanks.

Gene Sokolov

unread,
May 30, 2024, 2:08:20 PMMay 30
to tin...@googlegroups.com
I think I know why messages are not "coming through". You misconfigured your installation. Some or all the nodes are disjoint. The message is saved to DB but not forwarded to the appropriate node because you failed to configure the cluster. When the session is restarted, the messages are pulled from the DB.

--
You received this message because you are subscribed to the Google Groups "Tinode General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/09746cb8-838f-4048-b068-5179a32e643an%40googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted

ayhan

unread,
May 30, 2024, 7:35:45 PMMay 30
to Tinode General
Hey Gene,

I believe your guess is right, I was also thinking that might be the cause of the issue. I will inspect it after my finals to make it right.
Additionally, I thought to myself If the session info is kept via cookies the L7 Load balancer should be enough to provide hot expansion feature or to enable hpa. 
I may send you the Infrastructure and deployment files after I make the repo public to get deeper advices and play with the code a little bit(or a lot :p) 
in order to contribute this open-source project if you're interested. Thank you so much for your quick responses.

Best Regards,
Ayhan

ayhan

unread,
May 30, 2024, 7:35:47 PMMay 30
to Tinode General
Hey Gene,

I think you might be right, I was thinking the same before posting it. I will take a look at it after the term ends to try fixing it.
Additionally, to enable hot expansion I was thinking keeping the session info via cookies would be sufficient for an L7 Load Balancer.
I will make the repo public, take a deeper look into the subject and play with the code a little bit(or a lot maybe :p).
I may send you the link to the infrastructure and deployment files after the term ends if you'll be interested in giving me further advice. As I stated I really liked this open source project and would like to try to contribute it.
By the way, I might be horribly wrong in this cookie session persistence because I am really new to the topics in general.
But as I stated earlier, I want to deepen my understanding in them. So, I would be glad to hear an explanation or a research recommendation 
if you think they're wrong.

Best Regards, 
Ayhan

On Thursday, May 30, 2024 at 9:08:20 PM UTC+3 Gene wrote:

ayhan

unread,
May 30, 2024, 7:35:50 PMMay 30
to Tinode General
Hey Gene,

I think you might be right, I was thinking the same before posting it. I will take a look at it after the term ends to try fixing it.
Additionally, to enable hot expansion I was thinking keeping the session info via cookies would be sufficient for an L7 Load Balancer.
I will make the repo public, take a deeper look into the subject and play with the code a little bit(or a lot maybe :p).
I may send you the link to the infrastructure and deployment files after the term ends if you'll be interested in giving me further advice. As I stated I really liked this open source project and would like to try to contribute it.
By the way, I might be horribly wrong in this cookie session persistence because I am really new to the topics in general.
But as I stated earlier, I want to deepen my understanding in them. So, I would be glad to hear an explanation or a research recommendation 
if you think they're wrong.

Best Regards, 
Ayhan

On Thursday, May 30, 2024 at 9:08:20 PM UTC+3 Gene wrote:
Reply all
Reply to author
Forward
0 new messages