From 01be2612ab845771929181592931464f179357ea Mon Sep 17 00:00:00 2001 From: Ivan Gabaldon Date: Fri, 4 Jul 2025 14:35:28 +0200 Subject: [mod] container: replace uWSGI with Granian (#4820) * [mod] container: replace uWSGI with Granian The configuration in Granian is handled with ENVs, much more convenient and practical for updating. The settings have been tested for over two months in a production instance, being usable on small to somewhat large instances without having to modify anything. It also removes the patch functions and ENVs abstraction from the entrypoint, this makes it possible to run the container with immutable configuration. In some setups, It may be desired to have the volumes/files under a specific uid/gid (other than searxng:searxng), if the entrypoint has root permissions it will chown automatically on every start, which may not be desired. Explicitly setting the new ENV `FORCE_OWNERSHIP=false` will prevent ownership from being modified. No manual migration is necessary **unless** the user has changed the default uWSGI configuration or has a very specific setup. Closes https://github.com/searxng/searxng/issues/4894 Closes https://github.com/searxng/searxng/issues/4818 Closes https://github.com/searxng/searxng/issues/4802 Supersedes https://github.com/searxng/searxng/pull/4596 Related https://github.com/searxng/searxng/discussions/4479 * [mod] docs: add container/granian All container documentation has been recreated. A new documentation page has been created for Granian. * [enh] misc: apply suggestions Minor documentation changes. Suggested https://github.com/searxng/searxng/pull/4820#discussion_r2134539259 Suggested https://github.com/searxng/searxng/pull/4820#discussion_r2134538610 Suggested https://github.com/searxng/searxng/pull/4820#discussion_r2134827964 Suggested https://github.com/searxng/searxng/pull/4820#discussion_r2134544300 Suggested https://github.com/searxng/searxng/pull/4820#discussion_r2149387388 --------- Signed-off-by: Markus Heiser Co-authored-by: Ivan Gabaldon Co-authored-by: Markus Heiser --- docs/admin/installation-granian.rst | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docs/admin/installation-granian.rst (limited to 'docs/admin/installation-granian.rst') diff --git a/docs/admin/installation-granian.rst b/docs/admin/installation-granian.rst new file mode 100644 index 000000000..06fd064c6 --- /dev/null +++ b/docs/admin/installation-granian.rst @@ -0,0 +1,52 @@ +.. _searxng granian: + +======= +Granian +======= + +.. _Options: https://github.com/emmett-framework/granian/blob/master/README.md#options +.. _Workers and threads: https://github.com/emmett-framework/granian/blob/master/README.md#workers-and-threads +.. _Backpressure: https://github.com/emmett-framework/granian/blob/master/README.md#backpressure +.. _Runtime mode: https://github.com/emmett-framework/granian/blob/master/README.md#runtime-mode + +.. sidebar:: further reading + + - `Options`_ + - `Workers and threads`_ + - `Backpressure`_ + - `Runtime mode`_ + +.. note:: + + Granian will be the future replacement for :ref:`searxng uwsgi` in SearXNG. + At the moment, it's only officially supported in the :ref:`installation + container`. + +.. _Granian installation: + +Installation +============ + +We only recommend installing Granian with pip, as officially documented. Run +the following command in the Python environment of the SearXNG installation: + +.. code:: sh + + $ pip install granian + +.. _Granian configuration: + +Configuration +============= + +.. note:: + + It's not advised to modify the amount of workers, expect increased resource + usage and potential issues with :ref:`botdetection`. + +Granian can be configured via option parameters and environment variables +(``$GRANIAN_*``). + +We provide sane defaults that should fit most use cases, however if you feel +you should change something, Granian documents all available parameters in the +`Options`_ section. -- cgit v1.2.3