# Gateway timeout Error while Load Testing: User Login--\>Select Team--\> Performs direct chat--\>Logout

**URL:** <https://forum.mattermost.com/t/gateway-timeout-error-while-load-testing-user-login-select-team-performs-direct-chat-logout/2410>\
**Category:** Troubleshooting\
**Created:** [October 25, 2016, 6:08am UTC](https://forum.mattermost.com/t/gateway-timeout-error-while-load-testing-user-login-select-team-performs-direct-chat-logout/2410 "2016-10-25T06:08:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajita](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Ajita](https://forum.mattermost.com/u/Ajita)\
**Post date:** [October 25, 2016, 6:08am UTC](https://forum.mattermost.com/t/gateway-timeout-error-while-load-testing-user-login-select-team-performs-direct-chat-logout/2410/1 "2016-10-25T06:08:03Z")

</div>

Hello  
We have performed load testing using JMeter for 100 users. For the first few requests everything works fine but after sometime Gateway timeout error is encountered.Please refer to screenshot: [http://imageshack.com/i/pnnrBje4p](http://imageshack.com/i/pnnrBje4p)

In the beginning, same APIs run successfully but later the very same APIs return this error (504 Gateway Timeout Error).

We have configured mattermost with AWS server .  
**AWS server details:**  
**Web Server Instance**  
Instance Size: C3 2X large  
**RDS Server Instance**  
db.m4.large

---

<div class="post-metadata">

**Author:** ![crspeller](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/crspeller/32/2605_2.png) [@crspeller](https://forum.mattermost.com/u/crspeller)\
**Post date:** [October 27, 2016, 12:25pm UTC](https://forum.mattermost.com/t/gateway-timeout-error-while-load-testing-user-login-select-team-performs-direct-chat-logout/2410/2 "2016-10-27T12:25:28Z")

</div>

Hi Ajita,

Hard to tell what your problem is without some logs from the Mattermost server. Also are you using a machine running Nginx as we suggest or are you using another proxy like ELB?

For our next release (3.5 November 16) we are doing a big push on performance. If your considering using Mattermost at a scale above 10000 users I would evaluate our current master build. You can find that here: [https://releases.mattermost.com/mattermost-platform/master/mattermost-enterprise-linux-amd64.tar.gz](https://releases.mattermost.com/mattermost-platform/master/mattermost-enterprise-linux-amd64.tar.gz)

We are currently working on a document to help people setup Mattermost at large scale. Some suggestions from that document:

Modify your /etc/init/mattermost.conf to be:

```auto
start on runlevel [2345]
stop on runlevel [016]
respawn
limit nofile 50000 50000
chdir /home/ubuntu/mattermost
setuid ubuntu
exec bin/platform

```

Modify your ulimits on your proxy and Mattermost machines. (by editing /etc/security/limits.conf)

```auto
ulimit -n 65536 65536
ulimit -u 8192 8192

```
