Imagine you want to run your own computer program on the internet — like a website, an AI chatbot, or a game server. But you don't want to buy a big, expensive physical machine.
That's exactly where OCI Compute Instances save the day! You borrow a super-powerful computer from Oracle's cloud, use it, and pay according to its shape, usage, and any applicable free allowance. Storage and other resources can have separate charges. Simple as that!
Kid-friendly analogy
Think of it like: Renting a bicycle instead of buying one. You ride it, return it, and only pay for the hours you used it!
In This Post
- 01. What is a Compute Instance?
- 02. Why Are Compute Instances So Important?
- 03. What is an OCPU?
- 04. Types of Compute Instances in OCI
- 05. How to Choose the Right OCPU Count?
- 06. Step-by-Step: Create Your First Compute Instance
- 07. Connect to Your Instance Using SSH
- 08. Install OCI CLI — Your Cloud Remote Control
- 09. Control OCI Compute with Python SDK
- 10. Monitor CPU & OCPU Usage with Python
- 11. Real Example: Run an AI App on OCI
- 12. Do's and Don'ts
- 13. Additional References
- 14. Quick Summary
01. What is a Compute Instance?
A Compute Instance is a virtual machine or a dedicated physical server that lives inside Oracle's giant data center. You can't touch it physically — but you can control it completely over the internet!
It comes with everything a real computer has:
Kid-friendly analogy
- Brain (CPU/OCPUs) = Does the thinking and calculations
- Short-term memory (RAM) = Remembers what it's currently working on
- Storage (Hard Disk) = Stores files subject to volume retention and deletion settings
- Network = Talks to the internet and other computers
Kid-friendly analogy
Real-life analogy: Think of Oracle's cloud like a giant hotel. Each Compute Instance is one hotel room. You book the room, use it, and check out when done. Oracle manages the building — you just enjoy your room!
Official documentation supporting the qualifications in this section: Overview Billing
02. Why Are Compute Instances So Important?
Cloud compute instances can host websites, APIs, and other internet-facing applications. Here's why they matter so much:
- No need to buy hardware → Start without buying a physical server; usage charges may apply
- Pay only for what you use → Running time affects charges, but stopped-instance billing depends on the shape and other resources may still cost money. ⏱
- Scale capacity → Need more power? Resize supported shapes when capacity and limits permit; plan for any required interruption
- Run AI models → Train and serve ML models without buying expensive GPUs
- Host globally → Put your app close to users in India, USA, Japan — everywhere!
Example: Your school project website suddenly gets 10,000 visitors. Instead of panicking, you just increase your Compute Instance size — subject to capacity, limits, and any required restart.
Official documentation supporting the qualifications in this section: Billing Resize
03. What is an OCPU?
When you rent a Compute Instance, Oracle measures its computing power in OCPUs.
OCPU = Oracle CPU
Kid-friendly analogy
This is Oracle's special way of saying "how much brain power does your instance have?" But what exactly is 1 OCPU?
Kid-friendly analogy
Think of it like a pizza!
- Imagine a processor as a pizza, with each slice representing a processor core (one worker).
- On x86-based OCI shapes (Intel and AMD), 1 OCPU represents 1 physical core.
- Most x86 cores expose 2 hardware threads, so 1 x86 OCPU = 2 vCPUs.
- On OCI Ampere A1, 1 OCPU = 1 core = 1 vCPU; A1 cores use a single hardware execution thread.
The most important formula to remember:
x86 (Intel/AMD): 1 OCPU = 1 physical core = 2 vCPUs
Ampere A1: 1 OCPU = 1 core = 1 vCPU
So if you have 4 OCPUs on an x86-based OCI instance, that represents 8 vCPUs. On an Ampere A1 instance, 4 OCPUs represent 4 vCPUs.
OCPU vs vCPU — What's the Difference?
Other cloud providers like AWS and Azure use vCPUs instead of OCPUs. This confuses beginners when comparing prices. Here's the simple breakdown:
┌──────────────────┬─────────────────────┬──────────────────────┐
│ What you get │ OCI x86: 1 OCPU │ OCI Ampere A1: 1 OCPU │
├──────────────────┼────────────────────┼───────────────────────┤
│ Physical Cores │ 1 │ 1 │
│ vCPUs / Threads │ 2 │ 1 │
│ Core model │ 2 threads/core │ 1 thread/core │
└──────────────────┴────────────────────┴───────────────────────┘
Bottom line: 1 OCPU maps to 2 vCPUs on OCI x86 shapes, but to 1 vCPU on Ampere A1. Check the processor architecture before comparing cloud prices.
Official documentation supporting the qualifications in this section: Shapes
04. Types of Compute Instances in OCI
Kid-friendly analogy
OCI offers different Shapes — think of shapes like different sizes of hotel rooms. Small room, large suite, or a luxury penthouse — each has a different price and purpose!
Shape 1: Standard (General Purpose) — Most Common
Great for websites, APIs, learning projects, and everyday apps.
- VM.Standard.A1.Flex → ARM-based. Always Free eligible within the applicable allowance; cost suitability depends on the workload
- VM.Standard.E5.Flex → AMD EPYC. Evaluate price and performance for your workload
- VM.Standard3.Flex → Intel. Uses x86 processors; verify application and operating-system compatibility
Shape 2: GPU — For AI & Deep Learning
Massive computing power for training and running AI models.
- VM.GPU.A10.1 → NVIDIA A10. Great for AI inference (serving predictions)
- VM.GPU.L40S.1 → NVIDIA L40S on Compute Cloud@Customer deployments with the required GPU expansion rack; not a general OCI public-region VM shape.
- BM.GPU.H100.8 → 8× NVIDIA H100. The absolute monster for training huge AI models
Always Free eligibility — within published limits
Yes, Oracle provides eligible cloud resources free of charge for the life of the account, subject to the published Always Free limits and home-region requirements.
- VM.Standard.A1.Flex → The current Always Free Resources page lists 1,500 OCPU-hours and 9,000 GB-hours per month, equivalent to 2 OCPUs + 12 GB RAM in total for an Always Free tenancy.
- Create Always Free A1 instances in your tenancy's home region; the available allocation is shared across your A1 instances.
- No credit card charges as long as you stay within the applicable free limits.
- Perfect for learning, small projects, and first-time experiments.
Account-type note: Oracle's Always Free Resources page lists 1,500 OCPU-hours and 9,000 GB-hours per month for A1 in an Always Free tenancy (2 OCPUs and 12 GB RAM total). Oracle's price list separately describes a 3,000 OCPU-hour and 18,000 GB-hour A1 allowance for paid tenancies, shared across A1 bare metal, VM, and Container Instances. Do not assume the paid-tenancy allowance applies to an Always Free account; verify the entitlement shown for your tenancy before provisioning.
Beginner Tip: Start with the Always Free tier! For VM.Standard.A1.Flex, Oracle's current Always Free Resources page lists a total allowance equivalent to 2 OCPUs and 12 GB RAM (1,500 OCPU-hours and 9,000 GB-hours per month). Create the instance in your tenancy's home region, and check the Console for the current Always Free eligibility label before launching.
Official documentation supporting the qualifications in this section: Shapes Free Cloud@Customer shapes
05. How to Choose the Right OCPU Count?
Kid-friendly analogy
Choosing OCPUs is like choosing the right engine size for a car. Too small = slow and sluggish. Too big = wasting money on power you don't need!
What Are You Building? OCPUs RAM
─────────────────────────────────────────────────────────
Learning / Personal experiments 1 6 GB
Small website or blog 1 6 GB
Small shop (1,000 visitors/day) 2 12 GB
Medium app (10,000 users/day) 4 32 GB
AI model serving (inference) 8 64 GB
Big data processing jobs 16 256 GB
Game server (50 players) 4 16 GB
These OCPU/RAM figures are illustrative starting points, not capacity guarantees based on user counts. Benchmark your application and check the selected shape’s supported memory-to-OCPU ratio. Shapes Best
Pro tip: Always start small! Watch your CPU usage. Treat 80% and 20% as illustrative investigation thresholds, not automatic resize rules. Check latency, demand, memory, and I/O before changing capacity. This is called right-sizing — and it saves a lot of money!
Official documentation supporting the qualifications in this section: Metrics Best
06. Step-by-Step: Create Your First Compute Instance
For this public-SSH walkthrough, configure a VCN and public subnet with an internet-gateway route, assign a public IP, and permit SSH from your client in the relevant security rules and host firewall. The Console may split creation into Basic Information, Security, Networking, and Storage; follow the labels shown in your tenancy. Launch Network
Let's create your first cloud server together! Follow each step carefully.
Step 1: Create a Free OCI Account
- Go to cloud.oracle.com and click "Start for free"
- Enter your name, email, and phone number
- Provide an accepted payment card for identity verification if requested; a temporary authorization hold may appear. Paid usage requires attention to account type and free limits.
- Verify your email and phone OTP
- Your account is ready!
Step 2: Open the Compute Section
- Log in at cloud.oracle.com
- Open the navigation menu
- Navigate to: Compute → Instances
- Select "Create Instance" button
Step 3: Name Your Instance & Pick a Shape
- Give it a name like
my-first-cloud-server - Click "Change Shape"
- Select VM.Standard.A1.Flex (Arm — verify Always Free eligibility and your remaining allowance)
- Set OCPUs = 2 and Memory = 12 GB
Step 4: Choose Your Operating System
- Click "Change Image"
- Choose Ubuntu 24.04 — select an Arm-compatible platform image available for A1 in your region.
Step 5: Download Your SSH Key (Very Important!)
- Under "Add SSH Keys", select "Generate a key pair for me"
- Click "Save Private Key" — a
.keyfile downloads to your computer
Kid-friendly analogy
- Keep this file very safe! It's like the key to your hotel room. Losing the only usable private key prevents normal key-based login; recovery requires another authorized access method.
Step 6: Hit Create and Wait!
- Scroll down and click the big "Create" button
- Wait for provisioning to finish; timing varies. Continue when the status changes: Provisioning → Running
- Note down the Public IP address shown on screen — you'll need it next!
07. Connect to Your Instance Using SSH
Kid-friendly analogy
Now let's actually log in to your cloud server. It's like calling your hotel room through a special secure phone line!
Kid-friendly analogy
What is SSH? SSH (Secure Shell) is a way to connect your laptop to your server through the internet, through a secret encrypted tunnel. It encrypts traffic in transit; verify the server identity before accepting a new host key.
What the command below does: It opens a secure connection from your laptop to your OCI server using your downloaded key file. Once connected, you'll see your server's terminal — you're now controlling a computer that lives in Oracle's data center!
# On Mac or Linux — open Terminal and run:
# Replace YOUR_KEY.key with your downloaded key file name
# Replace YOUR_IP with the Public IP of your OCI instance
chmod 400 ~/Downloads/YOUR_KEY.key
ssh -i ~/Downloads/YOUR_KEY.key ubuntu@YOUR_IP
# Real example:
chmod 400 ~/Downloads/ssh-key-2026.key
ssh -i ~/Downloads/ssh-key-2026.key ubuntu@YOUR_IP
When it asks "Are you sure you want to continue connecting?" — verify the server host-key fingerprint using a trusted source, then type yes and press Enter.
You'll see a welcome message from Ubuntu — that means you're inside your cloud server!
Official documentation supporting the qualifications in this section: Ssh
08. Install OCI CLI — Your Cloud Remote Control
The OCI CLI (Command Line Interface) lets you control your entire Oracle Cloud from your terminal — no clicking buttons on a website needed!
Kid-friendly analogy
What the command below does: It downloads and installs the official OCI CLI tool on your computer. After this, you can manage your entire cloud — create, delete, resize instances — all by typing commands. Think of it as installing a super-powered remote control!
# For Mac / Linux — paste this into your Terminal:
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
Now link it to your Oracle Cloud account:
Kid-friendly analogy
What the command below does: It connects the OCI CLI to your Oracle Cloud account. Like logging into an app for the first time — you provide your account details once and it stores configuration locally; credentials can be revoked or replaced, and IAM permissions still control access.
oci setup config
# It asks you these questions — answer each one:
# Config location → press Enter (keep the default path)
# User OCID → find in OCI Console → top-right profile icon
# Tenancy OCID → OCI Console → Administration → Tenancy Details
# Region → type: ap-mumbai-1 (or your closest region)
# Generate RSA keys? → type Y and press Enter
After setup, upload the generated API public key to your OCI user’s API keys in the Console. The matching fingerprint, private-key path, region, and IAM permissions must be valid before CLI or SDK calls can succeed. Cli
List Your Instances Using CLI
Kid-friendly analogy
What the command below does: It prints a table showing the instances in the selected compartment and configured region — their names, whether they're Running or Stopped, and which shape they are. Like asking the hotel front desk: "show me all my bookings!"
# Replace YOUR_COMPARTMENT_ID with your compartment OCID
oci compute instance list \
--compartment-id YOUR_COMPARTMENT_ID \
--all \
--output table
Output:
+---------------------+-----------------+-------------+---------------------------+
| display-name | lifecycle-state | region | shape |
+---------------------+-----------------+-------------+---------------------------+
| my-first-server | RUNNING | ap-mumbai-1 | VM.Standard.A1.Flex |
| dev-testing-box | STOPPED | ap-mumbai-1 | VM.Standard.E5.Flex |
+---------------------+-----------------+-------------+---------------------------+
Illustrative selected fields only. The default table output can include other fields; the instance-list response does not provide a standalone region field like the one shown here. List
Your instances listed in a clean table!
Change OCPU Count Using CLI
Kid-friendly analogy
What the three commands below do: They first stop your instance (switching it off), then upgrade its OCPUs and RAM (giving it a bigger engine), then start it back up. Your server comes back stronger — with more power!
# Step 1: Request a graceful stop; continue only if this command succeeds
oci compute instance action \
--instance-id YOUR_INSTANCE_OCID \
--action SOFTSTOP \
--wait-for-state STOPPED
# Step 2: Upgrade — change from 2 OCPUs/12 GB to 4 OCPUs/24 GB
oci compute instance update \
--instance-id YOUR_INSTANCE_OCID \
--shape-config '{"ocpus": 4, "memoryInGBs": 24}' \
--wait-for-state STOPPED
# Step 3: Continue only after the update succeeds, then start it
oci compute instance action \
--instance-id YOUR_INSTANCE_OCID \
--action START \
--wait-for-state RUNNING
Run the commands one at a time and stop on any error or timeout. SOFTSTOP can force power-off after its grace period; arrange application shutdown first if it needs longer. A successful RUNNING state does not by itself confirm application recovery. Action Update
Cost note: Resizing an Always Free A1 instance from 2 OCPUs / 12 GB to 4 OCPUs / 24 GB exceeds the standard Always Free A1 allocation described above. This is a larger-capacity example; it may be unavailable under an Always Free tenancy or may incur charges under the applicable account entitlement. Check the Console limits and cost estimate before running the update.
After all three commands succeed, verify that the instance reports 4 OCPUs and 24 GB RAM and that the application has recovered.
09. Control OCI Compute with Python SDK
Want to manage your cloud using Python code? That's what the OCI Python SDK is for! Perfect for automating things and building smarter apps.
Install the Python SDK
What the command below does: It installs Oracle's official Python library on your computer. After this, your Python scripts can talk directly to Oracle Cloud — creating servers, checking them, deleting them — all with code!
pip install oci
List All Instances with Python
Kid-friendly analogy
What the code below does: This Python script connects to your Oracle Cloud account and fetches all pages of instances in the selected compartment and configured region. For each one, it prints the name, whether it's Running or Stopped, the shape name, and the number of OCPUs and GB of RAM. It's like getting your hotel booking list — but in Python!
import oci
# Load your OCI account details from the config file set up earlier
config = oci.config.from_file()
# Create a compute client — our "connection" to Oracle Cloud
compute_client = oci.core.ComputeClient(config)
# Your compartment OCID — find in OCI Console → Identity → Compartments
compartment_id = "ocid1.compartment.oc1..xxxxxxxxxxxxxx"
# Fetch all instances in this compartment
instances = oci.pagination.list_call_get_all_results(
compute_client.list_instances, compartment_id=compartment_id
)
# Print details for each instance
print("=" * 50)
print(" MY OCI COMPUTE INSTANCES")
print("=" * 50)
for instance in instances.data:
shape_config = instance.shape_config
print(f" Name : {instance.display_name}")
print(f" Status : {instance.lifecycle_state}")
print(f" Shape : {instance.shape}")
print(f" OCPUs : {shape_config.ocpus}")
print(f" RAM(GB) : {shape_config.memory_in_gbs}")
print("-" * 50)
Output:
==================================================
MY OCI COMPUTE INSTANCES
==================================================
Name : my-first-server
Status : RUNNING
Shape : VM.Standard.A1.Flex
OCPUs : 2
RAM(GB) : 12.0
--------------------------------------------------
Name : dev-testing-box
Status : STOPPED
Shape : VM.Standard.E5.Flex
OCPUs : 4
RAM(GB) : 32.0
--------------------------------------------------
All your instances printed beautifully — just with Python!
Create a New Instance with Python
Kid-friendly analogy
What the code below does: This script automatically creates a brand new Compute Instance entirely from Python. You tell it the size (OCPUs, RAM), which OS to install, and which network to use — and Oracle does the rest. It's like booking a hotel room through a website — except the website is your Python script!
import oci
config = oci.config.from_file()
compute_client = oci.core.ComputeClient(config)
# --- Fill in your own values here ---
COMPARTMENT_ID = "ocid1.compartment.oc1..xxxxxxxxx"
AVAILABILITY_DOMAIN = "YOUR_FULL_AVAILABILITY_DOMAIN_NAME"
SUBNET_ID = "ocid1.subnet.oc1..xxxxxxxxxxx"
IMAGE_ID = "ocid1.image.oc1..xxxxxxxxxxx" # Ubuntu 24.04 ARM image OCID
# ------------------------------------
# Describe what kind of instance we want
instance_details = oci.core.models.LaunchInstanceDetails(
compartment_id = COMPARTMENT_ID,
availability_domain = AVAILABILITY_DOMAIN,
display_name = "python-created-server",
# Shape = the type of virtual machine. A1.Flex is ARM and Always Free eligible!
shape = "VM.Standard.A1.Flex",
# How many OCPUs and how much RAM?
shape_config = oci.core.models.LaunchInstanceShapeConfigDetails(
ocpus = 2, # On Ampere A1, 2 OCPUs = 2 vCPUs
memory_in_gbs = 12 # 12 GB of RAM
),
# Which operating system image to install
source_details = oci.core.models.InstanceSourceViaImageDetails(
source_type = "image",
image_id = IMAGE_ID
),
# Authorize your existing SSH public key for login
metadata = {"ssh_authorized_keys": "YOUR_OPENSSH_PUBLIC_KEY"},
# Network settings — give it a public IP so we can reach it from the internet
create_vnic_details = oci.core.models.CreateVnicDetails(
subnet_id = SUBNET_ID,
assign_public_ip = True
)
)
# Launch the instance!
response = compute_client.launch_instance(instance_details)
print(f" Instance launch requested!")
print(f" Name : {response.data.display_name}")
print(f" Status : {response.data.lifecycle_state}")
print(f" Shape : {response.data.shape}")
print(f" ID : {response.data.id}")
Use the full availability-domain name returned for your tenancy, a compatible Arm image, your subnet OCID, and an actual OpenSSH public key. The subnet must permit public IP assignment and have the required route and SSH ingress. PROVISIONING means launch is in progress, not that SSH is ready. Launch API Launch
Output:
Instance launch requested!
Name : python-created-server
Status : PROVISIONING
Shape : VM.Standard.A1.Flex
ID : ocid1.instance.oc1.ap-mumbai-1.xxxxx
The response shows that the launch request was accepted; wait for RUNNING and verify access before treating the server as ready.
10. Monitor CPU & OCPU Usage with Python
After your instance is running, you want to keep an eye on how hard it's working. Sustained CPU above 90% can indicate a CPU bottleneck; correlate it with workload latency and other resource metrics before adding OCPUs.
Kid-friendly analogy
What the code below does: It checks how busy your instance's OCPUs have been over the last hour. It queries one-minute CPU averages and prints the five most recent available readings — like a speedometer for your server. High % = your server is working very hard. Low % = it's just chilling!
import oci
from datetime import datetime, timedelta, timezone
config = oci.config.from_file()
monitoring_client = oci.monitoring.MonitoringClient(config)
COMPARTMENT_ID = "ocid1.compartment.oc1..xxxxxxxxx"
INSTANCE_OCID = "ocid1.instance.oc1..xxxxxxxxx"
# Look at the last 1 hour of data
end_time = datetime.now(timezone.utc)
start_time = end_time - timedelta(hours=1)
# MQL query = asking OCI: "give me average CPU % for my instance, per minute"
mql_query = (
f'CpuUtilization[1m]'
f'{{resourceId = "{INSTANCE_OCID}"}}'
f'.mean()'
)
response = monitoring_client.summarize_metrics_data(
compartment_id = COMPARTMENT_ID,
summarize_metrics_data_details = oci.monitoring.models.SummarizeMetricsDataDetails(
namespace = "oci_computeagent",
query = mql_query,
start_time = start_time.isoformat(),
end_time = end_time.isoformat()
)
)
# Print the five most recent available readings with a simple bar chart
print(" CPU Usage — Last 5 Available Readings:")
print("-" * 45)
for metric_data in response.data:
for datapoint in sorted(
metric_data.aggregated_datapoints, key=lambda point: point.timestamp
)[-5:]:
time_str = datapoint.timestamp.strftime("%H:%M")
usage = round(datapoint.value, 1)
bar = "█" * int(usage / 5)
print(f" {time_str} {bar:<20} {usage:>5.1f}%")
Prerequisites: the Compute Instance Monitoring plugin must be enabled and running, metric delivery must have a working network path, and the caller needs Monitoring access. Missing data is not zero utilization. Displayed timestamps are formatted in UTC by this example. Metrics Mql
Output:
CPU Usage — Last 5 Available Readings:
---------------------------------------------
14:00 ████ 23.5%
14:01 ██ 12.1%
14:02 ██████████ 52.3%
14:03 ████████████████ 82.7%
14:04 ███ 17.4%
At 14:03, the CPU hit 82.7% — if it persists alongside unacceptable latency, investigate whether additional OCPUs would address the bottleneck.
11. Real Example: Run an AI App on OCI
Let's bring it all together with something really exciting — running an actual AI model on your OCI Compute Instance. This is exactly what startups and developers do !
What the code below does: It creates a small demonstration web API; external access also requires the appropriate network route and firewall rules. The API uses an AI model from Hugging Face to read the text and decide if it sounds positive or negative. Your OCI instance's OCPUs do all the AI thinking — automatically! Send "I love cloud!" → receive a sentiment label and model score; the exact result must be measured
# First, install these on your OCI instance terminal:
# pip install fastapi uvicorn transformers torch
from fastapi import FastAPI
from pydantic import BaseModel
from transformers import pipeline
# Create our web application
app = FastAPI(title="My AI API — Powered by OCI")
# Load a pre-trained AI model from Hugging Face
# It runs on your OCI instance's OCPUs — no special GPU needed for this one!
print("⏳ Loading AI model... (takes ~30 seconds the first time)")
sentiment_model = pipeline(
"sentiment-analysis",
model = "distilbert-base-uncased-finetuned-sst-2-english"
)
print(" AI model is ready!")
# This defines what a user's request looks like — just a piece of text
class TextRequest(BaseModel):
text: str
# The API endpoint — the URL path people send text to
@app.post("/analyze")
def analyze_sentiment(request: TextRequest):
# The AI model reads the text and gives a result
result = sentiment_model(request.text)[0]
return {
"your_text" : request.text,
"sentiment" : result["label"], # POSITIVE or NEGATIVE
"confidence" : round(result["score"] * 100, 2), # Model score as a percentage; not measured accuracy
"server" : "OCI Compute — VM.Standard.A1.Flex"
}
# To start the API on your OCI server, run this command in terminal:
# uvicorn app:app --host 0.0.0.0 --port 8000
The confidence field is the model’s class score multiplied by 100, not a measured probability that a business decision is correct. This model targets English sentiment and has documented limitations. Returned labels and scores below are illustrative, not executed results. Transformers documentation Model
Save the Python application as app.py and start Uvicorn before testing. For this HTTP demonstration, allow TCP 8000 only from your test client's public IP in the applicable NSG or security list and host firewall, with a public IP and internet route configured. This example has no authentication or TLS and is not a production deployment.
# Replace YOUR_OCI_IP with your instance's Public IP
curl -X POST "http://YOUR_OCI_IP:8000/analyze" \
-H "Content-Type: application/json" \
-d '{"text": "OCI Compute Instances are absolutely amazing!"}'
Output:
{
"your_text" : "OCI Compute Instances are absolutely amazing!",
"sentiment" : "POSITIVE",
"confidence" : 99.87,
"server" : "OCI Compute — VM.Standard.A1.Flex"
}
A successful test confirms that this demonstration API is reachable from the permitted client and inference runs on your OCI instance; no deployment or test was executed for this article.
12. Do's and Don'ts
- Start with the Always Free tier to learn without spending money
- Stop unused instances through OCI when appropriate; compute billing relief depends on the shape, and storage can remain billable.
- Take Boot Volume Backups before making big changes
- Monitor CPU usage and right-size your instance regularly
- Use SSH keys — always. Never password-based SSH
- Do not assume unused instances are free: charges depend on shape, duration, and applicable allowances.
- Don't pick a huge OCPU count for a tiny project — that's just wasted money
- Protect your SSH private key file; losing the only usable key prevents normal SSH login and requires recovery.
- Don't skip OS updates — unpatched software can expose known vulnerabilities
- Don't open all firewall ports — only open what you actually need
- OCPU-to-vCPU mapping depends on the processor: x86 (Intel/AMD) = 2 vCPUs per OCPU; Ampere A1 = 1 vCPU per OCPU.
- Always Free A1 allowance: 1,500 OCPU-hours and 9,000 GB-hours per month, equivalent to 2 OCPUs and 12 GB RAM total for an Always Free tenancy; use the home region.
- CPU above 80% consistently? → Investigate demand and response time before deciding to scale up.
- CPU below 20% always? → Check peak demand and memory needs before deciding to scale down.
- A1.Flex can be cost-effective for compatible Arm workloads; compare measured performance and applicable pricing.
Official documentation supporting the qualifications in this section: Billing Best
13. Additional References
- Compute Shapes — Oracle's current reference for VM shapes, OCPU definitions, processor families, and flexible shape configuration.
- OCPUs and vCPUs in Compute Shapes — The architecture-specific mapping for x86, Ampere A1, and other Ampere processor families.
- Always Free Resources — Current Always Free eligibility, home-region requirements, and monthly compute resource allowances.
- OCI Price List — Published pricing notes, CPU architecture mappings, and the separate A1 free-usage allowance described for paid tenancies.
- Creating an Instance — Console workflow and prerequisites for launching a VM or bare metal instance.
- Connecting to a Linux Instance — SSH prerequisites, public IP information, default usernames, and private-key use.
- Get Started with the Command Line Interface — Oracle's CLI setup and instance-launch walkthrough.
- Compute Instance Metrics and Monitoring Query Language (MQL) Reference — Metric namespace, monitoring requirements, and MQL query syntax for CPU utilization.
- Billing for Stopped Instances — Explains when stopping an instance changes compute charges.
- OCI CLI Quickstart — Covers installation, local configuration, and API-key registration.
- Python SDK Pagination — Shows the helper used to fetch every page of list results.
- OCI Security Rules — Explains the network and operating-system firewall layers.
- Compute Cloud@Customer Shapes — Documents the deployment requirements for VM.GPU.L40S shapes.
- Transformers Pipelines — Defines sentiment classification results and model scores.
14. Quick Summary
What we learned:
- Compute Instance → A virtual machine or a dedicated physical server you rent from Oracle's cloud
- OCPU → Oracle's unit for CPU capacity. The mapping depends on the processor: 1 OCPU = 2 vCPUs on x86 (Intel/AMD), but 1 vCPU on Ampere A1.
- Shapes → Shape categories include Standard and GPU; Always Free is an eligibility category.
- Always Free Tier → For A1, the published Always Free allowance is 1,500 OCPU-hours and 9,000 GB-hours monthly, equivalent to 2 OCPUs and 12 GB RAM total; create the instance in the home region.
- SSH → How you securely log into and control your instance
- OCI CLI → Manage your cloud from terminal — list, resize, start, stop
- Python SDK → Create and manage instances using Python code
- Monitoring → Use CPU %, workload latency, and other resource metrics to assess capacity changes
- AI on OCI → Run Hugging Face models on your instance with FastAPI
- Security → Firewall rules, SSH keys, and OS updates are important controls, not a complete security guarantee.
Happy cloud learning!
Official documentation supporting the qualifications in this section: Overview Free Metrics Network
Comments
Post a Comment