Slow website, but super optimized - DOM elements or hosting?

So I’m shelling out like $100 for hosting, I’ll refrain from saying who the host is, and I’ve really optimized the site; combining stylesheets and scripts; minifying javascript, css, and html; two rounds of lossy compression; and cacheing - I’m not using a plugin…

[url=http://www.webpagetest.org/result/150825_BX_98C/1/details/]http://www.webpagetest.org/result/150825_BX_98C/1/details/[/url]

Low TTFB - hosting/throttling? Far away too…[/u]
[url=http://www.webpagetest.org/result/150825_5E_9KP/1/details/]http://www.webpagetest.org/result/150825_5E_9KP/1/details/[/url]

If I redo the result, it gets better - but I honestly don’t see it flipping back and forth on pages. While I do have a lot of DOM elements, I feel like my site should be loading much, much, faster - when the TTFB is good, the speed index is like 1700 - near me. I’ve considered moving to a dedicated server, any thoughts on who?

Shared hosting = forget it when you’re after performance, and this one looks either overloaded or poorly configured, and you should be able to get managed WP hosting for a similar price ( as it doesn’t sound like you’ve got the necessary skills for DIY hosting - apologies if I’ve misunderstood! ). A VPS should be sufficient.

Whilst a caching plugin always helps, it does make sense to have a server with the ability to at least deliver in a decent time with a low load… and then improve with a cache ( I like W3TC but some seem to be giving it a hard time at the moment ).

It might help to look at reducing the file count - further combining css and js files ( if that doesn’t break anything ) is something that W3TC does well. Implementing sprites may help too.

Thanks for the input!
I’ve been playing with a VPS the past few days, and I really wonder why I hadn’t made the switch earlier. I’ve heard the same about W3TC, way back I used it and didn’t have any problems. I went with a premium caching plugin this time though, and with the current state of everything, I couldn’t be happier.

You do realise that it’s downloading a couple of the files 6 or 7 times, right?

You should also look at using CSS sprites to improve page performance even more.

Best fix all the duplicate files being served, that WebsiteSpeedExperts mentioned.

And, the big ugly here is TTFB.

Since index.html resolves + index.php does not, it appears you’re serving a static HTML site.

Since your version of NGINX is obfuscated, first place to look is where ever NGINX errors are logged. There are some versions that crash + recover for every object served. I’d check this first.

Next, check top for…

  1. little or no swapping

  2. a large amount of “Cached Mem”, which will includes file buffers

If you’re running MariaDB/MySQL behind the scene, use mysqltuner or mysql-tuning-primer to tune database config.

If you’re running PHP behind the scenes, looks like you’re running an old kernel (2.6.32 ish), so likely you’re using APC. Might be worthwhile (if you’re using PHP), to install Opcache + tune it up well.

Likely the problem is with your filesystem or memory or NGINX.

@WebsiteSpeedExperts: They are slightly different files - someone, for whatever reason, decided to just make them 40 characters long and change 1-2 characters halfway in the middle :stuck_out_tongue:

@dfavor: I haven’t pointed the domain to the IP that’s on the VPS yet - and I don’t believe I have access to the php.ini, nginx.conf, or my.cnf on the wp hosting. Here’s the latest test from the I.P -[url=http://www.webpagetest.org/result/150907_N8_2VP/1/details/] http://www.webpagetest.org/result/150907_N8_2VP/1/details/[/url] This is once everything has cached. I’m currently using wp-rocket, and it’s absolutely amazing.

I’ve tried using APC, and Fastcgi cache, and they honestly just interfere with wp-rocket. Varnish doesn’t really help or hurt wp-rocket. Do you have any other suggestions?

Also, after Googling around, I’ve read in multiple place that increasing the amount of connections in Nginx helps, but I saw that this actually hurt the TTFB’s, have you noticed this in your case? I’ve tweaked some of the buffers in Mysql, and Nginx too - but really haven’t seen a vast improvement.

I’m using a 2 core 4gb ram SSD VPS, and didn’t see that I was really pressing the memory - I did a swap just incase.

I increased it to a 4 core, just to test it, but didn’t see a significant improvement.

Before it’s cached, however, this is what I’m looking at [url=http://www.webpagetest.org/result/150907_V3_36V/1/details/]http://www.webpagetest.org/result/150907_V3_36V/1/details/[/url]

It’s ugly. The CPU utilization looks really low, bandwidth doesn’t really peak. Is this just from the sheer amount of requests?

I can really just keep things cached, so it’s not terribly worrying, but I do run into a sticky situation for the mobile version, unless I build a mobile subdomain and redirect all mobile traffic there. I’ve also been tempted to create a subdomain, stick all the static files on there, and create a “shard/CDN” network that way.

I have looked into the tuner, but haven’t used it yet. Definitely gonna tinker with that this week.

I’m gonna test OPcache and see what effects it has as well.

Thank you for the in depth response!

:::: About Your Hosting

@jrothrock14: With no access to logs or system data, difficult to fix this.

A primary question to ask is the amount of revenue your site will be generating, which will likely determine traffic to site.

If it’s a hobby site or proof of concept site, then traffic will be low + you can run your site anywhere + just ignore speed.

If this site requires handling traffic + will be generating income, likely you’ll require some sort of dedicated server (physical machine), so you can fix things like this.

A HOST-32L machine from OVH is $70 USD + will likely run circles around your current hosting. In the $100 range they also have the HOST-32H + SP-64 with faster cores.

Last year Nov + Dec, I had one of my clients hosted on an EG-32 ($119/month) + this client’s traffic was 100,000+ uniques/hour (your read that right) for 60+ straight days. This server ran at 5-10% usage during this time.

So I’d say, first, change hosting. For $100/month you should have ssh access to all your machine functions.

:::: About Caching

WPRocket (IMHO) is primarily hype. The sites I host (either I build myself or migrate from elsewhere + optimize) easily run 7000+ reqs/sec using WordPress Super Cache. Most of the options of WPRocket should be handled at the Apache level or via other plugins.

As for APC, this is deprecated. You Opcache instead.

Fastcgi is not a caching solution. It’s a way to have long lived PHP instances.

The above site I mentioned (100,000+ uniques/hour) was running straight up Apache + PHP via libapache2-mod-php5 (which embeds PHP into Apache processes).

:::: CDNs + Proxies

Tech like CloudFlare + Varnish + Squid + Nginx + Haproxy, in all my testing, slow down well tuned systems.

If you think about how CDNs really work, you’re better off just using a hosting company like OVH, who’s servers sit right on the global backbone.

Proxies like Varnish + Squid + Nginx + Haproxy, incur additional overhead in every transaction, so will only speed up poorly tuned sites + slow down well tuned sites.

:::: Apache-2.6 + H2 + PHP7 + Future

The next round of code releases is going to have a profound effect on all sites.

The author of mod_h2 (Apache native HTTP/2.0 support) has contributed his code to Apache, so next version of Apache (2.6) will include full native HTTP/2.0 support for SSL that will likely exceed speed of most non-SSL sites, because of how the protocol works.

PHP7 integrates many code optimization strategies developed by Facebook’s HHVM compiler + in most cases outperforms HHVM, in recent tests.

Likely the easiest way you’ll have access to all this new tech is to run a dedicated machine, so you can install these as they release.

I’m working on a step-by-step course right now describing all the tuning I do from kernel through LAMP stack.

http://RealMetalHosting.com has a crude set of notes I’ve been putting together about this recently, if you feel adventurous.

:::: One Last Test You Can Do

Since your site isn’t really online, it’s very difficult for WPT members to assist you.

Put your site online, for additional comments.

And also, as an experiment, switch to Twenty Fifteen + deactivate all plugins + rerun your tests.

Poorly coded themes + plugins (especially related posts plugins) destroy site performance.

Test with Twenty Fifteen + no plugins to get a baseline reference of your site.

Also, remove WPRocket + test with WP Super Cache or ZenCache.

Also, be sure Opcache is installed. Use opc.php (OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+ · GitHub) to verify Opcache is tuned correctly.

While I haven’t been crawling this forum for a really long time, I must say, your last two posts are easily the most informative posts I have read on this site - not even taking into account your Bookmark worthy website.

The domain was on the managed hosting, while the IP was on DO.

I’m glad to see someone using Apache, as I really liked the redirect rules and hardening that could be done in the .htaccess. Definitely gonna start messing around with Apache again. You gave me a lot to test on haha.

  • On a side note, I just ran through builtwith.com and saw that a lot of the big websites, that run Wordpress, were using Apache.

Yeah, the theme is honestly boo-boo. I’m gonna scrap it.

I’m definitely gonna be looking into the dedicated server - just got to be ready to destroy it 5 times over.

While this is kind off topic, for someone who is learning Webdev, is this a good visual representation of what one should know? https://coggle.it/diagram/52e97f8c5a143de239005d1b/56212c4e4c505e0045c0d3bda59b77e5977c2c9bd40f3fd0b451bdcf8da4aa52

  • This is not in any particular order. As dFavor has suggested on his excellent page, secure everything first - ssh, sftp, ufw/iptable, fail2ban, remove root login, ghost the server, use “netstat -peanut”, and of course SSL - I’m intrigued by your close-wait reaper. This is coming from some one with a few weeks? of practice, so take mine with a grain of salt and look at dfavors link. Maybe I’m just speaking into the wind.
    EDIT: Change popular ports too.

Also, from a speed perspective, for building brochure websites, is there any reason not to use Wordpress? You’re a huge fan of it I can tell. I’ve considered dabbling in Drupal for a while now - even though, I’ve heard that’s not good for building brochure websites. I’ve also slightly looked into static content generators. Edit: Just saw ghost.

I probably won’t have the site backup for about a month or so, as I gotta make some money from a different venture to fuel this. I really do appreciate, and others will too, the amount of time you put into this.

**Side side note. After looking into http 2.0, I’m really thinking it is time for the web to go - “Always-on-SSL” which has been talked about this week in /r/webdev

—Maybe start dropping some links over there?

At a guess, nginx is not well configured… that 404 for style.css taking so long to appear. The alternative is that it’s dynamic, and the theme is just pants ( as you’ve suggested ).

WP based chchers are pretty good for this kind of site ( W3TC what are you doing with that nag screen! ).

re “Always-on-SSL”: HTTP2 is still a while away, but for the cost of under $5 ( https://www.ssls.com/ ) I’d look at the differences that SPDY can make to the download of the required files on your site. It’s pretty impressive ( http://www.webpagetest.org/result/141111_1K_7AV/ )