# TiFlash Server Timeout

## Issue

users reported an error when using TiFlash: `TiFlash Server Timeout`. After the user restarted the server, TiFlash returned to normal. After more than 1 hour of use, the same error occurred.

## Resolution

modify the resource limit as follows:

```bash
ulimit -n 1000000

ulimit -u unlimited
```

## Root Cause

From the error log:

```{output}
\[2021/06/15 15:15:32.601 +08:00\] \[ERROR\] \[\] \["MPPHandler: dispatch task meet error: Resource temporarily unavailable"\] \[thread\_id=55\]

\[2021/06/15 15:15:32.601 +08:00\] \[ERROR\] \[\] \["MPPHandler: dispatch task meet error: Resource temporarily unavailable"\] \[thread\_id=56\]

\[ 2021/06/15 15:15:32.601 +08:00\] \[ERROR\] \[\] \["grpc: /tmp/tzg/release-centos7/prepare-environments/grpc/src/cpp/thread\_manager/thread\_manager.cc, line number: 38, log msg: Could not create grpc\_sync\_server worker-thread"\] \[thread\_id=57\] The
```

tiflash log shows that the thread creation of grpc of mpp failed, but there is no specific reason. From the monitoring, it can be confirmed that it is not a connection problem. The positioning is that the ulimit configuration is not enough, which causes the system to limit the number of threads.

## Verified Status

Unverified

## Versions affected

5.0.0 5.0.1

## Impact

medium

## Reference Links

## Meta

Product: [TiDB](https://kb.pingcap.net/articles?product=TiDB)

Components: [TiFlash](https://kb.pingcap.net/articles?component=TiFlash)

Categories: [Troubleshoot](https://kb.pingcap.net/articles?category=Troubleshoot)