Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bigger EC2 instance for notification #1212

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

waisingyiu
Copy link
Contributor

@waisingyiu waisingyiu commented Mar 25, 2024

What does this change?

Editorials reported that they sent a breaking news notification via ed tools but no notifications were received. The notification record was not found on Ophan dashboard either.

After investigation, it was found that the breaking news tool sent a HTTP request to our notification endpoint but received a 503 exception.

The cloudwatch metric (ELB 5xx) for the load balancer of the notification API suggested that a 5xx response had been served from the load balancer at that time. One of the EC2 instances was also terminated due to health check failure around that minute.

We noticed that EC2 instances of notification service failed health check from time to time. The application logs of an unhealthy instance did not show any exception or error message, but the syslog of the OS indicated that there was out-of-memory error on OS process level.

I believe that the JVM of the service ran out of system memory when it was expanding its heap, given that we are using t4g.micro instance which has 1G memory only but the notification service and the AWS kinesis agent have a max heap size of 256M and 512M respectively.

This PR changes the cloudformation stack to use bigger EC2 instance, t4g.small, which has 2G memory.

How to test

I applied this bigger EC2 instance on CODE and the instance has stayed healthy for more than 1 day. It may be good to apply it on PROD too, and see if the problem with instances becoming unhealthy ceases to exist.

How can we measure success?

No instances become unhealthy.

@waisingyiu waisingyiu marked this pull request as ready for review March 26, 2024 16:34
@waisingyiu waisingyiu requested a review from a team as a code owner March 26, 2024 16:34
Copy link
Contributor

@lindseydew lindseydew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice investigation work 👍

@waisingyiu waisingyiu merged commit 2da2b79 into main Mar 26, 2024
11 checks passed
@waisingyiu waisingyiu deleted the LIVE-6381-fix-unhealthy-instance branch March 26, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants