How to boost to maximum url request per second for nginx+php-fpm for Raspberry pi?

hi,
hestia cp v1.5.10 installed in my raspberry pi 4gb.
i have million of url to visit using spider software, but when i start spider for crawl urls then after about 485 request stopped response from url and get time out error.
without mariadb connection work fine. if connect database then only 485 request and then time out…
so, i want to increase http request to handle maximum urls per second.
how to optimize nginx and php-fpm and mariadb?

thank you,