> For the complete documentation index, see [llms.txt](https://manual.docs.microstream.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manual.docs.microstream.one/3.0/data-store/configuration/using-channels.md).

# Using Channels

{% hint style="warning" %}
**This is the manual for older MicroStream versions (Version < 5.0).**

**The new documentation (Version >= 5.0) is located at:**

[https://docs.microstream.one/](https://docs.microstream.one/manual)
{% endhint %}

## Channel Usage

[Channels](/3.0/data-store/configuration/properties.md#channelcount) are the IO threads used by the MicroStream storage engine. A single channel represents the unity of a thread, a storage directory and cached data. Increasing the number of channels means to run more IO threads.

The channel count is an important configuration value that impacts to IO performance.&#x20;

## Channel Configuration

For the channel configuration the following configuration [properties ](/3.0/data-store/configuration/properties.md)are available:

* **Channel count**

  The number of channels that MicroStream will use. Must be  $$2^n$$&#x20;
* **Channel directory prefix**

  The channel directory will be prefix+channelNumber e.g. "ch\_0" if prefix is "ch\_"
* **Data file prefix**\
  default is "channel\_"
* **Data file suffix**\
  deflaut id ".dat"

Channel file size configuration is done by the the [Storage Data File Evaluator](/3.0/data-store/configuration/housekeeping.md#file-sizes-and-payload).

They can be set By  `storage.embedded.configuration API:`&#x20;

{% tabs %}
{% tab title="Java" %}

```java
embeddedStorageManager storageManager = Configuration.Default()
	.setChannelCount(4)
	.setChannelDirectoryPrefix("channel_")
	.setDataFilePrefix("channel_")
	.setDataFileSuffix(".bin")
	.createEmbeddedStorageFoundation()
	.createEmbeddedStorageManager();
```

{% endtab %}

{% tab title="Xml" %}

```
<properties>
	<property name="channelCount" value="4" />
	<property name="channelDirectoryPrefix" value="channel_" />
	<property name="dataFilePrefix value="channel_" />
	<property name="dataFileSuffix" value=".dat" />
</properties>
```

{% endtab %}

{% tab title="ini" %}

```
channelCount = 4
channelDirectoryPrefix = prefix
dataFilePrefix = channel_
dataFileSuffix = .dat
```

{% endtab %}
{% endtabs %}

See also: [Configuration](/3.0/data-store/configuration.md#external-configuration)

Or by setting a `StorageFileProvider` using the`EmbeddedStorageFoundation`factory

```java
EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
	Storage.ConfigurationBuilder()
		.setChannelCountProvider(Storage.ChannelCountProvider(4))
		.setStorageFileProvider(StorageFileProvider.Builder()
			.setBaseDirectory("storage")
			.setChannelDirectoryPrefix("prefix")
			.setStorageFilePrefix("channel-")
        	.setStorageFileSuffix(".bin")
			.createFileProvider()).createConfiguration()
		).start();
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://manual.docs.microstream.one/3.0/data-store/configuration/using-channels.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
