John Siu Blog

Tech - Business Tool, Personal Toys

Ghost Blog from WordPress

☰ Table of Content

Last October I moved my git server from GitLab CE to GoGs. I also planned to move my blog from WordPress to Ghost Blog at the same time, but was delayed by the heavy load at work, until now.

WordPress - King of Blog for the Mass

WordPress is a very powerful and mature blogging platform, and many companies and organizations use it for their official website.

However, just as GitLab CE, I am the only one posting in this site, I want something more lightweight, something that doesn’t require a full LAMP stack. Especially database like MySQL or MariaDB.

Ghost - New Kids On The “Blog”

Ghost started as a KickStarter Project in 2012 as both an open source GitHub Project and Ghost(Pro), a blog hosting service. Check out the wiki page if you are interested in the story behind Ghost.

What make Ghost attractive for me?

Ghost, as a NodeJS application, is a web server by itself, that eliminated the needed for standalone web server like Lighttpd or apache. Besides MySQL, it also support sqlite3, an embedded light weight database library. I don’t need standalone database.

And again, numbers talk …

Numbers Talk

Lets see the different between Ghost and WordPress in terms of system resources. Numbers are captured right after a fresh start up of all related processes.

WordPress

%CPU%MEMVSZRSSCOMMAND
0.00.111.25Mb1.30Mbmysqld_safe
0.07.7997.12Mb79.83Mbmysqld
0.00.05.96Mb0.67Mblogger -t mysqld -p daemon.error
0.00.3111.68Mb3.81Mblighttpd
0.31.7298.71Mb17.77Mbphp-fpm: master process
0.00.5298.71Mb5.89Mbphp-fpm: pool (1/2)
0.00.5298.71Mb5.89Mbphp-fpm: pool (2/2)

Ghost

%CPU%MEMVSZRSSCOMMAND
0.09.81267.61Mb101.07Mbnode ghost/index.js

Beyond the Numbers

WordPress requires full LAMP stack, database(MySql/MariaDB), web server (Lighttpd, or more commonly Apache, which use even more resource).

Ghost on the other hand, only require NodeJS. So 2 less packages to maintain and configure. Moreover, 1 process1 vs 7 processes 2.

The resource difference may not be that impressive in tables above. However, base on my own observation, Lighttpd and php-fpm tend to hold on a bit more memory over time. Additionally, memory usage reported by free is much higher before the switch, 500Mb+(before) vs 235Mb(now).


  1. I customized Ghost index.js to support HTTPS with a single node instance, which is not official supported by the Ghost development team. I will talk about it in a later post. ↩︎

  2. Number of processes for MySQL depends on setup, it can be reduced to one. PHP-FPM pool can be reduced to one, I choose to use two. It can be completely eliminated if cgi mode is used in Lighttpd. In Apache, mod_php embedded the php interpreter within Apache process, but Apache itself use more resources than Lighttpd. ↩︎

John Siu

Update: 2020-08-19
comments powered by Disqus