New server, CloudFlare and optimisation: the TeraGeek site takes off!


Yet another upgrade for the TeraGeek website - we're definitely not stopping progress! Between the server itself, the switch to CloudFlare, the optimisations made to the site and those made to the server, we're at the top! Here's how we reached this level of excellence...

Hardware : Upgrade and change of datacenter

As you may know, since April 2017 I have been working as a support technician at HaiSoft. This Orléans-based hosting provider offers very high quality managed hosting with genuinely human, personalised contact with customers.

What could be more natural than to want to host your site with an employer in whom you have the utmost confidence?

Already happy with my VM (virtual machine) hosted in our Paris datacentre, a colleague and I seized the opportunity to move to our own server, which we split into two VMs.

So I had the pleasure of personally racking a Dell server, with Xeon 1225 v5 (4C) RAID 1 500GB SSD, 16GB RAM and a small cluster of 500GB HDDs just in case.

We've chosen to put this server in our datacenter in Tours, which means we can get a taste of other coolness (evaporative cooling in this case in this DC!). This meant a change of IP, which is not a task to be neglected in such a VM migration operation, because not only does it require modifications to the server, but I also had to adjust the DNS zones of all my other domains to point to these correct IPs.

So this is a relatively simple Dell server on paper. And yet its speed is incredible! We've never experienced speed like this, not even on the overpriced (€200/month) OVH server whose specs almost made the youngest of our members weep (with a hexacore 128GB RAM with RAID 5 hard HDD). So size can be everything, but it's not everything.
On the one hand, Plesk, configured to the highest standards thanks to HaiSoft's expertise, makes the most of this hardware, but on the other hand, as with a PC, the SSD really makes the difference, especially on a server where you're constantly multitasking.

In short, we (TeraGeek) would have no interest in having a more powerful web server right now: it wouldn't improve load times and we're a long way from saturating the various limits (RAM, CPU, I/O, bandwidth). To give you an idea, I did a performance test, with a simulation of 25 users loading pages several times a second, peaking at 60% of CPU with an average of 35%, which never happens in real conditions. For those who speak Linux, the server now runs at less than 0.1 load most of the time. The pages load so quickly in relation to our traffic that there's no time for it to increase. In short, it's a more than ideal situation.

I would also like to thank and count on you to send a big thank you to HaiSoft for this opportunity!

HaiSoft Logo

Software optimisation

As a reminder, the virtualised server hosting TeraGeek runs Plesk. It's THE ultimate tool used by HaiSoft that changed my mind about server management interfaces: simple, intuitive and complete, very secure, in short the very best that can be done under Linux, an absolute time-saver and a much cleaner result than anything you can tinker with by hand.
Plesk has the particular advantage of rapidly supporting the most important software, for example the latest versions of PHP, which can be selected independently for each domain.

As soon as PHP 7.2 was released a few months ago, our site was perfectly up to date (thanks to the automatic WordPress updates with Plesk) and therefore 100% PHP 7.2 compatible, so I put it straight through! This provides the best possible security and performance at the moment. As a reminder/info, PHP 7 divides CPU usage by 2 compared to PHP 5 and can divide PHP memory usage by up to 10 in certain cases.

But that's not all! Plesk offers Google's PageSpeed module, which I tested and immediately adopted. It optimises images on the fly to ensure that they consume as little bandwidth as possible, so that they load quickly even for people with slow connections (or on smartphones). It also enables scripts to be concatenated, drastically reducing the number of files sent to visitors, all of which improves the site's Google ranking.

But that's not all! Plesk also offers a "Nginx Reverse Proxy", a fancy name for a second web server that passes files to users. What's in it for you? There are two major ones:
- This allows you to take advantage of HTTP/2 (which reuses connection sockets to send other files, saving loading time).
- This enables files to be compressed before being sent to visitors, thus saving bandwidth and improving loading times for visitors with slow connections.

But above all, I've been wanting to do this for a long time, so I did it a few months ago: the database was upgraded from MySQL to MariaDB 10, again to improve performance.

Site optimisation

The site could also be optimised. I got rid of a few modules that were no longer needed thanks to Plesk :
- Statistics... They take up space in the database and drastically slow down the site, whereas Plesk provides excellent statistics.
- An overkill security plugin that slowed down the site, all to prevent spider logins and prevent updates: Plesk already does this too, with no loss of performance.
- A few other plugins that have no direct use for the front office, which I now deactivate and only activate when necessary.

I've decided to put back the BuddyPress and BBPress modules, which I'd recently removed because they weren't optimised, despite their CPU-hungry nature, because their presence now has much less impact on the server. They still provide some interesting features, particularly for login and registration.

I also spent some time making sure that the images were optimised and that there were as few scripts external to the site as possible. Goodbye to the Discord widget which isn't optimised enough. This earned me quite a few points on GTmetrix, which evaluates site optimisation.

The next major step will be to create a WordPress multisite to move the WooCommerce shop to shop.terageek.org and thus greatly lighten the site; because WooCommerce is now the most greedy plugin on the site, there are still more than 30% of performance to recover. What's more, the shop isn't at the heart of our business, it's a complement that helps finance our game server, so it's a shame that it's slowing down the site. It's only a matter of time before I figure out how to do this properly, so that I can link users to the site and the shop, so that they don't have to log in twice or re-register. If anyone with multisite experience wants to give me a hand, they're more than welcome.

In the end, the site went from over 1s page generation time 1 year ago, to 0.65s with the first round of optimisation 6 months ago, then to 0.40s on the new server and now to less than 0.29s page generation time. By getting rid of WooCommerce, we'll be able to fall below the symbolic 0.2s loading time that Google is so keen to see.

What about spam emails?

Well, no! Once again, thanks to HaiSoft, we are now using a MailChannels mail relay, which, combined with perfect configuration of the terageek.org DNS zone and the mail server, ensures exceptional deliverability to all recipients, including the capricious Yahoo and Microsoft. Mails will therefore be received and registrations made easier.

 

And will you put a little CDN on it for me?

Finally, I switched the site over to CloudFlare. I was mainly thinking of doing this because it's recommended by GTmetrix to improve loading times abroad. Not only is the free version good enough for us, but it also protects against bot attacks that no other filter can counter on a web server: DoS and DDoS, so it's always good to have. It took 24 hours (you have to wait a bit to get it right) but went perfectly, with the added bonus of DNSSEC being activated, which protects the DNS zone and therefore the authenticity of the site: why not? In any case, the GTmetrix score has gone up again.

The result

Our site is therefore on a server that responds perfectly under all conditions. Even with a backup in progress, which is surely the most onerous task, there is absolutely no slowdown.
I never thought I'd say this, but the result is almost perfect. Now we can get on with the job of quietly and calmly developing TeraGeek's business for you all to enjoy!

I'll leave you with an image that expresses all the satisfaction in the world for a Webmaster:

Optimisation: It's hard to do better with a WordPress site!

Comments

6 responses to "New server, CloudFlare and optimisation: the TeraGeek site takes off!”

  1. Hugo avatar

    It's ultra clean, all that, is it a Dell model? And what happens to the old game server?

    1. UltimateByte avatar

      Yep, I'm really pleased! It's a slightly boosted R230.
      The OVH game server is still there, it's an EG-16, it has more or less the same configuration as this one, apart from the disks, and it's generally good enough for what we do with it, as long as we don't launch super badly opti servers that eat up swap for no reason at all, like Rust :p

      1. Hugo avatar

        And the server hosted by your friend who has fibre? Yes rust it's vrmt crap but at least the game is good even if it too is badly opti ^^

        1. UltimateByte avatar

          Nope, no more servers at home, for game servers, performance has proved a little too haphazard.
          The web server is at HaiSoft as indicated in the article, I'm the one who racked it :p
          The OVH game server is at.. OVH. :p
          Then I always use the OVH server as a VPN via a dedicated IP but for my NAS which is at home. Because I've got gigabit fibre at home now, I could host whatever I want at home! But in fact it's a bit too much pressure to have a server at home I think in absolute terms. It's relaxing to know that it's in a cool rack!

          1. Hugo avatar

            I understand and you know that nothing goes through you, ducoup the ovh server (soyoustart it seems no) can be used for game servers so you have to worry more perfs on game servers, and if one day you need is you can even put game servers on your server racked at haisoft ^^ in any case well done for all this work!

          2. UltimateByte avatar

            It's an OVH EG-16 now. 89€/month. I had problems with the SoYouStart on UDP packets (annoying for the VPN), they were never able to solve the problem, so I went directly back to OVH: problem solved. A great mystery... ^^
            In absolute terms, yes, I could put a game server on my HaiSoft machine, but I don't really want to mess up the web server, which is ultra-optimised, or the network with that! I'm separating as much as possible: anything that's a bit dodgy in terms of DDoS attacks and so on is at OVH, anything that's a serious web server is at HaiSoft. At worst, if I really wanted to have extra servers, they'd probably go on my NAS, even though I don't really like the idea of mixing my personal files with game servers :p

            To sum up the current configuration:
            - HaiSoft Web server
            - OVH game/seedbox/files server
            - Personal NAS at home using OVH via VPN

            To be 100% perfect, a "game" server (SSD, with more RAM) and a separate "seedbox/files" server would be ideal but it would double the budget and then again, we're running a bit slow on the game servers at the moment so osef, it's already doing the trick! ^^

Leave a Reply