On my Nginx server i use a domain “domain.com” and i have all files
here:
/home/nginxs/domains/mydomain.com/public
There i have a folder named “gadgets” and i have some files there and i
use
a redirect to another domain for this folder.
So if a user types seconddomain.com it goes to the folder gadgets in the
first domains folder and get al results…
The problem is that is very slow (first domain is loading super fast !)
and
then checking i found this :
So Time to first byte is very slow 6 seconds
No idea how can fix this
And i can’t move that folder to the new created account that i redirect
as
the files inside gadgets are interacting with other files there from
main
account…
So if a user types seconddomain.com it goes to the folder gadgets in the
the files inside gadgets are interacting with other files there from main
listen 80;
listen 80;
}
open_file_cache max=3000 inactive=120s;
}
Any ideas?
I am using ZendOpcache and Memcached…
do you mean mydomain.com forwarding to www.mydomain.com (your
anonymising is rather confusing)? This is the real TTFB, rather than the
nginx redirect. To address that, you need to tune the server resources,
allocating enough to the database and php-fpm.
Assuming a virtual server, the most important thing to do is to avoid
using disks wherever possible, which means allocating plenty of mem to
the database ( also look at maybe using Percona and innodb to improve
performance ), and caching whatever you can… If not using the latest
versions of PHP, look at using APC as well ( start simple! ) and I find
that redis performs better than memcached, but a tmpfs backed file
system often is better than both ( on a single server platform ).
Temporarily using something like new relic may also help you pinpoint
your bottlenecks.
If I’ve misunderstood, then maybe it’s a DNS problem? Try ensuring all
domain names are set in /etc/hosts ( and maybe set them to something in
the 127.0.0.0/8 subnet to ensure no extra external traffic.