Commit graph

113 commits

Author SHA1 Message Date
Michal Konecny
04f26a1221 [mailman3] Fix the rest API on mailman
The API didn't work and failed with 500, because the REST framework didn't know
how to render the response. This fixes the issue.

https://pagure.io/fedora-infrastructure/issue/12134

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-08-20 11:57:33 +02:00
Michal Konecny
3209b886ee [mailman3] Remove the duplicated information
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-29 16:25:04 +00:00
Michal Konecny
39d7b07b0c [mailman3] Add more info to generate_search_index script
Add information about number of remaining mailing lists to process to script output.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-29 18:06:12 +02:00
Michal Konecny
be2edf7b47 [mailman3] Add script for generating fulltext index for mailing lists
The index generated by the hyperkitty-hourly script generated unusually big
index (around 1TB).

This script should help with generating the search index from scratch, after
that we can leave it to hyperkitty-hourly job again.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-29 14:41:12 +02:00
Michal Konecny
cabd6b7385 [mailman3] Set logging level for database to warning
The database log is really big even on info level, let' set it manually to
warning to save space and don't generate GB of logs.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-24 10:49:12 +02:00
Michal Konecny
d655c7b366 [mailman3] Update logging for mailman
There was a typo in logging section of mailman configuration, which caused that
only default log files were created.
Also there is separate logging for gunicorn now, let's use that.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-18 11:30:54 +00:00
Michal Konecny
19769b6e77 [mailman3] Add info about disabled search
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-12 11:05:29 +02:00
Michal Konecny
cdd78d1442 [mailman3] Disable search in hyperkitty
Mailman has huge memory spikes after migration, those are caused by visiting
`/archives/search` URL. This is probably because of the search index still being
regenerated.

This patch will disable the search from both web UI and as a HTTP URL endpoint.

Fixes https://pagure.io/fedora-infrastructure/issue/12043

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-12 11:05:18 +02:00
Michal Konecny
a048feb1ea [mailman3] Fix mailmanweb not starting
Remove the `--log-level=debug` as this is causing failure when starting
mailmanweb service.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-11 10:03:49 +02:00
Michal Konecny
e3de4275bd [mailman3] Enable autostart for timers
To be able to enable timer it needs to have WantedBy in [Install] section. Let's
add a hyperkitty.target to that section.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-11 09:32:50 +02:00
Michal Konecny
2f1529f76e [mailman3] Disable sending e-mails on staging
This commit is setting both mailman and hyperkitty to devmode and doesn't allow
them to sent mails anywhere.

I tested that from web UI and using `mail` command on the machine.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-11 09:30:42 +02:00
Kevin Fenzi
1da59362cd mailman: adjust some settings to try and avoid OOM
Set django to have 4 workers and have a retry longer than the timeout.
Disable local memcached and use the memcached01 instance.
Enabled debug logging on gunicorn to see what it's doing.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-07-09 13:27:32 -07:00
Stephen Smoogen
969bbfcf2a Add blockers to dl.fedoraproject.org
Looked at logs of servers being hit by the 'non-responsive' bots and
the following were hit heavily every day multiple times a day:

100006 nagios.fedoraproject.org-access.log
102150 koschei.fedoraproject.org-access.log
162296 lists.fedoraproject.org-access.log
495776 fedoraproject.org-access.log
850471 dl.fedoraproject.org-access.log

Added bloks to dl.fedoraproject to try and lower its hit rate. Others
need review from people who know their internals more.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2024-07-09 09:18:56 +00:00
Stephen Smoogen
7e426dbf37 Add more spiders which do not seem to honour robots.txt
I went through the last couple of logs afer the first round of 'turn
off the spiders' went out. I looked at the areas which the /robots.txt
disregard and then looked for the bots which ignored it and still
looked up stuff in 'accounts'. This may cut down CPU spikes as these
are looking at dynamic data which can 'blow' things up.

It might be good to add similar tooling to pagure and src since they
seem to be hit a lot in the logs also.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2024-07-09 09:18:56 +00:00
Michal Konecny
bebc73c9e3 [mailman3] Fix the syntax error
ansible-playbook is complaining about missing quotes.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-04 09:46:49 +02:00
Michal Konecny
9892b05601 [mailman3] Fix yamllint error
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-04 09:35:42 +02:00
Michal Konecny
2c4f7c6968 [mailman3] Improve the gunicorn setup
Use the recommended CPU*2+1 amount of workers and limit max requests done. After
that the gunicorn reloads itself and free up all the memory.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-04 09:27:46 +02:00
Kevin Fenzi
35902dad8b mailman: lets try 9 workers
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-07-03 13:46:36 -07:00
Kevin Fenzi
95a5a8b6ae mailman: try 15 gunicorn workers
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-07-03 12:36:48 -07:00
Kevin Fenzi
8707b2799d mailman: fix missing }
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-07-03 12:35:49 -07:00
Stephen Smoogen
4937c5be2a Attempt to stop various spiders which do not follow rules.
The ByteSpider and ClaudeBot do not follow robots.txt so need to be
dealt with in other ways.

Signed-off-by: Stephen Smoogen <ssmoogen@redhat.com>
2024-07-03 17:18:06 +00:00
Kevin Fenzi
536e0a71b0 mailman: try adding crawl-delay to robots.txt
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2024-07-03 09:29:22 -07:00
Michal Konecny
61cb8fd515 [mailman3] Add correct permissions to fedora-messaging certificates
The mailman user needs to have access to fedora-messaging certificates to send
messages.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-02 15:54:49 +02:00
Michal Konecny
24eb9a4eda [mailman3] Use the correct mailman certificate
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-02 10:28:17 +02:00
Michal Konecny
05078de742 [mailman3] Use the correct topic prefix
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-02 10:07:37 +02:00
Michal Konecny
deb5a143cd [mailman3] Fix the fedora-messaging config
The fedora-messaging archiver config missed some required values. Let's fix that.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-02 09:55:57 +02:00
Michal Konecny
98417787d6 [mailman3] Fix the YAML error
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-01 18:19:10 +02:00
Michal Konecny
ae8efd0dd4 [mailman3] Fix the yamllint errors
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-01 18:04:42 +02:00
Michal Konecny
319bc2204a [mailman3] Add fedora-messaging certificates
It seems that I forgot to actually create the certificates for new mailman
fedora archiver. Let's fix that.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-01 17:56:42 +02:00
Michal Konecny
171527dd94 [mailman3] Change the amount of workers back to 4
10 workers were able to drain the memory of the machine in minutes.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-07-01 17:27:59 +02:00
Michal Konecny
0d4e40f7b2 [mailman3] Increase the default amount of gunicorn workers
Mailman hourly job is making the web unresponsive, let's try if increasing the
amount of gunicorn workers improves the situation.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-28 11:10:48 +02:00
Michal Konecny
c69ef120c3 [mailman3] Add logrotate capabilities
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-28 11:02:10 +02:00
Michal Konecny
62b319cadb [mailman3] Fix the migration task
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 14:14:12 +02:00
Michal Konecny
84e83a16e1 [mailman3] Use the correct syntax for env
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 13:58:36 +02:00
Michal Konecny
08f990cf79 [mailman3] We need admin access to database for migrations
We didn't need that on staging, but on production the permissions are more
granular.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 13:47:20 +02:00
Michal Konecny
1d562201ed [mailman3] Use the same variable name everywhere
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 13:00:45 +02:00
Michal Konecny
897190bcc6 [mailman3] Fix for production deployment
Don't use the same name for variables in ansible-private and playbook.
Remove fedmsg.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 12:53:03 +02:00
Michal Konecny
e97ec6d135 [mailman3] Fix missing import in sar script
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-27 10:14:18 +00:00
Michal Konecny
1879102909 [mailman3] Use the correct syntax for jinja variable
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-25 09:30:41 +02:00
Michal Konecny
bba5d4340e [mailman3] Enable memcached before enabling hyperkitty
For `mailman-web compress` memcached have to be running.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-24 17:45:25 +02:00
Michal Konecny
29566b6a6f [mailman3] Fix the ValueError during deployment
It seems that setting `gatenews_every` to 0 is now throwing `ValueError`. Let's
keep this to default (5m) and just ignore the error.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-24 17:22:47 +02:00
Michal Konecny
fc5ee402bf [mailman3] Fix the jinja variable
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-24 17:04:05 +02:00
Michal Konecny
051650c710 [mailman3] Update default variables
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-24 16:19:46 +02:00
Michal Konecny
df67f2be1f [mailman3] Start and enable timers not services
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-21 14:00:11 +02:00
Michal Konecny
996cef7d22 [mailman3] Add missing tags to patch task
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-21 12:46:08 +02:00
Michal Konecny
0fbd79a26e [mailman3] Fix the patch file and how it is applied
Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-21 11:55:10 +02:00
Michal Konecny
d0e06d1ab0 [mailman3] Add patch for django_mailman3
Till https://src.fedoraproject.org/rpms/python-django-mailman3/pull-request/2 is
merged let's apply the patch directly.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-21 09:09:34 +00:00
Michal Konecny
4f35e96a31 [mailman3] Increase timeout for gunicorn worker
This should fix the CRITICAL WORKER TIMEOUT with Flask application.
For more info see https://github.com/benoitc/gunicorn/issues/1801

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2024-06-21 09:09:34 +00:00
Lenka Segura
889f20be54 mailman: Enable and start timers
Signed-off-by: Lenka Segura <lsegura@redhat.com>
2024-06-18 10:22:43 +02:00
Lenka Segura
789bf6fcac mailman3: Fix quarter_hourly timer format and add hperkitty.target
Signed-off-by: Lenka Segura <lsegura@redhat.com>
2024-06-06 11:44:31 +00:00