> For the complete documentation index, see [llms.txt](https://docs.enginsight.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enginsight.com/docs/knowledge-base/english/pulsar/how-do-i-create-a-cpu-profile-or-ram-profile-for-the-enginsight-pulsar.md).

# How do I create a CPU profile or RAM profile for the Enginsight Pulsar?

If the Enginsight agent Pulsar requires too many CPU resources and/or too much memory on a host, you can create a CPU profile or RAM profile of the Pulsar to analyze exactly where the issue lies.

The procedure for creating these profiles differs depending on which operating system ([Windows](#windows) or [Linux](#linux)) is running on the host on which the corresponding Pulsar is installed.

***

## Windows

Follow these steps if you installed the Pulsar on a Windows host:

{% stepper %}
{% step %}

### Adjust the Pulsar service configuration

1. Log in to the Windows host for whose Pulsar you want to create a profile.
2. Open the Services tool (**services.msc**) as an administrator.
3. Stop the **Enginsight Pulsar** service and the **Enginsight Supervisor** service.
4. Open PowerShell or the Windows command-line tool as an administrator.
5. Adjust the **Enginsight Pulsar** service configuration using the following command:

```
sc.exe config "Enginsight Pulsar" binpath= "C:\Program Files\Enginsight\Pulsar\ngs-pulsar-amd64.exe -profile"
```

{% hint style="danger" %}
**Please note**: The space after `binpath=` is required!
{% endhint %}

6. Start the **Enginsight Pulsar** service again.
   {% endstep %}

{% step %}

### Create a CPU profile

1. Open PowerShell as an administrator.
2. Create the CPU profile using the following command:

```
Invoke-WebRequest "http://localhost:6060/debug/pprof/profile?seconds=<Seconds>" -OutFile profile.out -TimeoutSec <Seconds+10>
```

{% hint style="info" %}
Remember to replace the placeholders `<Seconds>` and `<Seconds+10>` with the measurement period in seconds.
{% endhint %}

{% hint style="danger" %}
**Please note**: The measurement period must be **at least 120 seconds**!
{% endhint %}
{% endstep %}

{% step %}

### Create a RAM profile

1. Open PowerShell as an administrator.
2. Create the RAM profile using the following command:

```
Invoke-WebRequest "http://localhost:6060/debug/pprof/heap" -OutFile heap.out
```

{% endstep %}

{% step %}

### Revert the configuration change for the Pulsar service

After you created a CPU and/or RAM profile, you can revert the configuration change for the **Enginsight Pulsar** service.

1. Open the Services tool (**services.msc**) as an administrator.
2. Stop the **Enginsight Pulsar** service.
3. Open PowerShell or the Windows command-line tool as an administrator.
4. Adjust the **Enginsight Pulsar** service configuration using the following command:

```
sc.exe config "Enginsight Pulsar" binpath= "C:\Program Files\Enginsight\Pulsar\ngs-pulsar-amd64.exe"
```

5. Start the **Enginsight Pulsar** service again.
   {% endstep %}
   {% endstepper %}

***

## Linux

Follow these steps if you installed the Pulsar on a Linux host:

{% stepper %}
{% step %}

### Adjust the Pulsar service configuration

1. Log in to the Linux host for whose Pulsar you want to create a profile.
2. Stop the Pulsar service using the following command:

```
sudo systemctl stop ngs-pulsar
```

3. Open the Pulsar service configuration file using the following command:

```
sudo nano /etc/systemd/system/ngs-pulsar.service
```

4. Navigate to the `ExecStart` line and adjust it as follows:

```
ExecStart=/opt/enginsight/pulsar/ngs-pulsar -profile
```

5. Save the file (**Ctrl** + **o**) and confirm the save process. Close the file (**Ctrl** + **x**).
6. Reload the Pulsar service configuration using the following command:

```
sudo systemctl daemon-reload
```

7. Start the Pulsar service again using the following command:

```
sudo systemctl start ngs-pulsar
```

{% endstep %}

{% step %}

### Create a CPU profile

Create the CPU profile using the following command:

```
curl "http://localhost:6060/debug/pprof/profile?seconds=<Seconds>" > profile.out
```

{% hint style="info" %}
Remember to replace the placeholder `<Seconds>` with the measurement period in seconds.
{% endhint %}

{% hint style="danger" %}
**Please note**: The measurement period must be **at least 120 seconds**!
{% endhint %}
{% endstep %}

{% step %}

### Create a RAM profile

Create the RAM profile using the following command:

```
curl "http://localhost:6060/debug/pprof/heap" > heap.out
```

{% endstep %}

{% step %}

### Revert the configuration change for the Pulsar service

After you created a CPU and/or RAM profile, you can revert the configuration change for the Pulsar service.

1. Stop the Pulsar service using the following command:

```
sudo systemctl stop ngs-pulsar
```

2. Open the Pulsar service configuration file using the following command:

```
sudo nano /etc/systemd/system/ngs-pulsar.service
```

3. Navigate to the `ExecStart` line and remove the `-profile` flag again:

```
ExecStart=/opt/enginsight/pulsar/ngs-pulsar
```

4. Save the file (**Ctrl** + **o**) and confirm the save process. Close the file (**Ctrl** + **x**).
5. Reload the Pulsar service configuration using the following command:

```
sudo systemctl daemon-reload
```

6. Start the Pulsar service again using the following command:

```
sudo systemctl start ngs-pulsar
```

{% endstep %}
{% endstepper %}

***
