DEV Community

Cover image for Oracle Cloud Infrastructure: Compartment Quotas and Service Limits Management
Ryan Giggs
Ryan Giggs

Posted on

Oracle Cloud Infrastructure: Compartment Quotas and Service Limits Management

Oracle Cloud Infrastructure provides powerful resource management capabilities through service limits and compartment quotas, enabling organizations to control consumption, manage costs, and ensure resource availability across their cloud deployments. Understanding these mechanisms is essential for effective cloud governance and financial management.

Understanding Service Limits

What are Service Limits?

Service limits are resource allowances that limit what resources you can use in your tenancy. They are established when you create your tenancy, but can be changed on request.

Key Characteristics:

  • Oracle-Defined: Service limits are set by Oracle based on your subscription
  • Tenancy-Wide: Apply across your entire OCI tenancy
  • May Change Automatically: Can be adjusted based on subscription changes or upgrades
  • Request-Based Modification: Can be increased by submitting service limit increase requests

Service Limit Scope:

  • Per Availability Domain: Some limits apply to individual availability domains
  • Per Region: Other limits apply to entire regions
  • Per Tenancy: Global limits apply across all regions
  • Resource-Specific: Some limits are specific to individual resources (e.g., one NAT Gateway per VCN)

Purpose of Service Limits

Cost Protection:
Protect you from unplanned surges in consumption and cost by ensuring your users can only use the amount of resources you have predefined.

Resource Availability:
Inform Oracle of the resources you need to run your workload so those resources are always available to you.

Capacity Management:
Help Oracle plan and provision infrastructure capacity based on customer requirements.

Understanding Compartment Quotas

What are Compartment Quotas?

Compartment quotas are policies that allow administrators to allocate resources to specific compartments with a high level of flexibility. Similar to service limits, the biggest difference is that service limits are set by Oracle, and compartment quotas are set by customer administrators using policy statements.

Key Characteristics:

  • Customer-Controlled: Administrators define and manage quotas
  • Flexible Allocation: High level of flexibility in resource distribution
  • Policy-Based: Set using declarative policy statements
  • Compartment-Specific: Apply to individual compartments or compartment hierarchies

Service Limits vs. Compartment Quotas

Service Limits:

  • Set by Oracle based on your subscription
  • Apply at tenancy or regional level
  • Require support requests to modify
  • Define maximum capacity available

Compartment Quotas:

  • Set by customer administrators
  • Apply at compartment level
  • Modified through policy statements
  • Define resource allocation within available service limits

Relationship:
Compartment quotas cannot exceed service limits—they subdivide available capacity within the limits Oracle has set for your tenancy.

Compartment Fundamentals

What are Compartments?

Compartments help you organize and isolate your cloud resources, providing logical containers for grouping and managing OCI resources.

Compartment Hierarchy:

  • Root Compartment: Your tenancy is the root compartment
  • Nested Structure: Compartments can go six levels deep
  • Policy Inheritance: Child compartments inherit policies from parent compartments
  • Organizational Flexibility: Structure compartments by department, environment, project, or any organizational need

Compartment Use Cases

Organizational Structure:

  • Separate compartments for different business units
  • Development, testing, and production environments
  • Project-based resource isolation
  • Geographic or regional separation

Access Control:

  • Role-based access through IAM policies
  • Separation of duties across teams
  • Fine-grained resource permissions
  • Audit and compliance boundaries

Cost Management:

  • Cost center allocation and tracking
  • Budget management per compartment
  • Chargeback and showback reporting
  • Resource usage monitoring

Quota Policy Statements

Three Types of Quota Policies

Compartment quotas are set using policy statements written in a simple declarative language that is similar to the IAM policy language.

1. SET Statement:
Sets the maximum number of a cloud resource that can be used for a compartment.

Syntax:

set <service-family> quota <quota-name> to <value> in compartment <compartment-name>
Enter fullscreen mode Exit fullscreen mode

Example:

set compute-core quota standard-e4-core-count to 240 in compartment MyCompartment
Enter fullscreen mode Exit fullscreen mode

This limits the MyCompartment to using a maximum of 240 OCPUs for Standard.E4 compute shapes.

2. UNSET Statement:
Resets quotas back to the default service limits, removing any custom restrictions.

Syntax:

unset <service-family> quota <quota-name> in compartment <compartment-name>
Enter fullscreen mode Exit fullscreen mode

Example:

unset database quota atp-dedicated-ecpu-count in tenancy
Enter fullscreen mode Exit fullscreen mode

This removes any custom quota limits for ATP dedicated ECPUs, reverting to service limits.

3. ZERO Statement:
Removes access to a cloud resource for a compartment, completely blocking resource usage.

Syntax:

zero <service-family> quotas in compartment <compartment-name>
Enter fullscreen mode Exit fullscreen mode

Example:

zero email-delivery quotas in compartment TestCompartment
Enter fullscreen mode Exit fullscreen mode

This prevents any email delivery service usage in TestCompartment.

Quota Scope Options

Quotas can have different scopes depending on the resource type and administrative requirements:

Availability Domain Scope:
Quota applies to a specific availability domain within a region.

Example:

set compute-core quota standard-e4-core-count to 240 in compartment MyCompartment where request.ad = 'US-ASHBURN-AD-1'
Enter fullscreen mode Exit fullscreen mode

Regional Scope:
Quota applies to a specific region.

Example:

set compute-core quota standard-e4-core-count to 240 in compartment MyCompartment where request.region = 'us-phoenix-1'
Enter fullscreen mode Exit fullscreen mode

Global/Tenancy Scope:
Quota applies across all regions and availability domains.

Example:

set compute-core quota standard2-core-count to 240 in tenancy
Enter fullscreen mode Exit fullscreen mode

Important Note: When setting a quota with availability domain scope without specifying a specific AD, the quota is allocated to EACH availability domain.

Fleet Administrator Role in Dedicated Infrastructure

Dedicated Infrastructure Management

In Autonomous Database Dedicated Infrastructure deployments, fleet administrators manage both service limits and compartment quotas.

Fleet Administrator Responsibilities:

  • Service Limit Management: Request and track service limit increases
  • Quota Policy Creation: Define and implement compartment quotas
  • Capacity Planning: Monitor usage and plan for growth
  • Budget Management: Control costs through quota allocation
  • Resource Distribution: Allocate resources across compartments

Dedicated Infrastructure Quotas:
Fleet administrators can set quotas for:

  • ECPUs for Autonomous Data Warehouse (ADW) dedicated deployments
  • ECPUs for Autonomous Transaction Processing (ATP) dedicated deployments
  • Total data storage for dedicated autonomous databases
  • Autonomous VM Clusters (AVMC)
  • Autonomous Container Databases (ACD)

Viewing Limits, Quotas, and Usage

Cloud Console Access

Navigation:
Tenancy limits, quotas, and usage can be viewed using the Oracle Cloud Console.

Access Path:

  1. Navigate to Governance & Administration
  2. Under Tenancy Management, select Limits, Quotas and Usage

Console Features:

  • View current service limits for all services
  • Monitor resource usage against limits
  • Track quota policies and their impact
  • Request service limit increases
  • Create quota policy stubs automatically

Information Available

Service Limits:

  • Current limits for each service
  • Scope (availability domain, region, tenancy)
  • Available vs. used resources
  • Limit increase history

Compartment Quotas:

  • Active quota policies
  • Quota policy statements
  • Affected compartments
  • Usage against quotas

Usage Metrics:

  • Current resource consumption
  • Historical usage trends
  • Utilization percentages
  • Capacity planning projections

Creating and Managing Quotas

Automatic Policy Generation

Console Workflow:
Compartment quotas are available on the Console's Limits, Quotas and Usage page, which you can use to automatically generate quota statements.

Steps:

  1. Navigate to Limits, Quotas and Usage page
  2. Select the service, scope, resource, or compartment
  3. In the table, select the Actions menu (three dots)
  4. Select Create Quota Policy Stub
  5. System automatically generates appropriate quota policy statement
  6. Review and customize the generated statement
  7. Create the policy in the Quota Policies section

Manual Policy Creation

Prerequisites:
Ensure you have appropriate permissions to create quotas through IAM policies.

Required Permission:

Allow group QuotaAdministrators to manage quota-policies in tenancy
Enter fullscreen mode Exit fullscreen mode

Policy Creation Steps:

  1. Navigate to Governance & Administration > Quota Policies
  2. Click Create Quota Policy
  3. Provide policy name and description
  4. Enter quota statements using declarative syntax
  5. Specify target compartment
  6. Review and create

Sample Quota Policies

Autonomous Database Example:

set database quota atp-dedicated-ecpu-count to 40 in compartment MyCompartment
set database quota adw-dedicated-ecpu-count to 80 in compartment MyCompartment
set database quota atp-serverless-ecpu-count to 20 in compartment DevCompartment
Enter fullscreen mode Exit fullscreen mode

Compute Resources Example:

set compute-core quota standard-e4-core-count to 100 in compartment Production
set compute-core quota standard2-core-count to 50 in compartment Testing
zero compute-core quotas in compartment Archived
Enter fullscreen mode Exit fullscreen mode

Regional Quota Example:

set compute-core quota standard-e4-core-count to 240 in compartment MyCompartment where request.region = 'us-phoenix-1'
set compute-core quota standard-e4-core-count to 120 in compartment MyCompartment where request.region = 'us-ashburn-1'
Enter fullscreen mode Exit fullscreen mode

Block Storage Example:

set block-storage quota volume-count to 100 in compartment Production
set block-storage quota total-storage-gb to 50000 in compartment Production
Enter fullscreen mode Exit fullscreen mode

Best Practices for Quota Management

Planning and Design

Compartment Structure:
Design compartment hierarchy before implementing quotas to ensure logical resource allocation.

Quota Hierarchy:
Remember that quotas set at a parent compartment level limit resource use for that compartment and all of its children.

Parent Quota Calculation:
When setting quotas for parent compartments, include usage in child compartments to avoid unexpected restrictions.

Scope Selection:
Identify the scope of compartment quotas (availability domain, regional, or global) based on workload requirements.

Capacity Management

Growth Planning:

  • Leave room for growth when setting quotas
  • Monitor usage trends and adjust quotas proactively
  • Plan for seasonal or cyclical demand variations
  • Consider disaster recovery capacity requirements

Failover Consideration:
Ensure sufficient gap between current service limit and maximum usage to accommodate failover scenarios—failed resources may count against limits until successfully terminated.

Monitoring:

  • Regular review of quota utilization
  • Automated alerts for approaching quota limits
  • Trending analysis for capacity planning
  • Documentation of quota changes and justification

Cost Control

Budget Alignment:
Along with compartment budgets, compartment quotas create a powerful toolset to manage spending in OCI tenancies.

Cost Protection:

  • Set quotas to prevent unexpected cost overruns
  • Align quotas with approved budgets
  • Review and adjust quotas during budget cycles
  • Monitor actual spending against quota allocations

Resource Optimization:

  • Identify underutilized quotas for reallocation
  • Optimize quota distribution based on actual usage
  • Implement zero quotas for inactive compartments
  • Regular audit of quota efficiency

Service Limit Increases

Requesting Limit Increases

When to Request:

  • Approaching current service limits
  • Planning major deployments or migrations
  • Disaster recovery capacity needs
  • Business growth requirements

Request Process:

  1. Navigate to Limits, Quotas and Usage
  2. Find the service and resource requiring increase
  3. Click Request a Service Limit Increase
  4. Provide justification and required limit
  5. Submit request for Oracle review
  6. Track request status in console

Best Practices:

  • Request increases well in advance of need
  • Provide clear business justification
  • Document capacity planning assumptions
  • Keep records of all limit increase requests

Fixed Service Limits

Unchangeable Limits:
Be aware that some resources have fixed, unchangeable service limits that might impact your applications.

Examples:

  • Maximum 5 security lists per subnet
  • Maximum 500 policy statements per tenancy (hard limit)
  • One NAT Gateway per VCN
  • Specific API rate limits

Mitigation Strategies:
Make appropriate architectural adjustments when fixed limits impact design:

  • Use Network Security Groups in addition to security lists
  • Implement Tag-Based Access Control (TBAC) to reduce policy statement count
  • Design around fixed limits rather than requesting increases

Advanced Quota Scenarios

Multi-Environment Management

Development, Testing, Production:

# Production - highest allocation
set compute-core quota standard-e4-core-count to 500 in compartment Production

# Testing - moderate allocation
set compute-core quota standard-e4-core-count to 200 in compartment Testing

# Development - limited allocation
set compute-core quota standard-e4-core-count to 100 in compartment Development

# Archived - no allocation
zero compute-core quotas in compartment Archived
Enter fullscreen mode Exit fullscreen mode

Department-Based Allocation

Organization Structure:

# Finance department
set compute-core quota standard-e4-core-count to 300 in compartment Finance
set database quota atp-serverless-ecpu-count to 50 in compartment Finance

# Engineering department
set compute-core quota standard-e4-core-count to 600 in compartment Engineering
set database quota atp-serverless-ecpu-count to 100 in compartment Engineering

# Marketing department
set compute-core quota standard-e4-core-count to 150 in compartment Marketing
Enter fullscreen mode Exit fullscreen mode

Geographic Distribution

Regional Allocation:

# US East operations
set compute-core quota standard-e4-core-count to 400 in compartment USEast where request.region = 'us-ashburn-1'

# US West operations
set compute-core quota standard-e4-core-count to 400 in compartment USWest where request.region = 'us-phoenix-1'

# Europe operations
set compute-core quota standard-e4-core-count to 200 in compartment Europe where request.region = 'eu-frankfurt-1'
Enter fullscreen mode Exit fullscreen mode

Monitoring and Troubleshooting

Quota Monitoring

Usage Tracking:

  • Regular review of quota utilization in console
  • Automated alerts for quota thresholds (80%, 90%, 95%)
  • Trending analysis for forecasting
  • Integration with budget monitoring

Common Issues:

  • Quota limits blocking legitimate resource provisioning
  • Misconfigured quota statements preventing operations
  • Parent compartment quotas unintentionally restricting children
  • Quota and budget misalignment causing confusion

Troubleshooting Steps

Resource Provisioning Failures:

  1. Check service limits first
  2. Verify compartment quotas
  3. Review parent compartment quotas
  4. Validate scope (AD, region, tenancy)
  5. Confirm IAM permissions

Quota Policy Errors:

  • Validate syntax using policy stub generator
  • Check service family names in documentation
  • Verify quota names are correct
  • Ensure target compartment exists
  • Confirm proper IAM permissions for policy creation

Conclusion

Oracle Cloud Infrastructure's service limits and compartment quotas provide comprehensive resource governance capabilities, enabling organizations to control costs, manage capacity, and ensure resource availability while maintaining operational flexibility.

Key Takeaways:

Service Limits:

  • Oracle-defined resource allowances at tenancy level
  • Can be increased through support requests
  • Define maximum capacity available
  • Apply at various scopes (AD, region, tenancy)

Compartment Quotas:

  • Customer-defined resource allocation within service limits
  • Set using flexible policy statements
  • Enable fine-grained resource control
  • Support organizational and cost management objectives

Management Approach:

  • Design compartment structure before implementing quotas
  • Use quota policy stub generator for accuracy
  • Monitor usage and adjust quotas proactively
  • Combine with budgets for comprehensive cost management
  • Document quota policies and changes

Fleet Administrator Role:
In dedicated infrastructure deployments, fleet administrators manage both service limits and compartment quotas, providing centralized governance while enabling self-service provisioning within defined boundaries.

By effectively leveraging service limits and compartment quotas, organizations can optimize resource utilization, control costs, and ensure that critical workloads always have the capacity they need while preventing unexpected consumption and spending overruns.

Top comments (0)