public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Mark Wielaard via Overseers <overseers@sourceware.org>
Cc: patchwork-admin@sourceware.org
Subject: Re: mysql/patchwork overload
Date: Wed, 27 Dec 2023 20:44:31 +0100	[thread overview]
Message-ID: <20231227194431.GM6896@gnu.wildebeest.org> (raw)
In-Reply-To: <20231226052804.GI6896@gnu.wildebeest.org>

On Tue, Dec 26, 2023 at 06:28:04AM +0100, Mark Wielaard via Overseers wrote:
> I haven't done a full analyzis yet, but from aprox 03:53 to 04:33 UTC
> mysqld was completely overloaded taking 20+ cores are 100%. At the
> same time patchwork was sending 1000+ emails to the patchwork admins
> about being unable to access mysql. So I assume this was a spider/bot
> attack on patchwork. But it also took out bugzilla.

We don't seem to keep a log of slow mysqld queries, and I don't have
root user access to the database. But I think I found the issue(s)
looking at the httpd logs.

First there was one ipv6 (block) 2404:c140:1f00:8::0/64 that abused
the bugzilla rest api. The queries timed out (after a minute) with a
504, but still seemed to keep mysql busy taking up 1 core for tens of
minutes. I put it on the block.include list.

Second bots seemed to keep hitting the patchwork lists using different
orderings, searching for different submitters, delegates, etc. I added
the following to the robots.txt:

commit d11ea11bfa1cbbeb84423d707d58445a41b0ff21
Author: Mark Wielaard <mark@klomp.org>
Date:   Wed Dec 27 19:35:38 2023 +0000

    robots.txt add user, register, mail and various list params

diff --git a/htdocs/robots.txt b/htdocs/robots.txt
index 72c192e..b47f80a 100644
--- a/htdocs/robots.txt
+++ b/htdocs/robots.txt
@@ -1,3 +1,11 @@
 User-Agent: *
 Disallow: /api/
+Disallow: /user/
+Disallow: /register/
+Disallow: /mail/
+Disallow: /project/*/list/?*order=
+Disallow: /project/*/list/?*series=
+Disallow: /project/*/list/?*submitter=
+Disallow: /project/*/list/?*delegate=
+Disallow: /project/*/list/?*param=
 Crawl-Delay: 5


      reply	other threads:[~2023-12-27 19:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26  5:28 Mark Wielaard
2023-12-27 19:44 ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231227194431.GM6896@gnu.wildebeest.org \
    --to=mark@klomp.org \
    --cc=overseers@sourceware.org \
    --cc=patchwork-admin@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).