Why is my AWS EC2 instance hanging before responding, except in Safari?

0
8
Asked By TechieLlama57 On

Hey everyone! I'm facing a puzzling issue with my AWS EC2 instance that I hope someone can help me with. Here's the deal: I have a t3.medium instance (2 vCPUs, 4GB RAM) running Ubuntu 24.04 and Apache 2.4.58. I'm relatively new to AWS, so I might be missing something important.

Whenever I try accessing files on my server, it often takes about 60 seconds before anything shows up. After that, everything runs quickly, but then the long delay returns. I've tested this across different browsers and internet connections, and the problem persists. Oddly enough, I've found that when I use Safari—both desktop and mobile—I don't encounter this issue at all!

This all seemed to start happening after I switched from a t2.large instance (8GB RAM) to the current t3.medium instance. I haven't noticed any warnings in AWS's status monitoring, and it looks like I'm only using a fraction of my memory. I'd appreciate any insights or advice on how to troubleshoot this. Thanks a lot!

1 Answer

Answered By CloudyGuru99 On

It sounds like your delay might be related to DNS resolution issues your server is trying to resolve for each client connection. Also, switching to a t3.medium with less RAM might contribute to the slowdown, especially since t-series instances are 'burstable' and use a credit system for CPU performance. If your workload is spiking, you might be running out of CPU credits temporarily, leading to those hangs.

One effective test could be switching back to the t2.large instance and seeing if the problem persists. If that clears up the delays, you’ve likely pinpointed the resource issue. Just remember, the default AWS monitoring doesn’t fully capture memory usage unless you set up a CloudWatch agent, so you're not getting the complete picture without that configuration.

TechieLlama57 -

Thanks for the tips! I'll definitely try switching back to the t2.large and see if that resolves the issue. I just find it odd that it runs smoothly in Safari but not in other browsers.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.