# LinuxParametersProps

The properties for defining Linux-specific options that are applied to the container.

Extends: LinuxParametersProps
Used as props by: LinuxParameters

- Source: [`aws-ecs/lib/linux-parameters.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/linux-parameters.ts#L13)
- Type last changed: v2.41.0 · 8 Sep 2022

## Example

```ts
declare const taskDefinition: ecs.TaskDefinition;

taskDefinition.addContainer('container', {
  image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
  memoryLimitMiB: 1024,
  linuxParameters: new ecs.LinuxParameters(this, 'LinuxParameters', {
    initProcessEnabled: true,
    sharedMemorySize: 1024,
    maxSwap: Size.mebibytes(5000),
    swappiness: 90,
  }),
});
```

## Properties

- `initProcessEnabled`: boolean = false — Specifies whether to run an init process inside the container that forwards signals and reaps processes.

- `maxSwap`: [Size](/cdk/api/v2/docs/aws-cdk-lib.Size.html) — The total amount of swap memory a container can use.

  **Default:** No swap.

  This parameter
  will be translated to the --memory-swap option to docker run.

  This parameter is only supported when you are using the EC2 launch type.
  Accepted values are positive integers.

- `sharedMemorySize`: number — The value for the size of the /dev/shm volume.

  **Default:** No shared memory.

- `swappiness`: number = 60 — This allows you to tune a container's memory swappiness behavior.

  This parameter
  maps to the --memory-swappiness option to docker run. The swappiness relates
  to the kernel's tendency to swap memory. A value of 0 will cause swapping to
  not happen unless absolutely necessary. A value of 100 will cause pages to
  be swapped very aggressively.

  This parameter is only supported when you are using the EC2 launch type.
  Accepted values are whole numbers between 0 and 100. If a value is not
  specified for maxSwap then this parameter is ignored.
