Kafka is a distributed event streaming platform: producers append events to topics, and many consumers read them independently, at their own pace, with the ability to replay history. It powers activity tracking, change data capture, log pipelines, analytics and event-driven microservices. Self-hosting on VPS servers is practical for teams that understand its operational needs, and it can be far cheaper than managed streaming services at steady volumes.
Key Concepts
- Topics are named event streams, split into partitions for parallelism.
- Each partition is replicated across brokers; one replica is the leader.
- Consumer groups share partitions among consumers; each group tracks its own offsets.
- Retention keeps events for a time or size limit, or forever with log compaction for keyed data.
KRaft Mode
Kafka now manages cluster metadata with its own Raft-based controller quorum (KRaft) instead of ZooKeeper, which was removed in Kafka 4.0. New deployments should use KRaft. In small clusters, nodes can act as both broker and controller; larger clusters often run three dedicated controllers. Older ZooKeeper-based clusters must migrate before upgrading to 4.x, following the official migration guide.
Single Node or Cluster
| Setup | Durability | Use |
|---|---|---|
| One broker (combined mode) | No replication; server loss stops the stream | Development, testing, non-critical pipelines |
| Three brokers | Replication factor 3, survives one broker failure with writes continuing | Production |
Place brokers on separate servers with low-latency private networking in the same region.
Durability Settings
- Topics: replication factor 3 and
min.insync.replicas=2. - Producers:
acks=alland idempotence enabled (the default in recent clients), with retries. - Disable unclean leader election so out-of-date replicas cannot become leaders and lose data.
- Consumers: commit offsets after processing, and make processing idempotent, since replays and rebalances can deliver events again.
Partitions
The number of partitions limits consumer parallelism within a group: ten partitions allow up to ten active consumers. Choose a number that covers expected growth, because increasing partitions later changes how keys map to partitions. Avoid thousands of tiny partitions on small clusters; each adds overhead.
Retention and Disk Planning
Disk usage is roughly: ingest rate × retention period × replication factor, plus headroom. For example, 2 MB/s for 7 days with replication factor 3 needs about 3.6 TB across the cluster before headroom. Use fast NVMe, monitor free space carefully (a full disk takes a broker offline), and lower retention or add brokers before you run out. Consider tiered storage features in recent versions for long retention, where supported by your setup.
Memory: Heap and Page Cache
Kafka relies heavily on the operating system's page cache for fast reads of recent data. Give the JVM a moderate heap (a few gigabytes is common) and leave the rest of RAM free for the page cache. Avoid swap for broker processes, and do not co-locate memory-hungry services on brokers.
Security
- Use TLS for client and inter-broker listeners across networks.
- Authenticate clients with SASL (SCRAM or mutual TLS).
- Use ACLs so each service can only read or write its topics.
- Keep broker and controller ports on private networks.
Ecosystem Tools
Common companions include a schema registry for Avro, Protobuf or JSON schemas, Kafka Connect for moving data in and out of databases and storage, and web UIs for browsing topics and consumer groups. Each is another service to secure and size; add them only when needed.
Monitoring
Expose JMX metrics through an exporter for Prometheus. Alert on under-replicated and offline partitions, active controller count, request latency, disk usage, and consumer lag for important groups. Consumer lag is often the first sign that a downstream service is failing (see our monitoring guide).
Upgrades and Maintenance
Perform rolling upgrades one broker at a time, waiting for partitions to be fully replicated before moving on. Read the upgrade notes for each release, especially around metadata versions. Rebalance partitions when adding brokers, and test failure scenarios (stopping a broker) in staging.
Do You Need Kafka?
Kafka is powerful but operationally heavy. For job queues with acknowledgement and routing, RabbitMQ is often simpler (see our RabbitMQ guide). For modest event streams, Redis Streams or NATS JetStream may be enough. Kafka-compatible alternatives such as Redpanda offer the Kafka API with a different architecture. Choose Kafka when you need high throughput, long retention and many independent consumers.
Sizing
| Setup | Suggested plans |
|---|---|
| Development or small non-critical pipeline | 1 × 4 vCores / 16 GB |
| Production with moderate throughput | 3 × 8 vCores / 32 GB with NVMe |
| High throughput or long retention | More brokers or dedicated servers with large disks |
Example: Analytics Events
A consumer app sends click and purchase events to a three-broker KRaft cluster on 8 vCore / 32 GB VPS servers. The events topic has 12 partitions, replication factor 3 and 7-day retention. A stream processor builds real-time dashboards, Kafka Connect writes events to an analytics database, and alerts fire when consumer lag exceeds five minutes.
Common Mistakes
- Single-broker production with no replication.
- Replication factor 3 but
acks=1producers. - Huge JVM heaps that starve the page cache.
- No disk alerts until a broker fills up.
- Choosing Kafka for simple job queues.
In Short
Use KRaft, three brokers for production, replication factor 3 with min.insync.replicas 2 and acks=all, plan disks for retention, leave RAM for page cache, secure listeners, and watch replication and consumer lag.
SkyRainCloud Plans for This Workload
Kafka loves RAM for page cache and fast disks. A single 4 vCore / 16 GB broker suits development and modest workloads; production clusters typically use three 8 vCore / 32 GB brokers with ample NVMe.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.
Frequently Asked Questions
Does Kafka still need ZooKeeper?
How many brokers does production Kafka need?
What replication settings should I use?
How much disk does Kafka need?
How much JVM heap should Kafka have?
How many partitions should a topic have?
What is consumer lag?
How should Kafka be secured?
Is Kafka better than RabbitMQ?
Which plans suit Kafka?
Related Guides
- VPS Hosting for RabbitMQ
- How to Host Background Workers and Queue Processing Systems on a VPS
- VPS Hosting for Webhook Processing Systems
- How to Set Up Monitoring and Logging for Applications on a VPS
- Best VPS Hosting in India with NVMe SSD
- Run BullMQ Workers on a VPS: Redis Queues for Node.js
- Run Selenium Grid on VPS Servers for Parallel Browser Tests