Time to first byte - 2 seconds on every site.

Status
Not open for further replies.

mcode

Verified User
Joined
Jul 5, 2012
Messages
15
Hello,

I have been trying to solve a problem for many months and I'm not sure what more or if there is anything I can do.

I'm experiencing a consistent 2 second "time to first byte" lag for every site on my server. Does anyone have some recommendations on how to diagnose this issue. I have just installed "New Relic" but not sure where to begin looking. It's almost as if the server begins to process the information two seconds after it is received. Once the first byte is delivered, the webpage is rendered instantly.

The server is very powerful, 16G ram, 8core, raid5 1TB, 100MB port. I feel like it should be running faster than this. Most of the webpages are Joomla and they used to load instantly. I have checked the DNS. It seems to resolve quickly. There is nothing in the logs that stand out. The slow logs for my sql show nothing. I feel there is a misconfiguration because it affects every site.

Configurations:

Custombuild 2.0 (had the same problem in CB 1.1, was hoping the upgrade would help)
#PHP settings.
#Default version of PHP is always php1_release. Possible values for php1/php2_release: 5.3, 5.4, no. php1/php2_mode: mod_php, php-fpm or suphp)
php1_release=5.3
php2_release=no
php1_mode=mod_php
php2_mode=php-fpm
php_ini=yes
#Possible values - production or development
php_ini_type=production
ioncube=yes
zend=yes

webserver=apache

#Possible value: 2.4
apache_ver=2.4
mod_ruid2=yes
secure_htaccess=no
harden-symlinks-patch=yes

#Possible values - 5.1, 5.5
mysql=5.5
mysql_inst=no
mysql_backup=yes
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups


Cache:
APC
extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=256M
apc.optimization=0
apc.num_files_hint=2048
apc.ttl=3600
apc.enable_cli=1
apc.max_file_size=1M


All databases engines are innodb and are constantly optimized by running altertable.
my.cnf
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock


[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock

skip-external-locking
key_buffer_size = 3G
max_allowed_packet = 2M
#binlog_cache_size = 2M
max_heap_table_size =526M
table_open_cache = 10000
sort_buffer_size = 2M
read_buffer_size = 2M
join_buffer_size = 7m
thread_cache_size = 4
query_cache_size = 128M
tmp_table_size = 128M

innodb_data_home_dir = /var/lib/mysql
innodb_log_group_home_dir = /var/lib/mysql
innodb_buffer_pool_size = 6G
innodb_change_buffering = all
innodb_additional_mem_pool_size = 40M
innodb_file_per_table = 1
innodb_commit_concurrency = 0
innodb_thread_concurrency= 16
innodb_concurrency_tickets = 500
innodb_log_file_size= 250M
innodb_log_buffer_size=5M
innodb_flush_log_at_trx_commit=2
innodb_read_io_threads=36
innodb_write_io_threads=36
innodb_read_ahead_threshold=64
innodb_io_capacity=500
innodb_lock_wait_timeout=50
innodb_data_file_path=ibdata1:50M;ibdata2:50M:autoextend


Thanks,

Matt
 
Last edited:
Usually (but not always) the delay you describe is caused by a delay in DNS resolution.

Is everyone seeing the problem, or just you. If just you the problem may be with your local ISP (connection provider or DNS provider).

If everyone, then the problem may be that you don't have robust DNS infrastructure. Since you didn't give us a domain name to test it's impossible to tell.

Jeff
 
Jeff,

Thanks for the reply. I took a while to respond because I wanted to investigate some more. Since a lot of the sites are Joomla. I believe the problem lies with the scripting. I have found a few bottle necks in each of the sites. After correcting and eliminating them there was improvement. It's definitely not the DNS. Thanks for your feedback.
 
TTFB 2 seconds for every js file

Jeff,

We are facing the similar issue. We have web application on Apache Tomcat, the application is loading really slow. It is hosted on Windows Server 2012. The application loads lot of js files, each js file is taking two seconds TTFB. Can you please post the steps you have taken to improve it?
 
Responding to a post from 4!!! years ago? On a Windows server?
I'm sorry but maybe you missed that this is a Directadmin control panel support forums. That's only Linux. ;)
You might consider to ask you question at an apache forum.
 
Status
Not open for further replies.
Back
Top