My problem

One of my client website has very large database booking system. Currently my server need more than 2 minute to load all the bookings from many years. I’ve tried to change the setting in my PHP & Apache. It doesnt work. However it was my fault, because VestaCP is using Nginx as proxy.

So I have to change in PHP and also in Nginx configuration.

Solution

You have to change some setting in /etc/nginx/nginx.conf

http {

Main settings

sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_header_timeout 1m;
client_body_timeout 1m;
client_header_buffer_size 2k;
client_body_buffer_size 256k;
client_max_body_size 256m;
large_client_header_buffers 4 8k;
send_timeout 120;
keepalive_timeout 120 120;
reset_timedout_connection on;
server_tokens off;
server_name_in_redirect off;
server_names_hash_max_size 512;
server_names_hash_bucket_size 512;

# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 120;
proxy_send_timeout 120;
proxy_read_timeout 120;
proxy_buffers 32 4k;

You just change the value in this parameter to fit with your situation and don’t forget to change also in your php configuration setting. ( /home/user/domain/conf/web/apache.conf )

%d bloggers like this: