> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/tposs/latest/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/tposs/latest/troubleshooting/cleanup.md).

# Clean-up of sessions and IPs

If you are running different test scenarios in your environment, you might need to clean up the TPOSS internal state. To clean up all the active network and service sessions and their related IP addresses, use the following command in the TPOSS [remote console](https://docs.cennso.com/components/tposs/latest/troubleshooting/diagnosis-ui.md):

```elixir
Tposs.ReplHelpers.clean_sessions()
```

## Disable clean-up of outdated service sessions

TPOSS can automatically clean up outdated service sessions. However, running this cleanup too often with too many outdated service sessions can negatively affect database performance and resource consumption. To avoid deleting too many sessions at once, you can disable the cleanup service without restarting TPOSS. To do so, run the following command in the TPOSS remote console:

```elixir
Tposs.Pcs.ScgCleanupService.disable_service_session_cleanup_service()
```

In the next maintenance window, you can adjust the service session cleanup to delete fewer outdated sessions at once. To do so, increase the session deletion limit and shorten the check intervals. For more information, read the related configuration options description in the [Automatic service session cleanup](https://docs.cennso.com/components/tposs/latest/configuration/session.md#automatic-service-session-cleanup) section.
