I manage a Ubuntu 16 server (running a public website), on AWS EC2 infrastructure.
The site has a number of fairly intense, and regular background tasks (via cron) to do, and it's running the risk of overloading current resources and therefore affecting end users / public.
The database is hosted on AWS RDS.
I'm unsure whether to:
- Simply increase the resources available on the single EC2 (it's currently a t2.small, so really very little resources)
- Launch a separate server, solely for the background tasks, so any lag a background task may cause on the server won't affect end-users (the database is on RDS so would be a pretty easy setup)
I thought about setting up AWS Load Balancing and Auto Scaling but came across two issues:
- Scaling can take 60 seconds plus, so the end-users will still experience potential lag
- All servers in the autoscaling group will be the same, therefore all running their own instances of the regular background tasks, resulting in potential double-ups, and more importantly, each server won't be better off as each is still doing what a single is asked of.
I am leaning towards a separate server for the tasks, as it means if that falls over (or lags), end-users aren't affected at all, and it seems a 'tidy' option, but is a bit more admin and setup. Cost of having a second server isn't an issue.
So my question is really, what do you think is best, and why? And am I missing a better idea?
(NB improving the efficiency of the background tasks isn't an option!)
Thanks in advance Rob
0 Answers