find and replace fixes, will introduce errors

This commit is contained in:
Ariel Rin
2023-10-27 16:37:53 +10:00
parent b9d128259e
commit ffb526ab0c
52 changed files with 615 additions and 589 deletions

View File

@@ -13,8 +13,7 @@ Your auth project is just a regular Django project - you can add in [other Djang
The following instructions will explain how you can remove an app properly fom your Alliance Auth installation.
```eval_rst
.. note::
:::{note}
We recommend following these instructions to avoid dangling foreign keys or orphaned Python packages on your system, which might cause conflicts with other apps down the road.
```
@@ -27,7 +26,7 @@ First, we want to remove the app related tables from the database.
Let's first try the automatic approach by running the following command:
```sh
```shell
python manage.py migrate appname zero
```
@@ -39,32 +38,32 @@ If that did not work and you got error messages, you will need to remove the tab
First, tell Django that these migrations are no longer in effect (note the additional `--fake`):
```sh
```shell
python manage.py migrate appname zero --fake
```
Then, open the mysql tool and connect to your Alliance Auth database:
```sh
```shell
sudo mysql -u root
use alliance_auth;
```
Next disable foreign key check. This makes it much easier to drop tables in any order.
```sh
```shell
SET FOREIGN_KEY_CHECKS=0;
```
Then get a list of all tables. All tables belonging to the app in question will start with `appname_`.
```sh
```shell
show tables;
```
Now, drop the tables from the app one by one like so:
```sh
```shell
drop table appname_model_1;
drop table appname_model_2;
...
@@ -72,7 +71,7 @@ drop table appname_model_2;
And finally, but very importantly, re-enable foreign key checks again and then exit:
```sh
```shell
SET FOREIGN_KEY_CHECKS=1;
exit;
```
@@ -85,7 +84,7 @@ Once the tables have been removed, you you can remove the app from Alliance Auth
Finally, we want to remove the app's Python package. For that run the following command:
```sh
```shell
pip uninstall app-package-name
```

View File

@@ -2,12 +2,11 @@
In the maintenance chapter you find details about where important log files are found, how you can customize your AA installation and how to solve common issues.
```eval_rst
.. toctree::
:maxdepth: 1
```{toctree}
:maxdepth: 1
apps
project
troubleshooting
tuning/index
apps
project
troubleshooting
tuning/index
```

View File

@@ -24,7 +24,7 @@ Make sure the background processes are running: `supervisorctl status myauth:`.
Stop celery workers with `supervisorctl stop myauth:worker` then clear the queue:
```bash
```shell
redis-cli FLUSHALL
celery -A myauth worker --purge
```
@@ -49,7 +49,7 @@ Gunicorn needs to have context for its running location, `/home/alllianceserver/
Migrations may about with the following error message:
```bash
```shell
Specified key was too long; max key length is 767 bytes
```

View File

@@ -1,6 +1,6 @@
# Celery
```eval_rst
```{eval-rst}
.. hint::
Most tunings will require a change to your supervisor configuration in your `supervisor.conf` file. Note that you need to restart the supervisor daemon in order for any changes to take effect. And before restarting the daemon you may want to make sure your supervisors stop gracefully:(Ubuntu):
@@ -14,13 +14,13 @@
By default task logging is deactivated. Enabling task logging allows you to monitor what tasks are doing in addition to getting all warnings and error messages. To enable info logging for tasks add the following to the command configuration of your worker in the `supervisor.conf` file:
```text
```ini
-l info
```
Full example:
```text
```ini
command=/home/allianceserver/venv/auth/bin/celery -A myauth worker -l info
```
@@ -28,7 +28,7 @@ command=/home/allianceserver/venv/auth/bin/celery -A myauth worker -l info
Celery workers often have memory leaks and will therefore grow in size over time. While the Alliance Auth team is working hard to ensure Auth is free of memory leaks some may still be cause by bugs in different versions of libraries or community apps. It is therefore good practice to enable features that protect against potential memory leaks.
```eval_rst
```{eval-rst}
.. hint::
The 256 MB limit is just an example and should be adjusted to your system configuration. We would suggest to not go below 128MB though, since new workers start with around 80 MB already. Also take into consideration that this value is per worker and that you may have more than one worker running in your system.
```
@@ -42,13 +42,13 @@ This is not a built in feature and requires the 3rd party extension [superlance]
To setup install superlance into your venv with:
```bash
```shell
pip install superlance
```
You can then add `memmon` to your `supervisor.conf`:
```text
```ini
[eventlistener:memmon]
command=/home/allianceserver/venv/auth/bin/memmon -p worker=256MB
directory=/home/allianceserver/myauth
@@ -67,7 +67,7 @@ Celery tasks are designed to run concurrently, so one obvious way to increase ta
The easiest way to increate throughput can be achieved by increasing the `numprocs` parameter of the suprvisor process. For example:
```text
```ini
[program:worker]
...
numprocs=2
@@ -83,14 +83,14 @@ numprocs * concurency = workers
increasing this number will require a modification to the memmon settings as each `numproc` worker will get a unique name for example with `numproc=3`
```text
```ini
[eventlistener:memmon]
...
command=... -p worker_00=256MB -p worker_01=256MB -p worker_02=256MB
...
```
```eval_rst
```{eval-rst}
.. hint::
You will want to experiment with different settings to find the optimal. One way to generate task load and verify your configuration is to run a model update with the following command:
@@ -104,11 +104,11 @@ command=... -p worker_00=256MB -p worker_01=256MB -p worker_02=256MB
This can be achieved by the setting the concurrency parameter of the celery worker to a higher number. For example:
```text
```ini
--concurrency=10
```
```eval_rst
```{eval-rst}
.. hint::
The optimal number will hugely depend on your individual system configuration and you may want to experiment with different settings to find the optimal. One way to generate task load and verify your configuration is to run a model update with the following command:
@@ -118,7 +118,7 @@ This can be achieved by the setting the concurrency parameter of the celery work
```
```eval_rst
```{eval-rst}
.. hint::
The optimal number of concurrent workers will be different for every system and we recommend experimenting with different figures to find the optimal for your system. Note, that the example of 10 threads is conservative and should work even with smaller systems.
```

View File

@@ -8,6 +8,6 @@ The number you set this to will depend on your own server environment, how many
For example to get 5 workers change the setting `--workers=5` in your `supervisor.conf` file and then reload the supervisor with the following command to activate the change (Ubuntu):
```bash
```shell
systemctl restart supervisor
```

View File

@@ -2,16 +2,15 @@
The official installation guide will install a stable version of Alliance Auth that will work fine for most cases. However, there are a lot of levels that can be used to optimize a system. For example some installations may we short on RAM and want to reduce the total memory footprint, even though that may reduce system performance. Others are fine with further increasing the memory footprint to get better system performance.
```eval_rst
```{eval-rst}
.. warning::
Tuning usually has benefits and costs and should only be performed by experienced Linux administrators who understand the impact of tuning decisions on to their system.
```
```eval_rst
.. toctree::
:maxdepth: 1
```{toctree}
:maxdepth: 1
gunicorn
celery
redis
gunicorn
celery
redis
```