Current time: 12-13-2017, 03:22 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TTFB
04-23-2016, 07:45 PM
Post: #1
TTFB
Hi community, we have a really bad problem with or TTFB in our ecommerce http://solohombre.es
All page speed webs tell us the same. Almost 5 seconds to TTFB

I'm the solohombre's web consultant, our developers are prosolution.es

You can see here the drama http://www.webpagetest.org/result/160423...1/details/

We have a fast server, our developers are great professionals and we are lost what to do. If we minify *.js, page loose functions like mega menu... We could combine/minify *.css

I copy our .htaccess file at the end of this message, before i want to comment also a DNS analysis in pingdom. A strange thing is on SOA, is it important?

http://dnscheck.pingdom.com/?domain=solohombre.es
SOA
Could not find reverse address for 74.125.192.27 (27.192.125.74.in-addr.arpa.).
Could not find reverse address for 2607:f8b0:400d:c00:0:0:0:1b (b.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.c.0.d.0.0.4.0.b.8.f.7.0.6.2.ip6.arpa.).

In Results on webpagestest i see on Response: Expires: Thu, 19 Nov 1981 08:52:00 GMT

Is it a huge error?

I insist, i'm web consultant and our developers are prosolutions.es an i'm helping them to resolve this ... drama, big drama.

Here the .htaccess

Thanks!

AddType text/cache-manifest .appcache
##################################
####### COMPRESION #######
##################################
php_flag zlib.output_compression On
php_value zlib.output_compression_level 9
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript
mod_gzip_item_include mime ^application/javascript
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault A300
ExpiresByType image/x-icon A2592000
ExpiresByType application/x-javascript A3600
ExpiresByType text/css A3600
ExpiresByType image/gif A604800
ExpiresByType image/png A604800
ExpiresByType image/jpeg A604800
ExpiresByType text/plain A300
ExpiresByType application/x-shockwave-flash A604800
ExpiresByType video/x-flv A604800
ExpiresByType application/pdf A604800
ExpiresByType text/html A300
</ifModule>


<ifModule mod_headers.c>
<filesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header set Cache-Control "max-age=29030400"
</filesMatch>

<filesMatch ".(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</filesMatch>

<filesMatch ".(html|htm|txt)$">
Header set Cache-Control "max-age=2700"
</filesMatch>
</ifModule>
# BEGIN Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
</IfModule>
############################################
## uncomment these lines for CGI mode
## make sure to specify the correct cgi php binary file name ## it might be /cgi-bin/php-cgi

# Action php5-cgi /cgi-bin/php5-cgi
# AddHandler php5-cgi .php

############################################
## GoDaddy specific options

# Options -MultiViews

## you might also need to add this line to php.ini
## cgi.fix_pathinfo = 1
## if it still doesn't work, rename php.ini to php5.ini

############################################
## this line is specific for 1and1 hosting

#AddType x-mapp-php5 .php
#AddHandler x-mapp-php5 .php

############################################
## default index file

DirectoryIndex index.php

<IfModule mod_php5.c>

############################################
## adjust memory limit

# php_value memory_limit 64M
php_value memory_limit 256M
php_value max_execution_time 18000

############################################
## disable magic quotes for php request vars

php_flag magic_quotes_gpc off

############################################
## disable automatic session start
## before autoload was initialized

php_flag session.auto_start off

############################################
## enable resulting html compression

#php_flag zlib.output_compression on

###########################################
# disable user agent verification to not break multiple image upload

php_flag suhosin.session.cryptua off

###########################################
# turn off compatibility with PHP4 when dealing with objects

php_flag zend.ze1_compatibility_mode Off

</IfModule>

<IfModule mod_security.c>
###########################################
# disable POST processing to not break multiple image upload

SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule mod_deflate.c>

############################################
## enable apache served files compression ## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# Netscape 4.x has some problems...
#BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
#BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
#SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary

</IfModule>

<IfModule mod_ssl.c>

############################################
## make HTTPS env vars available for CGI mode

SSLOptions StdEnvVars

</IfModule>
<IfModule mod_rewrite.c>

Options +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.solohombre.es [NC]
RewriteRule ^(.*)$ http://solohombre.es/$1 [L,R=301]


############################################
## never rewrite for existing files, directories and links

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
############################################
## Prevent character encoding issues from server overrides ## If you still have problems, use the second line instead

AddDefaultCharset Off
#AddDefaultCharset UTF-8

<IfModule mod_expires.c>

############################################
## Add default Expires header
## http://developer.yahoo.com/performance/r...ml#expires

ExpiresDefault "access plus 1 year"

</IfModule>

############################################
## By default allow all access

Order allow,deny
Allow from all

############################################
## If running in cluster environment, uncomment this ## http://developer.yahoo.com/performance/rules.html#etags

#FileETag none

#SetEnv MAGE_IS_DEVELOPER_MODE "true"
Find all posts by this user
Quote this message in a reply
04-27-2016, 03:27 PM
Post: #2
RE: TTFB
So it's a magento site then (:

First off, the TTFB is a reflection of how well your site builds up the html skeleton of the page, which requires use of php and the database to build. The majority of the contents of the .htaccess above are working on speeding the transfer of static resources, and will not affect the TTFB.

The obvious misconfiguration I see is
php memory is set to 256MB. Minimum recommnded is 384MB.

After that, you need to tune your server to handle the needs of magento:
- database. ensure using MySQL 5.6 if possible, but make sure you're using innodb_file_per_table ( you'll need to dump / restore - and preferably reinstall MySQL if you're not ), and that there is plenty of innodb cache available. Use a script like mysql_tuner.sh - freely available on the net - to improve your configuration.
- php. use the latest version that you can. This depends on the version of magento you're running, so you need to check. Older versions limit you to PHP 5.3 ( there's a script to update to support 5.4 ), newer allow 5.5, and Magento2 even newer.
- php opcache. For old versions use eAccelerator in this setup, newer ones use the built in zend opcode cacher.
- use of tmpfs filesystems. If you have plenty of memory ( and if not, get more! ), then mount var/cache and var/session in memory. Not only can you make it run faster, but the mount parameters can make it safer too.
- apache. If you're using SuPHP, then don't! For best performance, implement a fpm based infrastructure. If you do this, and are using an old version of PHP, then switch to the APC opcode cacher from eAccelerator.

That should get you started at least...

Steve
Find all posts by this user
Quote this message in a reply
04-27-2016, 05:33 PM
Post: #3
RE: TTFB
Thank you so much and i am so happy about your answer and advice.

I transfer yours advice immediately to our developers. If news are good, i'll share with you, that i'm almost certain it will.

Thank you again Steve

Álvaro
Find all posts by this user
Quote this message in a reply
09-27-2016, 07:22 PM
Post: #4
RE: TTFB
Magento has profiler built-in to help you debug your TTFB problem.

go ahead and enable it and see what magento is doing behind the scenes

here is a nice tutorial on how to enable and use profiler to optimize magento TTFB

enable slow query reports in your MySQL server - that could be some bad written query slowing your down.

in my experience the problem of huge TTFB in magento is poorly written template files.

for example developers load product models inside catalog product list loops:

PHP Code:
<?php foreach($collection as $product){
    
$product Mage::getModel('catalog/product')->load($product->getId())
    .... 

i see it all the time on clients websites

go over your templates and make sure php code is optimized and doesn't contain expensive model loads where it doesn't supposed to

Konstantin Gerasimov
Magento Certified Developer
https://www.goivvy.com
Visit this user's website Find all posts by this user
Quote this message in a reply
09-28-2016, 02:11 AM
Post: #5
RE: TTFB
Thank you so much goivvy. I'm going to study what you say and links you share.

I'll tell you results!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)