The search:populate took 6,5 hours (Index populated with 1003218 documents in 23583.43 seconds.),
So it seems that the innodb_buffer_pool_size should be something between the 12G of this test (6,5 hours) and the 48G I configured previoulsy (5 hours).
So I decided to make a new test: apply some parameters advised by ChatGPT. (Some parameters it advised were just wrong - not accepted by the version of the application, or resulted in errors - but most I could apply).
I was lazy enough to not wanting to wait 5 or 6 hours to test every configuration change, so I applied all at the same time (but tested if AtoM was still working on browser after every configuration/restart made).
The question I made to ChatGPT was:
"On an Ubuntu Server 24.04 x64 server with 16 cores and 64GB of RAM, on which Nginx, PHP-FPM 7.4 (using APCU 5.1), MySQL 8, Elasticsearch 5.6 and Memcached are installed, how can I make the maximum server resources be used by these applications so that an application developed in Symfony 1.4 runs as fast as possible?"
And the configurations I changed:
1. On /etc/nginx/nginx.conf:
events {
worker_connections 1024;
multi_accept on;
}
http {
client_body_buffer_size 16K;
client_header_buffer_size 1k;
client_max_body_size 8m;
large_client_header_buffers 2 1k;
tcp_nodelay on;
keepalive_timeout 65;
server_tokens off;
(...)
gzip_disable "msie6";
(...)
}
2. On /etc/php/7.4/fpm/pool.d/atom.conf:
pm.max_children = 128
pm.start_servers = 32
pm.min_spare_servers = 16
pm.max_spare_servers = 32
pm.max_requests = 500
php_admin_value[apc.enable_cli] = 1
php_admin_value[apc.shm_size] = 512M
php_admin_value[apc.ttl] = 7200
php_admin_value[apc.gc_ttl] = 3600
3. On /etc/mysql/mysql.conf.d/mysqld.cnf:
innodb_buffer_pool_size = 32G
innodb_buffer_pool_instances = 16
innodb_redo_log_capacity = 2G
innodb_flush_method = O_DIRECT
innodb_io_capacity = 2000
max_connections = 1000
4. On /etc/elasticsearch/jvm.options:
-Xms31g
-Xmx31g
5. On /etc/sysctl.conf
vm.max_map_count=262144
(Tested before changing with sudo sysctl -w vm.max_map_count=262144)
6. Disabled the memory swap with
sudo swapoff -a
7. On /etc/memcached.conf:
-m 4096
-c 4096
8. On /etc/security/limits.conf:
* soft nofile 65536
* hard nofile 65536
9. On /etc/systemd/system.conf:
DefaultLimitNOFILE=65536
10. On /etc/sysctl.conf:
vm.swappiness=10
The I restarted the server, recriated the nested set, re-generated the slugs and re-indexed with:
sudo php /usr/share/nginx/atom/symfony propel:build-nested-set
sudo php /usr/share/nginx/atom/symfony propel:generate-slugs
sudo php -d memory_limit=-1 /usr/share/nginx/atom/symfony search:populate
sudo php /usr/share/nginx/atom/symfony cc
sudo systemctl restart php7.4-fpm.service
And the results were:
propel:build-nested-set took 0:01:31
propel:generate-slugs took 0:00:21
search:populate took 4:30:09 (Index populated with 1003218 documents in 16205.39 seconds.)
The best results so far! And the navigation/browsing on AtoM seems "faster" (not sure how to "technically" test it, but visually it seems faster).
Think I'm gonna leave like this, at least for now.
Thanks again for all your tips!
Cintya Takahaschi