I get a 504 Gateway Time-out error

When I try to access Smush settings, I get a 504 Gateway Time-out error. might be because there is a huge amount of images on this website, around 250k images

I see a very high load when clicking smush pro, memory_limit and Max_execution_time were increased, what can I do more?