> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/cdf/3.1/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/3.1/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
  # -- Top level directory in S3 where CDR files are stored.
  directory: s3directory
  # -- Origin-Host in ACA (Rf).
  hostname: cdf.sample.net
  # -- Origin-Realm in ACA (Rf).
  realm: sample.net
  # -- The wait duration before sending CDR file to S3, in milliseconds. Each CDR is almost 4 kb. The maximum size of the file is 2 Gb. The default value is `"100000"`.
  waitS3: 110000
  # -- 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

storage:
  local:
    persistence:
      # -- Persistent storage, needs a PVC if enabled.
      enabled: true
  # -- Configuration for the S3 storage
  s3:
    # -- Name of the bucket in the S3 storage
    bucket: ccddff
    # -- Endpoint URL to the S3 storage
    endpoint: null
    secret:
      # -- Create a secret with credentials to the S3 storage
      create: false
      # -- Name of the existing secret with credentials to the S3 storage
      name: s3-credentials
      # -- Access Key to the S3 storage, required only when secret is created
      accessKey: ""
      # -- Secret Key to the S3 storage, required only when secret is created
      secretKey: ""
image:
  repository: registry.repository.com/cennso/ercdf
  # -- 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).

## receiver.waitS3

This is the waiting duration before sending a CDR file to S3 in milliseconds. Each CDR is almost 4 kb. The maximum file size is 2 Gb. The default value is `100000`.

Every time CDF sender has to switch from one file to the next, there is a slight delay of about a second. Do not let the receiver send a new file to S3 too often. The default value for sending a new file is set to 100 seconds, which makes a one-second sender delay, provided the sender sends as fast as the receiver receives. It is important to remember the file size limitation of 2 Gb. If the receiver waits too long to send a file when many CDRs arrive, the file becomes too big.
