Search for Well Architected Advice
Optimize software and architecture for asynchronous and scheduled jobs
ID: SUS_SUS3_1
Optimizing software and architecture for asynchronous and scheduled jobs is vital for maximizing resource utilization and minimizing waste. By implementing efficient patterns such as queue-driven systems, organizations can ensure their deployed resources are utilized consistently, resulting in lower carbon footprints and improved resource management.
Best Practices
Adopt Queue-Driven Architectures for Asynchronous Processing
- Leverage message queues and event-driven workflows to decouple components and smooth traffic spikes, improving resource utilization and reducing idle capacity.
- Keep messages small and lightweight to minimize storage and transfer overhead, enabling more efficient use of resources.
Batch and Schedule Resource-Intensive Tasks
- Use scheduled jobs or batch processing for tasks that don’t require real-time execution, allowing you to run activities when resources are most available or energy costs are lower.
- Optimize scheduling to avoid overlapping large tasks, ensuring consistent resource usage rather than fragmented consumption.
Implement Autoscaling for Scheduled Workloads
- Use autoscaling policies triggered by job schedules to provision just enough resources for the workload duration, reducing unnecessary resource usage.
- Review and update scaling policies regularly to match changes in workload demands and maintain efficient utilization.
Monitor and Optimize Long-Running Jobs
- Continuously monitor job performance metrics to identify bottlenecks in code, data, or infrastructure that lead to resource overuse.
- Optimize or refactor resource-intensive components first, as these changes can yield the greatest improvements in overall sustainability.
Questions to ask your team
- Have you designed asynchronous workflows or queue-driven processes to maximize resource utilization and smooth loads?
- Do you use scheduled tasks or time-based events to minimize idle capacity and reduce waste?
- How do you monitor utilization to identify opportunities to consolidate or retire underused components?
- Have you considered batch processing and event-driven architecture to process data in smaller, more efficient increments?
- What strategies are in place to ensure high utilization of deployed resources during asynchronous operations?
- Do you regularly review scheduled tasks and optimize timing to limit idle resources and energy consumption?
- How do you validate and test changes to scheduled or queue-based workloads to avoid resource underutilization?
- Have you documented procedures to iterate on and refine async workflows to reduce overall resource consumption?
Who should be doing this?
Cloud Architect
- Design asynchronous and scheduled job patterns to ensure consistent resource utilization
- Evaluate architecture for opportunities to consolidate underutilized components
- Optimize resource consumption while maintaining performance requirements
DevOps Engineer
- Implement and manage queue-driven systems for efficient processing
- Automate scheduling to align resource usage with demand cycles
- Monitor and adjust configurations to maintain high utilization and reduce waste
Software Developer
- Develop applications that leverage asynchronous workflows to optimize resource usage
- Create modular code that can be easily updated or retired as needed
- Continuously refine code for performance and sustainability improvements
Product Owner
- Prioritize sustainability goals in product roadmaps and feature development
- Collaborate with stakeholders to identify and retire underutilized components
- Drive alignment with sustainability metrics and resource efficiency targets
Systems Engineer
- Maintain infrastructure health to support asynchronous and scheduled workloads
- Identify and eliminate capacity bottlenecks to ensure efficient resource usage
- Collaborate with teams to align architecture changes with sustainability objectives
What evidence shows this is happening in your organization?
- Asynchronous Job Scheduling Policy: Describes a framework for scheduling asynchronous tasks to ensure consistent utilization and reduced resource waste.
- Resource Utilization Dashboard: Provides real-time insights into consumption patterns, highlighting opportunities to optimize usage and reduce idle resources.
- Queue-Driven Architecture Guide: Offers detailed design guidance on queue-based approaches that enhance workload balancing and promote sustainability objectives.
- Scheduled Jobs Checklist: Outlines key steps to effectively implement and manage automated jobs at defined intervals, maximizing resource usage.
- Asynchronous Processing Runbook: Documents procedures for maintaining and troubleshooting asynchronous systems to ensure reliable performance and sustainability.
- Load Smoothing Playbook: Presents strategies for distributing workloads evenly, maintaining steady resource usage and minimizing idle capacity.
- Asynchronous Optimization Matrix: Provides a comparative chart of asynchronous methods and their applicability, helping identify efficient solutions for varying workloads.
Cloud Services
AWS
- Amazon SQS: Provides asynchronous message queuing for managing workloads and smoothing traffic, ensuring consistent resource utilization.
- Amazon EC2 Spot Instances: Leverages spare compute capacity and helps manage costs for scheduled or asynchronous tasks, optimizing utilization.
- AWS Lambda: Runs code only when needed, automatically scales to match load, reducing idle resources for asynchronous or scheduled jobs.
Azure
- Azure Queue Storage: Facilitates decoupling of applications and load smoothing through asynchronous message queues.
- Azure Functions: Serverless compute service that executes code only when triggered, reducing idle resources in asynchronous or scheduled workflows.
- Azure Logic Apps: Allows creation of automated workflows for asynchronous or scheduled tasks with minimal overhead.
Google Cloud Platform
- Pub/Sub: Enables asynchronous messaging and decoupling between system components, helping maintain consistent resource utilization.
- Cloud Functions: Serverless environment that runs code in response to events, reducing idle resources for asynchronous or scheduled tasks.
- Cloud Scheduler: Managed cron job service for scheduling tasks, allowing efficient resource use and automated resource scaling.