Can GZIP compression benefit a 1GB Nanode?

Hi there!

I continue working trying to optimize one small Nanode (1GB RAM).

So I would like to obtain your suggestions about GZIP compression: can it benefit overall this small server (I have only two small websites hosted on it using vhosts).

Thanks in advance.

10 Replies

Compressing files and directories will impact storage moreso than anywhere else. So, it will also depend on what exact impact you're looking to make on the Nanode's storage.

One area that might help would be leveraging logrotate to manage log files. Additionally, you could set up a cron job to handle other directories and file types.

If you're looking to keep your Linode on the smallest plan but have issues with the local storage, you do have the option of supplementing the storage using either Block Storage or Object Storage.

Thank you very much for your answer.

Well, maybe I understood it very wrongly, but I was trying to find more ways to optimize the websites speed.

So, your suggestions of logrotate and other storage options are also very interesting. I'll take a look. :)

As it turns out gzip has a few different functions. Who knew?!

If you want to enable gzip compression on your websites to speed up load times, the following resources should be useful:

Additionally, if you want to optimize performance on your instance you can Tune your Database, ensure PHP is set to optimal configurations, and optimize your web server settings (Apache, Nginx).

Hi @tlambert

Thank you so much.

I read the "tune your database" guide, but unfortunately that has not much info about how to set the "directives", values to be used, etc.

Well, I ran the MySQLTuner script, but when it says my MySQL is running dangerous values regarding memory I can't find any way to reduce it. Even setting a key_buffer value inside my my.cnf file (and also restarting MySQL) does not changes anything. :(

Since your server is running on a 1GB plan, it may be due to the limited resources available. You may want to check out some other optimization docs to see if they have other suggestions that work for you.

An apache2 web server with php-fpm can run just fine in 1Gb. However, the presence of a mysql server is probably going to constrain resources pretty severely. You could look at one of two things:

  1. moving your mysql database to a managed instance; or
  2. moving your mysql database to another Linode.

In the case of #2, you can use the so-called "private IP" addresses of each Linode to allow the web server & mysql to communicate with each other. These private IP addresses are not routable to the open internet so the traffic is contained within the datacenter in which your Linodes live. However, private IP addresses are NOT SECURE so you'll need to devise some way to secure port 3306 between the two Linodes to prevent other resident systems within the datacenter from being able to snoop on your traffic.

There are a number of ways to do this -- the easiest probably being an ssh tunnel -- but there are others. For something this simple, a VPN would be overkill, IMHO.

I'm no mysql expert but I believe mysqld can use TLS-encryption…the same kind you get with https. See:

https://dev.mysql.com/doc/refman/5.7/en/encrypted-connection-protocols-ciphers.html

However, it's unclear to if you can use the same certificate that you use for your web server.

Of course, as @tlambert suggests, you can just upgrade your Linode to a bigger plan and reboot. That's probably the easiest solution of all.

-- sw

PS. I wouldn't mess with mod_deflate. IMHO, any performance improvement you get is not going to be worth the work to set it up, debug it and maintain it. Just my $.02…

Great suggestions and information. Thank you very much, @stevewi!

Maybe a bigger plan will be the best for me.

I was just wondering if using Apche cache could benefit the server overall.

Your problem is that your system probably needs more resources to do what you want it to do. Adding a cache is just going to consume more resources that you don't have. You can mostly thank your mysql instance for that…

For WordPress, the database contains basically the whole site except for the theme and other minor pieces. Caching is probably not going to help you. I'm not saying that caching can't or won't help…just that it's unlikely to help. It's certainly not worth the time/effort to set up.

Also, caching is a delicate thing. If you don't get the balance between server and browser caching correct (and the only one you control is server caching), your performance could end up being worse.

-- sw

Yes, you're right. I'll think carefully.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct