You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/howto/installation.rst
+1-136Lines changed: 1 addition & 136 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,7 +158,7 @@ To view all configuration options set for the current profile:
158
158
logging.paramiko_loglevel default WARNING
159
159
logging.plumpy_loglevel default WARNING
160
160
logging.sqlalchemy_loglevel default WARNING
161
-
rmq.task_timeout default 10
161
+
broker.task_timeout default 10
162
162
runner.poll.interval profile 50
163
163
transport.task_maximum_attempts global 6
164
164
transport.task_retry_initial_interval default 20
@@ -367,141 +367,6 @@ How to do this, is operating system specific.
367
367
For Ubuntu, here is `a template for the service file <https://github.com/marvel-nccr/ansible-role-aiida/blob/c709088dff74d1e1ae4d8379e740aba35fb2ef97/templates/aiida-daemon%40.service>`_ and `ansible instructions to install the service <https://github.com/marvel-nccr/ansible-role-aiida/blob/c709088dff74d1e1ae4d8379e740aba35fb2ef97/tasks/aiida-daemon.yml>`_.
368
368
369
369
370
-
.. _how-to:installation:performance:
371
-
372
-
Tuning performance
373
-
==================
374
-
375
-
AiiDA supports running hundreds of thousands of calculations and graphs with millions of nodes.
376
-
However, optimal performance at that scale can require tweaking the AiiDA configuration to balance the CPU and disk load.
377
-
378
-
Below, we share a few practical tips for assessing and tuning AiiDA performance.
379
-
Further in-depth information is available in the dedicated :ref:`topic on performance<topics:performance>`.
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] 400 Node(s) marked for deletion
395
-
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] Starting node deletion...
396
-
12/19/2022 10:57:43 AM <12625> aiida.delete: [REPORT] Deletion of nodes completed.
397
-
Success: Deleted all calculations.
398
-
Success: Deleted the created code bash@benchmark-e73b8647.
399
-
Success: Deleted the created computer benchmark-e73b8647.
400
-
Performance: 0.25 s / process
401
-
402
-
The output above was generated on an AMD Ryzen 5 3600 6-Core processor (3.6 GHz, 4.2 GHz turbo boost) using AiiDA v2.2.0, and RabbitMQ and PostgreSQL running on the same machine.
403
-
Here, 100 ``ArithmeticAddCalculation`` processes completed in ~25s, corresponding to 0.25 seconds per process.
404
-
405
-
If you observe a significantly higher runtime, you may want to check whether any relevant component (CPU, disk, postgresql, rabbitmq) is congested.
406
-
407
-
.. dropdown:: Increase the number of daemon workers
408
-
409
-
By default, the AiiDA daemon only uses a single worker, i.e. a single operating system process.
410
-
If ``verdi daemon status`` shows the daemon worker constantly at high CPU usage, you can use ``verdi daemon incr X`` to add ``X`` parallel daemon workers.
411
-
412
-
Keep in mind that other processes need to run on your computer (e.g. rabbitmq, the PostgreSQL database, ...), i.e. it's a good idea to stop increasing the number of workers before you reach the number of cores of your CPU.
413
-
414
-
To make the change permanent, set
415
-
::
416
-
417
-
verdi config set daemon.default_workers 4
418
-
419
-
.. dropdown:: Increase the number of daemon worker slots
420
-
421
-
Each daemon worker accepts only a limited number of tasks at a time.
422
-
If ``verdi daemon status`` constantly warns about a high percentage of the available daemon worker slots being used, you can increase the number of tasks handled by each daemon worker (thus increasing the workload per worker).
423
-
Increasing it to 1000 should typically work.
424
-
425
-
Set the corresponding config variable and restart the daemon
426
-
::
427
-
428
-
verdi config set daemon.worker_process_slots 1000
429
-
430
-
.. dropdown:: Prevent your operating system from indexing the file repository.
431
-
432
-
Many Linux distributions include the ``locate`` command to quickly find files and folders, and run a daily cron job ``updatedb.mlocate`` to create the corresponding index.
433
-
A large file repository can take a long time to index, up to the point where the hard drive is constantly indexing.
434
-
435
-
In order to exclude the repository folder from indexing, add its path to the ``PRUNEPATH`` variable in the ``/etc/updatedb.conf`` configuration file (use ``sudo``).
436
-
437
-
.. dropdown:: Move the Postgresql database to a fast disk (SSD), ideally on a large partition.
438
-
439
-
1. Stop the AiiDA daemon and :ref:`back up your database <how-to:installation:backup>`.
440
-
441
-
2. Find the data directory of your postgres installation (something like ``/var/lib/postgresql/9.6/main``, ``/scratch/postgres/9.6/main``, ...).
442
-
443
-
The best way is to become the postgres UNIX user and enter the postgres shell::
444
-
445
-
psql
446
-
SHOW data_directory;
447
-
\q
448
-
449
-
If you are unable to enter the postgres shell, try looking for the ``data_directory`` variable in a file ``/etc/postgresql/9.6/main/postgresql.conf`` or similar.
450
-
451
-
3. Stop the postgres database service::
452
-
453
-
service postgresql stop
454
-
455
-
4. Copy all files and folders from the postgres ``data_directory`` to the new location::
456
-
457
-
cp -a SOURCE_DIRECTORY DESTINATION_DIRECTORY
458
-
459
-
.. note:: Flag ``-a`` will create a directory within ``DESTINATION_DIRECTORY``, e.g.::
460
-
461
-
cp -a OLD_DIR/main/ NEW_DIR/
462
-
463
-
creates ``NEW_DIR/main``.
464
-
It will also keep the file permissions (necessary).
465
-
466
-
The file permissions of the new and old directory need to be identical (including subdirectories).
467
-
In particular, the owner and group should be both ``postgres`` (except for symbolic links in ``server.crt`` and ``server.key`` that may or may not be present).
468
-
469
-
.. note::
470
-
471
-
If the permissions of these links need to be changed, use the ``-h`` option of ``chown`` to avoid changing the permissions of the destination of the links.
472
-
In case you have changed the permission of the links destination by mistake, they should typically be (beware that this might depend on your actual distribution!)::
473
-
474
-
-rw-r--r-- 1 root root 989 Mar 1 2012 /etc/ssl/certs/ssl-cert-snakeoil.pem
475
-
-rw-r----- 1 root ssl-cert 1704 Mar 1 2012 /etc/ssl/private/ssl-cert-snakeoil.key
476
-
477
-
5. Point the ``data_directory`` variable in your postgres configuration file (e.g. ``/etc/postgresql/9.6/main/postgresql.conf``) to the new directory.
478
-
479
-
6. Restart the database daemon::
480
-
481
-
service postgresql start
482
-
483
-
Finally, check that the data directory has indeed changed::
484
-
485
-
psql
486
-
SHOW data_directory;
487
-
\q
488
-
489
-
and try a simple AiiDA query with the new database.
490
-
If everything went fine, you can delete the old database location.
491
-
492
-
If you're still encountering performance issues, the following tips can help with pinpointing performance bottlenecks.
493
-
494
-
.. dropdown:: Analyze the RabbitMQ message rate
495
-
496
-
If you're observing slow performance of the AiiDA engine, the `RabbitMQ management plugin <https://www.rabbitmq.com/management.html>`_ provides an intuitive dashboard that lets you monitor the message rate and check on what the AiiDA engine is up to.
497
-
498
-
Enable the management plugin via something like::
499
-
500
-
sudo rabbitmq-plugins enable rabbitmq_management
501
-
502
-
Then, navigate to http://localhost:15672/ and log in with ``guest``/``guest``.
0 commit comments