> For the complete documentation index, see [llms.txt](https://host2host.onibonje.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://host2host.onibonje.com/docs/32-performance-and-capacity.md).

# Performance and Capacity

## 1. Overview

Non-functional requirements (NFRs) for sizing, throughput, and resilience. Guides infrastructure procurement and HPA settings.

***

## 2. Target NFRs

| Metric                  | Target (per region)   | Notes                  |
| ----------------------- | --------------------- | ---------------------- |
| Payment throughput      | 500 TPS sustained     | Post-Finacle           |
| Bulk file               | 100K lines in < 5 min | Streaming split        |
| API latency p95         | < 2s                  | Excluding Finacle      |
| End-to-end file STP p95 | < 10 min              | 10K line file          |
| Platform availability   | 99.9%                 | Monthly                |
| RPO                     | < 1 min               | Kafka + DB replication |
| RTO                     | < 15 min              | K8s auto-heal          |

***

## 3. Sizing Guidelines

### 3.1 h2h-runtime

| Volume tier | Replicas | CPU    | Memory | Finacle pool |
| ----------- | -------- | ------ | ------ | ------------ |
| Small       | 3        | 2 core | 4 GB   | 20           |
| Medium      | 5        | 4 core | 8 GB   | 40           |
| Large       | 10       | 4 core | 8 GB   | 80           |

HPA: CPU 70%, custom metric `h2h_active_processing_gauge`.

### 3.2 Kafka

| Daily volume | Partitions (payments) | Retention |
| ------------ | --------------------- | --------- |
| < 1M tx      | 12                    | 7 days    |
| 1M–10M       | 48                    | 14 days   |
| > 10M        | 96+                   | 30 days   |

Partition key: `partnerId` for ordering.

### 3.3 PostgreSQL

| Role           | Sizing                                       |
| -------------- | -------------------------------------------- |
| Config DB      | 4 vCPU, 16 GB RAM, SSD                       |
| Transaction DB | 8 vCPU, 32 GB RAM, SSD, read replica for ops |

### 3.4 Finacle

Pool size ≤ Finacle vendor max connections. Circuit breaker prevents pool exhaustion.

***

## 4. Bulk Processing Tuning

| Parameter                   | Source               | Typical |
| --------------------------- | -------------------- | ------- |
| `parallelProcessingThreads` | CustomizationProfile | 8       |
| `streaming`                 | Always on            | true    |
| `splitBatchSize`            | Partner profile      | 500     |

***

## 5. Caching

| Cache          | TTL   | Invalidation     |
| -------------- | ----- | ---------------- |
| Config profile | 5 min | Kafka publish    |
| Customization  | 5 min | Kafka publish    |
| Vault secrets  | 5 min | Rotation webhook |

***

## 6. Load Testing

| Tool         | Scenario                    |
| ------------ | --------------------------- |
| Gatling / k6 | API TPS, sustained load     |
| Custom       | SFTP file upload 100K lines |
| Chaos        | Finacle timeout, pod kill   |

Gate: Phase 5 go-live requires NFR sign-off.

***

## 7. Related Documents

* [17 Monitoring and Logging](/docs/17-monitoring-and-logging.md)
* [38 Deployment Topology](/docs/38-deployment-topology.md)
* [35 Testing Strategy](/docs/35-testing-strategy.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://host2host.onibonje.com/docs/32-performance-and-capacity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
