# Analyze Discourse performance using NGINX logs

**URL:** <https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117>\
**Category:** Self-Hosting\
**Tags:** how-to\
**Created:** [6월 17, 2015, 6:26오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117 "2015-06-17T06:26:46Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![ljpp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ljpp/32/96506_2.png) [@ljpp](https://meta.discourse.org/u/ljpp)\
**Post date:** [1월 21, 2016, 10:21오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/22 "2016-01-21T22:21:56Z")

</div>

```plaintext
Top 30 not found urls (404s)

Url Count
--- -----
GET /uploads/favicon/favicon.ico HTTP/1.1 388 
GET /uploads/favicon/manifest.json HTTP/1.1
```

Background: I created a folder for favicons under uploads. Then I use a [favicon generator](https://realfavicongenerator.net/) to generate a bunch of favicons and a complete declaration HTML:

The favicon seems to work, but it puzzles me why the .ico & .json appear as 404? The .PNG files work.

Discourse 1.5 beta branch and Docker setup.

---

<div class="post-metadata">

**Author:** ![Yuun](https://avatars.discourse-cdn.com/v4/letter/y/977dab/32.png) [@Yuun](https://meta.discourse.org/u/Yuun)\
**Post date:** [3월 21, 2016, 12:44오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/23 "2016-03-21T00:44:29Z")

</div>

Question about something I’m seeing in reports:

Over the past week my instance has been having some sporadic performance issues, which appears to coincide with significantly larger than normal Anonymous entries in the NGINX reports.

e.g., normal day:

```plaintext
Top 30 users by Server Load

Username Duration Reqs Routes                                                                          
-------- -------- ---- ------                                                                          

[Anonymous] 646.15 2862 topics/show(252.48) categories/index(204.90) -(60.69) user_avatars/show(34.32)   
                          topics/feed(12.88)  

```

```plaintext
Top 100 routes by Server Load

Route Duration Reqs Mobile      
----- -------- ---- ------      
topics/show 408.92 1464 136 (9.29)% 
categories/index 351.09 637 45 (7.06)% 
user_avatars/show 164.52 2470 426 (17.25)% 
topics/timings (POST) 128.37 2581 655 (25.38)% 
list/latest 73.90 358 52 (14.53)% 
- 60.69 635 68 (10.71)% 
...
- (POST) 0.27 27 3 (11.11)% 

```

But yesterday, when we were having some issues:

```plaintext
Top 30 users by Server Load

Username Duration Reqs Routes                                                                          
-------- -------- ---- ------                                                                          

[Anonymous] 11747.63 9557 - (POST)(5430.92) -(5104.66) topics/show(609.38) categories/index(256.95)        
                          user_avatars/show(148.13)                                                        

```

```plaintext
Top 100 routes by Server Load

Route Duration Reqs Mobile      
----- -------- ---- ------      
- (POST) 5430.92 6576 3 (0.05)% 
- 5104.66 609 45 (7.39)% 
user_avatars/show 764.95 2279 353 (15.49)% 
topics/timings (POST) 761.55 1791 153 (8.54)% 
topics/show 750.75 1386 175 (12.63)% 
draft/update (POST) 441.09 508 5 (0.98)% 
categories/index 426.02 341 26 (7.62)% 
list/latest 206.17 464 53 (11.42)% 

```

Am I making a bad assumption when I think this is _probably_ not valuable traffic? Some sort of bot or whatnot? Haven’t had an increase any new users or anything, a little more (maybe ~10%) more usage from actual members over the past couple weeks.

It’s just really annoying, our setup is fine for our normal and even our high activity levels, but it hasn’t been holding up well over the past week.

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [6월 24, 2016, 9:31오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/24 "2016-06-24T21:31:46Z")

</div>

Hey, first of all I really love this feature, well done! ❤

But this log leaks api\_keys to moderators, if an api\_key request gets to the “Top 30 urls by Server Load”, since the topic sits at the staff category.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [7월 19, 2016, 1:17오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/25 "2016-07-19T13:17:49Z")

</div>

This is implemented in

[https://github.com/discourse/discourse/commit/85d7526219655ff9d9a28cf618ab24555cacc5d0](https://github.com/discourse/discourse/commit/85d7526219655ff9d9a28cf618ab24555cacc5d0)

---

<div class="post-metadata">

**Author:** ![frictionel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frictionel/32/299701_2.png) [@frictionel](https://meta.discourse.org/u/frictionel)\
**Post date:** [9월 20, 2016, 3:24오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/26 "2016-09-20T15:24:47Z")

</div>

Mmh, is it just me or has the nginx-log changed? My site sends the request correctly, it wouldn’t work otherwise:

```
GET /latest.json?api_key=xxxAPI_KEYxxx&api_username=anonymous

```

But since some older 1.7 beta (3?) the api\_key is leaked again because the order is different (according to the performance report):

```
GET /latest.json?xxxAPI_KEYxxx=[FILTERED]&api_username=anonymous

```

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [9월 20, 2016, 10:27오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/27 "2016-09-20T22:27:08Z")

</div>

Hmm you should look into this @tgxworld

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [9월 23, 2016, 3:40오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/28 "2016-09-23T03:40:42Z")

</div>

Thanks for reporting.

One of the commits I pushed broke it ☹

[https://github.com/discourse/discourse/commit/4895723f7b812d1db4b91ec3c12dc3ef6cf655fa](https://github.com/discourse/discourse/commit/4895723f7b812d1db4b91ec3c12dc3ef6cf655fa)

---

<div class="post-metadata">

**Author:** ![sashailinsky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sashailinsky/32/56795_2.png) [@sashailinsky](https://meta.discourse.org/u/sashailinsky)\
**Post date:** [10월 26, 2016, 12:28오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/29 "2016-10-26T00:28:02Z")

</div>

I accidentally deleted Staff category. Where the bot will post logs?

---

<div class="post-metadata">

**Author:** ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)\
**Post date:** [10월 26, 2016, 10:45오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/30 "2016-10-26T10:45:06Z")

</div>

You can’t if you are not be able to create a new `category_staff_id` via rails C.  
Unfortunately my systeam is not familiar with ruby ​​on rails commands as he knows docker, but if you find a solution please, share it.

For references:

> [@Daily performance reports keep asking to rebuild container](https://meta.discourse.org/t/daily-performance-reports-keep-asking-to-rebuild-container/38311/19):
>
> You need to set the hidden site setting staff\_category\_id to the ID of the new staff category. There’s no UI to do this (because it’s hidden, you’re not supposed to change it), so you need to muck with request editing confused

> [@How to "migrate" Discourse to Discourse without Site Settings](https://meta.discourse.org/t/how-to-migrate-discourse-to-discourse-without-site-settings/49741/10):
>
> It’s a “hidden” site setting - you can only set it from the Rails console, I think?

---

<div class="post-metadata">

**Author:** ![SystemZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/systemz/32/88354_2.png) [@SystemZ](https://meta.discourse.org/u/SystemZ)\
**Post date:** [5월 11, 2017, 8:56오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/31 "2017-05-11T08:56:51Z")

</div>

I tried to use `nginx_analyze.rb` script to analize strange traffic to my v1.8.0.beta11 forum but didn’t find it in `/var/www/discourse/script` after `./launcher enter app`.  
It was moved somewhere or removed?

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [5월 11, 2017, 8:58오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/32 "2017-05-11T08:58:17Z")

</div>

The nginx analyzer was moved into a plugin. I’ve updated the OP so you can find the updated path there.

---

<div class="post-metadata">

**Author:** ![SystemZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/systemz/32/88354_2.png) [@SystemZ](https://meta.discourse.org/u/SystemZ)\
**Post date:** [5월 11, 2017, 9:05오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/33 "2017-05-11T09:05:59Z")

</div>

Ok, it works. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)\
**Post date:** [8월 9, 2017, 11:10오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/34 "2017-08-09T11:10:08Z")

</div>

> [@sam](#):
>
> Top 30 IPs by server load
> 
> Which IPs are responsible for the largest amount of CPU time?
> 
> IP Address Duration
> 
> * * *
> 
> 100.43.90.12 16.71  
> 10.66.0.21 7.45  
> 10.66.0.22 7.31  
> … etc …

I’m running the container behind an outer NGINX reverse proxy and I cannot seem to get the above type listing of server load by IP. When I link the container via unix socket, I get this:

```plaintext
Top 30 IPs by Server Load

IP Address Duration Reqs
---------- -------- ----
unix: 127.97 1239 
----------------------------------------------------------------------------------------------------

```

And when I do it via TCP/IP, I get this:

```plaintext
Top 30 IPs by Server Load

IP Address Duration Reqs
---------- -------- ----
 172.17.0.1 166.27 1712 
----------------------------------------------------------------------------------------------------

```

Since that IP is a private IP, the latter probably has something to do with my VPS provider has set things up, but is it by design that the unix socket eats the client IPs?

---

<div class="post-metadata">

**Author:** ![Roman\_Burdakov](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman_burdakov/32/120728_2.png) [@Roman\_Burdakov](https://meta.discourse.org/u/Roman_Burdakov)\
**Post date:** [9월 6, 2017, 2:03오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/35 "2017-09-06T14:03:34Z")

</div>

Hi there. I’m trying to enable performance reports for Discourse SaaS installed from Amazon Marketplace. First of all, I don’t see launcher anywhere on the server, thus I can perform:  
`cd /var/discourse`  
`./launcher rebuild app`

`/opt/bitnami/ctlscript.sh` seems to be closest to launcher, but it is missing `rebuild`, `enter` commands.

Can someone provide alternative instructions for SaaS offering? Thanks.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [9월 6, 2017, 11:06오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/36 "2017-09-06T23:06:14Z")

</div>

We only support the Docker based installs here, sorry!

---

<div class="post-metadata">

**Author:** ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)\
**Post date:** [9월 9, 2017, 5:02오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/37 "2017-09-09T05:02:44Z")

</div>

Bitnami is great for many things, but they don’t update their images often enough to be able to keep up with Discourse (and docker) updates. As a result you’re really on your own as far as support and maintenance is concerned. I learned this the hard way myself.

While I know this is not ideal, I’d recommend you move your installation to one that’s supported by the Discourse community. You can find suitable hosting [here](https://payments.discourse.org/pricing), [here](https://www.communiteq.com/) or [here](https://meta.discourse.org/c/hosting), build a clean image, install docker, install discourse and import the existing community via the discourse backup/restore function.

It’ll be worth it in the long run.

---

<div class="post-metadata">

**Author:** ![MikeNolan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikenolan/32/297597_2.png) [@MikeNolan](https://meta.discourse.org/u/MikeNolan)\
**Post date:** [4월 4, 2023, 10:10오후 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/38 "2023-04-04T22:10:42Z")

</div>

nginx 로그 분석 플러그인이 사라졌나요?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [4월 5, 2023, 12:57오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/39 "2023-04-05T00:57:55Z")

</div>

오, 이건 정말 오래되었네요.

@tgxworld가 플러그인으로 옮긴 것 같고, 나중에 그 플러그인을 제거한 것 같습니다. 코드가 어디로 갔을지 궁금하네요.

이 이슈에 #stale 태그를 붙이고 상단에 큰 경고 메시지를 추가하겠습니다.

---

<div class="post-metadata">

**Author:** ![MikeNolan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikenolan/32/297597_2.png) [@MikeNolan](https://meta.discourse.org/u/MikeNolan)\
**Post date:** [4월 5, 2023, 1:36오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/40 "2023-04-05T01:36:56Z")

</div>

옛날 이야기를 다시 꺼내는 건 아니지만, 지원 부족 같은 이유로 중단된 건가요?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [4월 5, 2023, 4:09오전 UTC](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117/41 "2023-04-05T04:09:39Z")

</div>

너무 오래된 일이라 100% 확신은 못 하겠지만, 1년 뒤에 성능 보고가 300개나 쌓인 토픽에 대해 꽤 많은 사람들이 불만을 제기했던 것 같습니다. 결국 아무도 실제로 그걸 보지 않았던 것으로 드러났죠.

저는 그 문제가 지원 부족보다는 수요 부족에 더 가까웠다고 생각합니다.

[이전 페이지](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117.md?page=1)

[다음 페이지](https://meta.discourse.org/t/analyze-discourse-performance-using-nginx-logs/30117.md?page=3)
