Now I changed the settings like below.Needs to check with these settings.Database running separately
I changed apache mpm_prefork to mpm_event .
and the changed all the configurations like below
mpm_event
<IfModule mpm_event_module>
ServerLimit 4800
StartServers 16
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestWorkers 4800
MaxConnectionsPerChild 1500
</IfModule>
php.ini
max_input_time = 60
max_input_vars = 10000
memory_limit = 52G
mysqld.conf
key_buffer_size = 512M
innodb_undo_log_truncate=off
# general
thread_cache_size = 100
table_definition_cache=2000
table_open_cache = 20000
open_files_limit = 40000
table_open_cache_instances=64
back_log=3500
max_connections=15000
# buffers
innodb_buffer_pool_size=40G
innodb_buffer_pool_chunk_size=2G
innodb_buffer_pool_instances=16
innodb_log_buffer_size=64M
# files
innodb_file_per_table
innodb_log_file_size=8G
innodb_log_files_in_group=2
innodb_open_files=4000
# tune
innodb_doublewrite= 1
innodb_thread_concurrency=0
innodb_flush_log_at_trx_commit= 0
innodb_flush_method=O_DIRECT_NO_FSYNC
innodb_max_dirty_pages_pct=90
innodb_max_dirty_pages_pct_lwm=10
innodb_lru_scan_depth=2048
innodb_page_cleaners=4
join_buffer_size=1G
sort_buffer_size=512M
innodb_use_native_aio=1
innodb_stats_persistent = 1
#innodb_spin_wait_delay=96
innodb_adaptive_flushing = 1
innodb_flush_neighbors = 0
innodb_read_io_threads = 16
innodb_write_io_threads = 16
innodb_io_capacity=1500
innodb_io_capacity_max=2500
innodb_purge_threads=4
innodb_adaptive_hash_index=0
max_prepared_stmt_count=10000
innodb_monitor_enable = '%'
performance_schema = ON
references:
https://medium.com/@sbuckpesch/apache2-and-php-fpm-performance-optimization-step-by-step-guide-1bfecf161534
https://www.percona.com/blog/2019/02/25/mysql-challenge-100k-connections/