[Geocoding] Nominatim Server Requirements Post-import

Sarah Hoffmann lonvia at denofr.de
Tue Nov 23 13:10:09 UTC 2021


Hi,

On Tue, Nov 23, 2021 at 12:06:43AM +0000, Alexander Riggs wrote:
> I have a Nominatim Kubernetes installation where one Pod contains the php-fpm server container and the nginx container, and a StatefulSet which contains the Postgres+PostGIS database. I have successfully imported the entire planet and things are working as expected. I am defining resource requirements for a deployment environment I am not the admin of and the current requirements are raising some eyebrows. As currently configured the database and the API are requesting 16 CPUs and 64 GB of RAM each. These values were derived from the Nominatim installation documentation section on hardware<https://nominatim.org/release-docs/latest/admin/Installation/#hardware>. Most references to hardware requirements seem to be defined for a deployment where the API and database share resources on a single server. I am not running updates once the import is complete due to certain non-negotiable restrictions. The deployed version is v3.7.2. I am getting relatively performant responses, though the load (requests per second) on the server is quite light at the moment.
> 
> On to my questions.

Small disclaimer ahead: I've never run such a setup, so the answers below
are just extrapolations from experience with a single server setup.

>   1.  What are the resource requirements for a standalone database during import? What about after import? Note I am using the recommended tuning parameters from the docs.

During import the requirements are as described in the docs. When you run your database
in freeze mode (i.e. without updates), you might get away with a machine about half the
size. But I wouldn't be stingy with the database hardware. The more RAM you have, the more
of the working set you can keep in RAM. That makes your queries faster and it means you
can scale up the CPUs. When you have fast enough disks (and I strongly recommend NVME here)
then the system is almost CPU bound, so scale the number up as you need.

>   2.  What are the resource requirements for a php-fpm server with the API (search.php, reverse.php, etc.) after the import is complete?
>   3.  When a request is made to an endpoint is the processing done on the API side or the database side?

The frontend part is a relatively thin layer. All the heavy lifting is done on the
database side. A small machine with something like 8GB RAM will likely get you far.
Again, scale the number of CPUs as needed for your load.

Note that this also means that there is not much point in running multiple
frontend containers that access the same database. The database is the limiting
factor. If you need to scale up because of heavy load, you need to replicate the
database server.

Sarah



More information about the Geocoding mailing list