Skip to content

Commit

Permalink
Add more information on vm map count setting (#241)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

Issue link:#[[Link the issue
here](#236)]

### Type of change

- [x] Documentation Update
  • Loading branch information
KevinHuSh committed Apr 7, 2024
1 parent 23b448c commit bb96180
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
### 🚀 Start up the server

1. Ensure `vm.max_map_count` > 65535:
1. Ensure `vm.max_map_count` >= 262144 ([more](./docs/max_map_count.md)):

> To check the value of `vm.max_map_count`:
>
> ```bash
> $ sysctl vm.max_map_count
> ```
>
> Reset `vm.max_map_count` to a value greater than 65535 if it is not.
> Reset `vm.max_map_count` to a value at least 262144 if it is not.
>
> ```bash
> # In this case, we set it to 262144:
Expand All @@ -104,7 +104,7 @@
$ docker compose up -d
```

> The core image is about 15 GB in size and may take a while to load.
> The core image is about 9 GB in size and may take a while to load.
4. Check the server status after having the server up and running:

Expand All @@ -129,7 +129,7 @@
```

5. In your web browser, enter the IP address of your server as prompted and log in to RAGFlow.
> In the given scenario, you only need to enter `http://172.22.0.5` (sans port number) as the default HTTP serving port `80` can be omitted when using the default configurations.
> In the given scenario, you only need to enter `http://IP_of_RAGFlow ` (sans port number) as the default HTTP serving port `80` can be omitted when using the default configurations.
6. In [service_conf.yaml](./docker/service_conf.yaml), select the desired LLM factory in `user_default_llm` and update the `API_KEY` field with the corresponding API key.

> See [./docs/llm_api_key_setup.md](./docs/llm_api_key_setup.md) for more information.
Expand Down
6 changes: 3 additions & 3 deletions README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@
- CPU >= 2 cores
- RAM >= 8 GB
- Docker
> ローカルマシン(Windows、Mac、または Linux)に Docker をインストールしていない場合は、[Docker Engine のインストール](https://docs.docker.com/engine/install/)を参照してください。
> ローカルマシン(Windows、Mac、または Linux)に Docker をインストールしていない場合は、[Docker Engine のインストール](https://docs.docker.com/engine/install/) を参照してください。
### 🚀 サーバーを起動

1. `vm.max_map_count` > 65535 であることを確認する:
1. `vm.max_map_count` >= 262144 であることを確認する[もっと](./docs/max_map_count.md):

> `vm.max_map_count` の値をチェックするには:
>
> ```bash
> $ sysctl vm.max_map_count
> ```
>
> `vm.max_map_count`65535 より大きい値でなければリセットする。
> `vm.max_map_count`262144 より大きい値でなければリセットする。
>
> ```bash
> # In this case, we set it to 262144:
Expand Down
4 changes: 2 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
### 🚀 启动服务器

1. 确保 `vm.max_map_count` 大于 65535
1. 确保 `vm.max_map_count` 不小于 262144 【[更多](./docs/max_map_count.md)

> 如需确认 `vm.max_map_count` 的大小:
>
> ```bash
> $ sysctl vm.max_map_count
> ```
>
> 如果 `vm.max_map_count` 的值不大于 65535,可以进行重置:
> 如果 `vm.max_map_count` 的值小于 262144,可以进行重置:
>
> ```bash
> # 这里我们设为 262144:
Expand Down
66 changes: 66 additions & 0 deletions docs/max_map_count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Set vm.max_map_count to at least 262144

## Linux

To check the value of `vm.max_map_count`:

```bash
$ sysctl vm.max_map_count
```

Reset `vm.max_map_count` to a value at least 262144 if it is not.

```bash
# In this case, we set it to 262144:
$ sudo sysctl -w vm.max_map_count=262144
```

This change will be reset after a system reboot. To ensure your change remains permanent, add or update the `vm.max_map_count` value in **/etc/sysctl.conf** accordingly:

```bash
vm.max_map_count=262144
```

## Mac

```bash
$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
$ sysctl -w vm.max_map_count=262144
```
To exit the screen session, type Ctrl a d.

## Windows and macOS with Docker Desktop

The vm.max_map_count setting must be set via docker-machine:

```bash
$ docker-machine ssh
$ sudo sysctl -w vm.max_map_count=262144
```

## Windows with Docker Desktop WSL 2 backend

To manually set it every time you reboot, you must run the following commands in a command prompt or PowerShell window every time you restart Docker:

```bash
$ wsl -d docker-desktop -u root
$ sysctl -w vm.max_map_count=262144
```
If you are on these versions of WSL and you do not want to have to run those commands every time you restart Docker, you can globally change every WSL distribution with this setting by modifying your %USERPROFILE%\.wslconfig as follows:

```bash
[wsl2]
kernelCommandLine = "sysctl.vm.max_map_count=262144"
```
This will cause all WSL2 VMs to have that setting assigned when they start.

If you are on Windows 11, or Windows 10 version 22H2 and have installed the Microsoft Store version of WSL, you can modify the /etc/sysctl.conf within the "docker-desktop" WSL distribution, perhaps with commands like this:

```bash
$ wsl -d docker-desktop -u root
$ vi /etc/sysctl.conf
```
and appending a line which reads:
```bash
vm.max_map_count = 262144
```
2 changes: 1 addition & 1 deletion rag/app/naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __call__(self, filename, binary=None, from_page=0, to_page=100000):
html += f"<td>{c.text}</td>" if span == 1 else f"<td colspan='{span}'>{c.text}</td>"
html += "</tr>"
html += "</table>"
tbls.append(((None, html), ""))
tbls.append(((None, html), ""))
return [(l, "") for l in lines if l], tbls


Expand Down

0 comments on commit bb96180

Please sign in to comment.