Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Ceph Storage Fundamentals

By Kokil Thapa | Last reviewed: August 2026

Ceph Storage Fundamentals are essential knowledge for any full-stack developer or systems engineer managing data at scale without vendor lock-in. Unlike traditional SAN/NAS solutions, Ceph provides a unified, software-defined storage layer that handles object, block, and file storage simultaneously on commodity hardware. For developers building high-availability platforms—whether Laravel applications requiring shared session/media storage or legal-tech portals needing compliant document archives—understanding how Ceph distributes and protects data is the difference between a resilient system and a catastrophic failure.

What are the core components of Ceph Storage Fundamentals?

To operate Ceph reliably, you must understand four distinct daemon types that form the cluster. Ceph is not a monolith; it is a collection of specialized processes communicating over a private network. In my experience deploying infrastructure for content-heavy sites, confusing these roles is the primary cause of performance bottlenecks and split-brain scenarios.

Ceph Cluster ArchitectureMON (Monitor)Cluster Map & State(Paxos Consensus)MGR (Manager)Metrics & Dashboard(Orchestrator)OSD (Object)Data Storage & Replication(BlueStore Engine)Client / AppRBD / CephFS / RGWClients retrieve maps from MON/MGR, then read/write directly to OSDs
Core Ceph Storage Fundamentals: Monitors maintain state, Managers expose metrics, OSDs store data, and Clients interact directly with OSDs after map retrieval.
  • Monitors (MON): Maintain the master copy of the cluster map (monmap, osdmap, pgmap). You need an odd number (typically 3 or 5) to achieve Paxos consensus. Never run an even number of monitors.
  • Managers (MGR): Provide cluster metrics, dashboard, and orchestrator functionality. While not strictly required for data path operations in older versions, in Ceph Reef (v18) and Squid (v19), the manager is critical for telemetry and module execution.
  • Object Storage Daemons (OSDs): The workhorses that store actual data. Each OSD manages one physical drive. They handle replication, erasure coding, recovery, and rebalancing based on the CRUSH map.
  • Clients: Any entity accessing data. Unlike centralized storage, clients compute object placement locally using the CRUSH algorithm after fetching the cluster map, eliminating metadata server bottlenecks.

How does the CRUSH algorithm determine data placement?

The CRUSH (Controlled Replication Under Scalable Hashing) algorithm is the defining feature of Ceph Storage Fundamentals. It replaces static lookup tables with a deterministic pseudo-random function. When a client writes an object, it hashes the object name + pool ID to get a Placement Group (PG), then applies the CRUSH rule to map that PG to specific OSDs.

This computation happens on the client side. The cluster only needs to distribute the lightweight CRUSH map (usually <1MB), not petabytes of metadata. This is why Ceph scales linearly while traditional NAS hits metadata ceilings.

Understanding Placement Groups (PGs)

PGs are internal shards that group objects for management efficiency. Managing billions of individual objects is computationally impossible; managing thousands of PGs is trivial. A common mistake I see in new deployments is incorrect PG sizing. Too few PGs causes hotspots; too many increases peering overhead during recovery.

# Calculate optimal PG count per pool (Ceph Squid/Reef recommendation)
# Target ~100 PGs per OSD for balanced clusters
ceph osd pool set <pool-name> pg_num 128
ceph osd pool set <pool-name> pgp_num 128

# Enable autoscaler for dynamic adjustment (recommended for 2026 deployments)
ceph osd pool set <pool-name> pg_autoscale_mode on

In production, always enable the PG autoscaler unless you have a specific benchmark proving manual tuning is superior. The autoscaler in recent Ceph versions has matured significantly and prevents most human error in PG calculation.

How do you configure Ceph pools for different workloads?

Pools are logical partitions for organizing data. Choosing between Replicated and Erasure Coding (EC) is one of the most consequential decisions in Ceph Storage Fundamentals. This choice dictates your storage efficiency, CPU overhead, and compatibility with access methods.

FeatureReplicated PoolErasure Coded (EC) Pool
Space EfficiencyLow (3x = 33% usable)High (4+2 = 66% usable)
CPU OverheadMinimalSignificant (encoding/decoding)
RBD SupportNativeRequires Cache Tier or Special Config
CephFS MetadataRequiredNot Supported
Recovery SpeedFaster (simple copy)Slower (reconstruction math)
Best Use CaseDatabases, VM Disks, MetadataBackups, Media Archives, Logs

Creating a Replicated Pool for Block Storage

For Laravel session storage, MySQL databases, or VM disks via RBD, use replicated pools. The standard size is 3 replicas with min_size 2, allowing one OSD failure without downtime.

# Create replicated pool for application data
ceph osd pool create app_data 128 128 replicated
ceph osd pool set app_data size 3
ceph osd pool set app_data min_size 2

# Set application tag for proper interface binding
ceph osd pool application enable app_data rbd

Creating an Erasure Coded Pool for Object Storage

For RGW buckets storing user uploads, legal documents, or backups where cost-efficiency matters more than latency, EC pools save significant disk space. A k=4, m=2 profile tolerates 2 simultaneous failures while offering 66% utilization versus 33% for triple replication.

# Create EC profile and pool
ceph osd erasure-code-profile set ec_4_2 k=4 m=2 crush-failure-domain=host
ceph osd pool create media_archive 128 128 erasure ec_4_2
ceph osd pool application enable media_archive rgw
Replicated (Size=3)OSD 1Full CopyOSD 2Full CopyOSD 3Full CopyWrite: 3x Network/DiskRead: Any Single OSDUsable: 33%Latency: LowCPU: MinimalErasure Code (4+2)D1D2D3D4P1P2Write: Encode + 6x DiskRead: Decode if MissingUsable: 66%Latency: HigherCPU: Significant
Replicated pools write full copies for speed; Erasure Coding splits data into chunks with parity for space efficiency. Choose based on workload characteristics.

How do you integrate Ceph with Laravel and web applications?

For PHP/Laravel developers, Ceph integrates primarily through two interfaces: S3-compatible object storage via RGW (RADOS Gateway) and POSIX filesystem access via CephFS. Understanding which to use is part of practical Ceph Storage Fundamentals.

S3-Compatible Storage via RGW

RGW exposes an S3/Swift API. This is ideal for Laravel applications already using S3 drivers. You can swap AWS endpoints for your local Ceph cluster without changing application code. This approach works well for media libraries, user uploads, and backup destinations.

// Laravel filesystems.php configuration for Ceph RGW
's3' => [
    'driver' => 's3',
    'key' => env('CEPH_ACCESS_KEY'),
    'secret' => env('CEPH_SECRET_KEY'),
    'region' => 'us-east-1', // Placeholder, ignored by Ceph
    'bucket' => env('CEPH_BUCKET'),
    'endpoint' => env('CEPH_RGW_ENDPOINT'), // e.g., https://rgw.example.com
    'use_path_style_endpoint' => true,     // Critical for Ceph RGW
],

Note the use_path_style_endpoint flag. Ceph RGW typically uses path-style URLs (/bucket/key) rather than virtual-hosted style (bucket.endpoint/key). Forgetting this causes silent failures or 404 errors in production.

Shared Filesystem via CephFS

When multiple Laravel instances need concurrent read/write access to the same directory (e.g., shared cache, compiled views, legacy file-based sessions), CephFS provides POSIX semantics. Mount it directly on application servers:

# Mount CephFS on Ubuntu 24.04 application server
mount -t ceph :/ /mnt/cephfs \
  -o name=app_user,secretfile=/etc/ceph/app_user.secret,\
mds_namespace=cephfs_a

Avoid CephFS for database storage or high-IOPS workloads. Use RBD block devices instead. CephFS metadata operations can become bottlenecks under heavy concurrent small-file writes typical of poorly optimized PHP applications.

What monitoring and maintenance practices ensure cluster health?

Deploying Ceph is straightforward; keeping it healthy requires discipline. In my experience maintaining production clusters, proactive monitoring prevents 90% of data loss incidents. Ceph Storage Fundamentals include knowing which metrics actually matter versus noise.

Critical Health Checks

  1. Cluster Status: Run ceph -s daily. HEALTH_OK is the only acceptable state for production. HEALTH_WARN requires investigation within hours; HEALTH_ERR demands immediate action.
  2. OSD Utilization: Alert at 75% capacity. Ceph performance degrades significantly above 80% due to compaction overhead and reduced placement flexibility.
  3. PG States: Monitor for stuck inactive/unclean PGs. Persistent degraded states indicate hardware failure or network partitioning.
  4. Latency Metrics: Track apply_latency and commit_latency per OSD. Spikes indicate slow disks, journal saturation, or network congestion.
# Quick health summary commands
ceph -s                    # Overall status
ceph osd df                # Per-OSD utilization
ceph pg stat               # Placement group states
ceph tell osd.* bench      # Live performance test (use cautiously)
Cluster Health Decision Treeceph -s OutputHEALTH_ERR?YESNOIMMEDIATE ACTIONCheck down OSDs,network, disk failuresHEALTH_WARN?INVESTIGATE SOONNearfull OSDs, slow ops,degraded PGsHEALTH_OK ✓NO WARNINGS
Operational decision tree for Ceph Storage Fundamentals: prioritize HEALTH_ERR immediately, investigate HEALTH_WARN within hours, and verify HEALTH_OK regularly.

Safe Upgrade and Maintenance Procedures

Always upgrade in order: Monitors → Managers → OSDs → Clients. Never skip versions. Before upgrading OSDs, set noout/norebalance flags to prevent unnecessary data movement during rolling restarts:

# Pre-upgrade safety flags
ceph osd set noout
ceph osd set norebalance
ceph osd set nobackfill

# After successful OSD upgrade on all nodes
ceph osd unset noout
ceph osd unset norebalance
ceph osd unset nobackfill

For Nepal-based deployments where power stability varies, ensure UPS coverage for all MON and OSD nodes. Unexpected power loss during write operations can corrupt BlueStore metadata. Journal/WAL devices should be on battery-backed NVMe or protected capacitor-backed SSDs.

Implementing Ceph Storage Fundamentals in Production

Ceph Storage Fundamentals translate theory into operational reality through disciplined configuration, appropriate workload mapping, and vigilant monitoring. Start with replicated pools for critical application data, reserve erasure coding for archival workloads, and integrate via S3 APIs when possible to maintain portability. Whether you're building eCommerce platforms handling product imagery or legal-tech systems managing sensitive documents, Ceph provides infrastructure independence that cloud vendors cannot match.

If you're evaluating distributed storage for a production web system or need assistance architecting a resilient storage layer for your application, reach out to discuss your infrastructure requirements. Proper storage architecture decisions made early prevent costly migrations later.

Frequently Asked Questions

Ceph is a software-defined, distributed object storage system that unifies block, file, and object storage on commodity hardware. Unlike proprietary SANs requiring expensive controllers, Ceph uses CRUSH algorithms to distribute data across standard servers, eliminating single points of failure while scaling horizontally without vendor lock-in or per-TB licensing fees.

Production clusters need at least three monitor nodes for quorum and separate OSD nodes with dedicated SSDs for journals or WAL/DB partitions. Each OSD requires one physical disk; never use RAID controllers as Ceph handles redundancy natively. Minimum 10GbE networking is mandatory; 25GbE recommended for NVMe backends to prevent network bottlenecks during recovery operations.

Ceph software is free under LGPL, but total cost includes enterprise-grade hardware, 10/25GbE switches, and skilled administration time. Expect Rs 8-15 lakhs (USD 6,000-11,000) per node for production-ready hardware. While upfront CapEx exceeds basic NAS, five-year TCO typically undercuts proprietary SANs by 40-60% at petabyte scale due to zero licensing fees.

Technically possible but strongly discouraged for production. Virtualized OSDs introduce double abstraction layers causing severe performance penalties during rebalancing and recovery. Monitor nodes tolerate virtualization, but OSDs require direct disk access via passthrough or bare metal. In my experience managing storage infrastructure, VM-based Ceph consistently fails under load during node failures when you need reliability most.

RBD provides block storage volumes for VMs and databases with snapshot and clone capabilities. CephFS offers POSIX-compliant distributed filesystem access for shared file workloads. RGW implements S3/Swift-compatible object storage APIs for application data and backups. Choose based on access pattern: RBD for structured block I/O, CephFS for legacy file applications, RGW for cloud-native object workflows and backup targets.

Minimum three OSDs across three hosts for basic replication with size=2/min_size=1. Production deployments should target 10+ OSDs minimum to distribute recovery load and avoid cascading failures during rebuilds. Plan capacity so no single OSD failure pushes utilization above 75%, as recovery traffic competes with client I/O. Larger clusters handle failures more gracefully through better data distribution.

Degraded state indicates incomplete placement groups during rebalancing. Check ceph health detail for specific PG states like peering or backfilling. Common causes include insufficient network bandwidth during recovery, mismatched OSD weights, or failing drives generating read errors. Throttle recovery with osd_recovery_max_active and osd_recovery_sleep_hdd to reduce client impact. Monitor progress via ceph -w and verify all OSDs show up/in status before investigating deeper issues.

Separate WAL and DB partitions onto dedicated NVMe devices using bluestore_wal_devices and bluestore_db_devices configuration. Set osd_memory_target appropriately (typically 4-8GB per OSD). Enable compression only if CPU headroom exists. Use 25GbE+ networking with jumbo frames enabled end-to-end. Tune pg_num based on OSD count and expected pool size. Benchmark with fio before production to validate throughput meets workload requirements under realistic conditions.

Often overkill below 50TB unless you specifically need unified storage protocols or anticipate rapid growth. Three-node minimum plus 10GbE switching creates significant baseline cost. For smaller deployments, consider ZFS replication, MinIO for object-only needs, or TrueNAS Scale which bundles Ceph with management tooling. Ceph shines above 100TB where horizontal scaling economics justify operational complexity. Evaluate whether your team has storage engineering expertise before committing to smaller Ceph deployments.

Default size=3/min_size=2 stores three copies, tolerating one OSD failure during normal operation and two during active recovery. Erasure coding (e.g., k=4/m=2) reduces overhead to 1.5x while maintaining similar durability, suitable for cold data or large objects. Never set min_size=1 in production as it risks data loss during simultaneous failures. Match replication strategy to data criticality and available budget; test failure scenarios regularly to validate actual durability matches theoretical guarantees.

Prometheus with ceph-exporter remains the standard for metrics collection, paired with Grafana dashboards from the official ceph-mixin repository. Enable mgr/prometheus module for native metric exposure. Alert on PG states, OSD latency percentiles, space utilization trends, and recovery progress rather than raw capacity alone. Integrate with existing alerting infrastructure via Alertmanager. Avoid relying solely on ceph status; historical trends reveal problems before they cause outages. Regular dashboard reviews catch degradation patterns that point-in-time checks miss entirely.

Ceph uses CephX mutual authentication with rotating keys for all internal communication and client access. Enable messenger v2 protocol for encrypted on-wire traffic. Implement RBAC via caps to restrict keyring permissions per pool and operation type. Network segmentation isolates public and cluster traffic. External integrations use TLS termination at RGW or proxy layers. Audit key usage regularly and rotate compromised credentials immediately. Ceph provides strong foundational security but requires proper configuration; default deployments often leave unnecessary attack surface exposed through overly permissive capabilities.

Yes, via Rook-Ceph operator which automates deployment, scaling, and lifecycle management within Kubernetes clusters. RBD provides dynamic PV provisioning with StorageClasses supporting snapshots and cloning. CSI drivers handle mount operations transparently. Ensure etcd and Rook operator have adequate resources separate from OSD nodes. Test failover scenarios thoroughly as storage disruptions cascade to application pods. Many production Kubernetes platforms now standardize on Rook-Ceph for stateful workloads, though simpler alternatives like Longhorn may suffice for smaller clusters without multi-protocol requirements.

Undersized networks saturate during recovery, starving client I/O. Incorrect pg_num causes uneven data distribution and hot OSDs. Running OSDs on RAID controllers prevents Ceph from managing disk health directly. Insufficient RAM forces excessive disk metadata reads. Mixing drive types without proper class separation creates unpredictable latency. Skipping burn-in testing allows early drive failures during initial population. Neglecting capacity planning leads to emergency expansions under pressure. Most performance issues trace to architectural decisions made during initial deployment rather than runtime tuning; invest time upfront in proper sizing and validation.

Choose Ceph when you need unified block, file, and object protocols from one cluster, require erasure coding with fine-grained control, or operate at multi-petabyte scale with complex tiering policies. MinIO excels for pure S3 workloads with simpler operations and better single-cluster performance under 500TB. GlusterFS suits file-centric workloads without block/object requirements. Ceph's advantage is protocol convergence and mature ecosystem integration; its disadvantage is operational complexity. If object-only suffices and team lacks distributed storage experience, MinIO often delivers faster time-to-value with lower ongoing maintenance burden.

Share this article

Quick Contact Options
Choose how you want to connect me: