Ghost Blog from WordPress
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 | %MEM | VSZ | RSS | COMMAND |
---|---|---|---|---|
0.0 | 0.1 | 11.25Mb | 1.30Mb | mysqld_safe |
0.0 | 7.7 | 997.12Mb | 79.83Mb | mysqld |
0.0 | 0.0 | 5.96Mb | 0.67Mb | logger -t mysqld -p daemon.error |
0.0 | 0.3 | 111.68Mb | 3.81Mb | lighttpd |
0.3 | 1.7 | 298.71Mb | 17.77Mb | php-fpm: master process |
0.0 | 0.5 | 298.71Mb | 5.89Mb | php-fpm: pool (1/2) |
0.0 | 0.5 | 298.71Mb | 5.89Mb | php-fpm: pool (2/2) |
Ghost
%CPU | %MEM | VSZ | RSS | COMMAND |
---|---|---|---|---|
0.0 | 9.8 | 1267.61Mb | 101.07Mb | node 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).
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. ↩︎
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. ↩︎