> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/cdf/4.0/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/cdf/4.0/configuration/ext_receiver.md).

# Extended CDF receiver configuration

This document explains which receiver parameters you can configure and how you can use them to change the throughput.

The receiver must handle the incoming charging records so the receive buffers must be big enough to handle them. When the receiver is overloaded, it must gracefully decline new records to correctly store the ones in progress. If one receiver is not fast enough, you can add more. Also, setting the size of CDR files can influence the overall performance.

This is a sample extended configuration of CDF receiver.

```yaml
receiver:
  enabled: true
  # -- Origin-Host in ACA (Rf).
  hostname: cdf.sample.net
  # -- Origin-Realm in ACA (Rf).
  realm: sample.net
  # -- The number of simultaneously incoming charging data (ACR) that is allowed. The default value is `"1000"`.
  simultaneousIncoming: 2000
  transportOptions:
    # Rf transport type. It can be either "tcp" or "sctp".
    transportType: tcp
    # The size of socket send buffer for Diameter Rf from SMC in bytes. The default value equals the operating system settings.
    receiveBuffer: 32000
    # The size of socket send buffer for Diameter Rf towards SMC in bytes. The default value equals the operating system settings.
    sendBuffer: 23000
    # -- Diameter Rf port.
    port: 4000
    # -- If true, the local binding address {IP,Port} of the socket can be reused immediately.
    reuseAddress: true
    # -- If true, turns on the Nagle algorithm for merging small packets into larger ones. This improves throughput at the expense of latency.
    nodelay: true

nats:
  url: nats://example.com
  bucket: abucket
  subject: asubject
  streamName: astream
  consumerName: aconsumer
  requestTimeout: 2000

resources:
  cdf:
    limits:
      cpu: 1000m
      memory: 1280Mi

image:
  repository: registry.repository.com/cennso/cdf_receiver
  # -- Set to Chart.AppVersion by default.
  tag: "ttaagg"
  # -- Kubernetes Image Pull Policy. The possible values are: "Always", "IfNotPresent", "Never".
  pullPolicy: Always

logger:
  level: error

# -- Global Acct-Interim-Interval if there is no configuration in APN
interim_interval:
  enabled: true
  seconds: 1800

http:
  enabled: false

```

## receiver.simultaneousIncoming

This is the number of simultaneously incoming charging data records (ACRs) that is allowed. The default value is `1000`.

When the receiver gets more than the default value of simultaneously incoming ACRs, it answers Diameter with `LIMITED_SUCCESS` and does not write these ACRs to the disk. These ACRs are lost unless SMC resends them.

"Simultaneously incoming" means that previous Diameter messages were not answered yet when new messages arrived. The reasons for this are:

- To avoid the receiver becoming too slow to answer Diameter
- To avoid so many ACRs waiting to be stored in RAM
- To avoid CDF being out-of-memory killed.

When a receiver is too slow, it cannot close CDR files at the correct time, which potentially allows them to become too big. If a receiver is getting short bursts of many ACRs, you can increase this value ( the default is `1000`). In this case, a receiver can catch up before the next burst so that no ACR is lost.

## receiver.transportOptions.receiveBuffer

This is the size of the socket send buffer for Diameter Rf from SMC in bytes. The default value equals the operating system settings.

When the receive buffer is too small, the receiver loses the incoming ACRs, which triggers resending. Even though no data is lost, the performance goes down.

## receiver.transportOptions.sendBuffer

This is the size of the socket send buffer for Diameter Rf towards SMC in bytes. The default value equals the operating system settings.

When the send buffer is too small, the receiver loses the outgoing Accounting Answers (ACAs).
