Skip to main content

How can I monitor, understand, and optimize Workload Unit (WU) consumption in Bubble?

Sofia Maconi avatar
Written by Sofia Maconi
Updated over a week ago

How to Monitor, Understand, and Optimize Workload Unit (WU) Consumption in Bubble

When working with Bubble apps, understanding and managing Workload Unit (WU) consumption is crucial for maintaining optimal performance and cost efficiency, especially for apps with large user bases or high traffic. This article discusses the key concepts, tools, and strategies for monitoring, understanding, and optimizing WU usage.

What Actions Contribute to WU Consumption?

WU consumption in Bubble occurs from server-side activities, including:

  • Running workflows

  • Performing database operations

  • Making API calls

Note: Client-side actions, such as filtering data within custom states or performing operations in the browser, do not consume WUs. Activities performed in the editor also do not consume WUs, except for bulk operations and data import/export.

Tools and Techniques to Monitor Workload Consumption

Bubble offers several in-app tools to help you monitor and analyze WU consumption, ensuring that you can efficiently track resources:

  1. App Metrics Tab - This provides detailed charts and metrics on workload usage over time and allows you to identify trends in resource consumption. - Navigate to Settings > App plan to view overall WU usage and limits.

  2. Usage Logs - Available in the "Logs > Usage" section, this tool breaks down WU usage by workflow, data type, and specific actions, helping you pinpoint resource-intensive areas.

  3. Documentation - Bubble’s Workload Management Documentation contains detailed guidelines on analyzing WU data effectively.6. Logs Tab - The Logs tab provides operational insights that complement the App Metrics Dashboard. While not specific to WU consumption, it aids in analyzing app performance and resource usage trends.

  4. App Metrics Dashboard Features - The App Metrics dashboard provides an enhanced view with features like: - Drill-down capabilities to analyze specific actions and expressions. - Visualizations such as bar charts and pie charts to clarify consumption patterns. - Breakdown of workload usage for Development and Live environments over the last 30 days.

  5. Invoices - While Bubble doesn't provide a direct total of monthly WU usage, you can estimate this by reviewing your invoices. Add the total WUs included in your app’s plan and any overage charges for an accurate calculation.

By consistently monitoring, you can tie resource-heavy workflows directly to app performance metrics and make data-driven decisions.

Strategies to Reduce WU Consumption

Here are actionable strategies to optimize WU usage in Bubble:

  1. Optimize Workflows - Remove redundant or unnecessary actions from workflows. - Use the "Terminate this workflow" action to cut short processes under specific conditions.

  2. Combine Actions - Consolidate multiple workflow tasks into fewer actions where feasible to minimize executions.

  3. Efficient List Operations - When working with lists, use options like "Make changes to a list of things" or "Delete a list of things"—these actions are less resource-intensive than scheduling API workflows for lists or using recursive workflows.

  4. Minimize Advanced Filtering - Avoid server-side advanced filtering on large datasets. Instead, use search constraints to limit data retrieved directly from the database.

  5. Client-Side Filtering - Load data into custom states for filtering on the client side, reducing server workload and WU consumption.

  6. Handle High-Traffic Scenarios - For applications experiencing heavy traffic (e.g., 100,000 daily views), focus on: - Keeping server-side searches lean with effective data constraints. - Minimizing recursive workflows and server filtering. Remember, total WU usage depends on the volume and complexity of server-processed data rather than the number of search constraints.### Workload Consumption for Backend/API Workflows Workload consumption for API workflows, including database operations and triggered events, varies based on workflow complexity. Key factors influencing consumption include:

  • Limit Resource-Intensive Searches: Avoid using aggregate or filtered searches unnecessarily. For static data or data that seldom changes, perform searches once during page load, store the results in custom states, and use client-side filtering or sorting for subsequent operations.

  • Distribute Workflow Execution: Schedule backend workflows at staggered intervals to prevent simultaneous execution, thereby reducing server spikes and CPU usage.

  • Avoid Nested Searches: Simplify workflows by restructuring your database to avoid multiple nested searches. For example, storing related data in higher-level tables can eliminate unnecessary inner searches in backend calls.

  • Run Searches at Higher Levels: Store results of complex inner searches in accessible database locations. This enables workflows to query summaries instead of recalculating data repeatedly.

  • Workflow Runs: Scheduling and executing workflows depend on the intricate actions and conditions being processed.

  • Database Operations: Actions like direct updates and creating triggers add to consumption metrics.

  • Triggered Events: Extensive checks or complex triggers can lead to high resource utilization.

  • Cancel Runaway Workflows: Use the Logs → Scheduler to pause or cancel scheduled workflows causing high server usage, ensuring no new tasks get triggered unnecessarily.

  • Strengthen API Workflow Conditions: Add strict conditions in backend workflows to avoid infinite loops and unnecessary re-executions.

  • Set Up Alerts: Leverage in-editor notifications or email alerts for prompt action on workload spikes.

Optimization Tips:

  • Use combined or reduced database triggers to avoid overhead.

  • Simplify workflows by emphasizing essential logic and actions. By addressing these, substantial WU savings can be achieved.

Planning WU Costs for Large-Scale Applications

For large-scale applications or during the planning phase, consider the following steps:

  • Map User Actions: Estimate the WU costs based on Bubble’s documentation and user activity frequency.

  • Pilot Testing: Validate estimated WU usage against logs from initial pilot runs.

  • Forums and Best Practices: Leverage experiences shared by the Bubble community in forums and review best practices for optimization

Minimizing Unwanted Traffic Impact

Traffic from web crawlers can unnecessarily consume Workload Units (WUs). To prevent this, you can:

  • Block Crawlers with robots.txt: Use a robots.txt file in the SEO settings to disallow crawlers from indexing specific pages. This measure can significantly reduce workload usage from crawler activity.

Related Topics

With these strategies, tools, and insights, you can effectively monitor, understand, and optimize your Bubble app’s Workload Unit consumption to ensure cost efficiency and high performance.

Did this answer your question?