Modernizing URL Rewriting Architecture with High Instance Count and Stability Issues

0

Hi Team,

I'm working with a company that's experiencing challenges with their current architecture. Here's the scenario:

Current Setup:

  • 150 individual t2.micro EC2 instances running Nginx as reverse proxies
  • Each instance serves one customer for URL rewriting/shortening
  • Instances distributed across us-east-1 (100) and sa-east-1 (50)
  • Backend application runs on Oracle Cloud (APEX platform)

Main Issues:

  1. Random instance unavailability (15-minute periods)
  2. High costs with public IPs
  3. No effective monitoring/alerting
  4. Manual instance restarts required
  5. Poor observability (Zabbix monitoring fails during outages)

Questions:

  1. What's the recommended approach to modernize this architecture while maintaining URL rewriting capabilities per customer?
  2. Are there any specific patterns or anti-patterns we should consider?

Thanks in advance!

  • How do you identify customers? Do they login? Are you getting the requests over VPN?

AWS
asked 2 months ago56 views
2 Answers
0
Accepted Answer

If it were me (and bear in mind that there are a lot of unanswered questions here) I would be doing the following:

  1. Use a CloudFront distribution per customer.
  2. If possible, do the redirects/rewrites in CloudFront using Lambda@Edge or CloudFront functions.
  3. Don't run t2 instance types. Instead, create an ALB in each region (maybe more than one depending on load) and have a fleet of instances that can all deal with every customer. Use a more appropriate (higher performance) instance type. But less will be required and they can run "hot" rather than having a bunch of smaller instances that are probably running idle or maybe even being overloaded.
  4. (3) will resolve the EIP billing problem.
  5. Make sure (3) uses auto-scaling.
  6. Use CloudWatch Metrics and Logs and Log Insights to try and determine where problems are occuring.
profile pictureAWS
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
profile picture
EXPERT
reviewed 2 months ago
0

Agree with Brettski, however you still have other options as always.

As its NGINX, you can put all the same rules on 1 server NGINX.

  • Create an ALB, with at least 2 EC2s OR ECS Containers running NGINX in a target group.
  • Point all URLS to the ALB
  • The NGINX Hosts still will perform URL rewrites etc.
profile picture
EXPERT
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions