kamax-matrix / matrix-appservice-email

Matrix <--> E-mail Bridge
GNU Affero General Public License v3.0
39 stars 11 forks source link

Don't spam /joined_members endpoint #18

Closed turt2live closed 7 years ago

turt2live commented 7 years ago

In higher population rooms, spamming joined_members every couple milliseconds leads to higher than normal load on the server.

Here's a snippet from the log:

2017-10-03 00:11:16,995 - synapse.access.http.8008 - 91 - INFO - GET-3042- - - 8008 - {@_email:t2bot.io} Processed request: 5ms (7ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,023 - synapse.access.http.8008 - 91 - INFO - GET-3043- - - 8008 - {@_email:t2bot.io} Processed request: 6ms (0ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,033 - synapse.access.http.8008 - 91 - INFO - GET-3044- - - 8008 - {@_email:t2bot.io} Processed request: 5ms (0ms, 3ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,159 - synapse.access.http.8008 - 91 - INFO - GET-3032- - - 8008 - {@_email:t2bot.io} Processed request: 503ms (56ms, 0ms) (115ms/12) 85749B 200 "GET /_matrix/client/r0/rooms/!DgvjtOljKujDBrxyHk:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,588 - synapse.access.http.8008 - 91 - INFO - GET-3050- - - 8008 - {@_email:t2bot.io} Processed request: 5ms (8ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,799 - synapse.access.http.8008 - 91 - INFO - GET-3047- - - 8008 - {@_email:t2bot.io} Processed request: 569ms (60ms, 7ms) (163ms/12) 85749B 200 "GET /_matrix/client/r0/rooms/!DgvjtOljKujDBrxyHk:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:17,867 - synapse.access.http.8008 - 91 - INFO - GET-3053- - - 8008 - {@_email:t2bot.io} Processed request: 5ms (4ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:18,182 - synapse.access.http.8008 - 91 - INFO - GET-3056- - - 8008 - {@_email:t2bot.io} Processed request: 6ms (4ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:18,552 - synapse.access.http.8008 - 91 - INFO - GET-3058- - - 8008 - {@_email:t2bot.io} Processed request: 6ms (4ms, 0ms) (0ms/0) 20864B 200 "GET /_matrix/client/r0/rooms/!UcYsUzyxTGDxLBEvLz:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"
2017-10-03 00:11:18,616 - synapse.access.http.8008 - 91 - INFO - GET-3054- - - 8008 - {@_email:t2bot.io} Processed request: 732ms (55ms, 0ms) (555ms/12) 85749B 200 "GET /_matrix/client/r0/rooms/!DgvjtOljKujDBrxyHk:matrix.org/joined_members?access_token=<redacted> HTTP/1.1" "Apache-HttpClient/4.5.3 (Java/1.8.0_144)"