amuck-landowner

Free Hosted Ghost

raindog308

vpsBoard Premium Member
Moderator
My employer sent me to the hinterlands of Wisconsin for a week - it's -17F (-27C) here, so I've had plenty of time to work on take-over-the-world schemes in my hotel room.

Following on to the recreating Gatsby.im thread, I read up a bit on Ghost.  What would it take to do something similar to Gatsby/wordpress.org but for Ghost?

Well...the problem I see with it is that Ghost requires a separate node.js instance per blog.  Ghost is a node.js application and doesn't sit unused like a php app.  You could put a million php apps on a server and not consume and cpu/memory.  But each node.js app requires an instance of node.js running.

So each Ghost instance runs on its own port, which isn't the problem - you can put nginx in front of it to proxy and map domains/subdomains.

But fundamentally, I think each Ghost blog would require a separate running process, 24x7.  If someone sets up a blog and never uses it, you essentially will have a process idling for that user forever.  You could say "you must login once every X weeks" or something but the fundamental problem remains.

I fired up Ghost on a CentOS box:



$ ps p 29334 o pid,rss,vsz,comm
  PID   RSS    VSZ COMMAND
29334 69624 987716 node

Figuring out how much memory a process uses is surprisingly tricky in Linux, but that suggests ~60-70MB per Ghost instance.  And that's just sitting there idling.

Let's say it's half that - 30MB.  If you had 1000 blogs on a box, you'd need nearly 32GB just so they could sit there idling, waiting for visitors who may never come.  20 more people sign up and you need another 600MB.

Plus some memory for MySQL, if you use that (by default, Ghost uses sqlite).  And CPU for nginx and all those Ghost instances.

I'm going to think some more...maybe there's a way to have the Ghost instance "hibernate" so that it shuts down if not accessed with X hours, and then is autostarted when a visitor comes.  If you blog was hibernated, the first page load would take a little longer.

Not sure how nginx might do that - it's going to sit waiting on a port, so you'd probably have to have some kind of layer between nginx and Ghost, keeping state.  If a blog is not hibernated, just let them nginx get data from Ghost.  If the blog is hibernated, start it and then connect nginx to it.  Meh...

 
 

peterw

New Member
Node.js is not supporting more than one app and ghost is not supporting more than one blog. Node.js use a lot of ram per connection. You found the reason why nobody is offering ghost hosting.
 

tuguhost

New Member
i tried to install 10 ghost in one our server that use litespeed, there are cpanel,csf firefawall, csf expolorer, clamav and softaculous.

i fill one this ghost with 50 post, and perform visitor simulation. I use 50 opera tab from 5 pc and each tab auto refresh each 5 second.

i check memory consuption and it ate almost 1 GB RAM
 

splitice

Just a little bit crazy...
Verified Provider
node.js should always be behind a reverse proxy such as nginx / lighttpd etc. Think of it like mod_php in terms of memory wastage.

You would most likely need to make a fork of Ghost in order to scale reasonably with it. Think of starting with a modification that changes the source file path based on the domain given and work from there.
 

tchen

New Member
Sounds like you want to basically build your own ghost specific PaaS.  



I'm going to think some more...maybe there's a way to have the Ghost instance "hibernate" so that it shuts down if not accessed with X hours, and then is autostarted when a visitor comes.  If you blog was hibernated, the first page load would take a little longer.



Not sure how nginx might do that - it's going to sit waiting on a port, so you'd probably have to have some kind of layer between nginx and Ghost, keeping state.  If a blog is not hibernated, just let them nginx get data from Ghost.  If the blog is hibernated, start it and then connect nginx to it.  Meh...

I'd suggest build your own performant proxy (eg. https://github.com/nodejitsu/node-http-proxy) and have it do the state and request queue management.  That'll give you the power to block on that initial wakeup request.  Bind it to redis or something fast.  You can still stick nginx/haproxy in front if it makes you feel more comfortable.

edit: added actual suggestion.   :D
 
Last edited by a moderator:

raindog308

vpsBoard Premium Member
Moderator
You would most likely need to make a fork of Ghost in order to scale reasonably with it. Think of starting with a modification that changes the source file path based on the domain given and work from there.
I think this would likely be the only way - to scale within one node.js instance.

Of course, this means keeping modifications in sync with upstream (or convincing them to adopt...my sense is that they want to get to 1.0 without another new idea).  Also plugin compatibility.

It also changes this from a sysadmin/script sort of project to a pretty hardcore javascript coding project  :blink:
 

eva2000

Active Member
yup consumes a bit of memory indeed

my Ghost blog at http://ghost.centminmod.com

smem


smem -ktp | egrep 'pm2|node'
27667 root egrep pm2|node 0 184.0K 205.0K 616.0K
6346 root pm2: Satan Daemonizer 9.1M 2.4M 3.0M 4.2M
11840 root node /home/nginx/domains/gh 6.3M 63.3M 63.9M 65.1M

memory stats = 36 days uptime and 65MB via pm2 https://github.com/Unitech/pm2


pm2 list
PM2 Process listing
┌──────────┬────┬──────┬───────┬────────┬───────────┬────────┬───────────┬────────────────────────────────┐
│ App Name │ id │ mode │ PID │ status │ Restarted │ Uptime │ memory │ err logs │
├──────────┼────┼──────┼───────┼────────┼───────────┼────────┼───────────┼────────────────────────────────┤
│ ghost1 │ 0 │ fork │ 11840 │ online │ 0 │ 36d │ 65.160 MB │ /root/.pm2/logs/ghost1-err.log │
└──────────┴────┴──────┴───────┴────────┴───────────┴────────┴───────────┴────────────────────────────────┘
PM2 PM2 log file path : /root/.pm2/pm2.log (type pm2 logs to see log streaming)


Definitely, want Nginx in front + proxy_cache
 
Last edited by a moderator:

raindog308

vpsBoard Premium Member
Moderator
Such a strange project, Ghost is...

"We want to be just blogging...because blogs are important".  But they're building on a platform that requires dedicated, unsharable resources which means it'll be limited to (a) technophiles who run their own VPSes, or (b) richer people who can afford managed VPS hosting.  (Or I suppose © will pay ghost.org to host it for them, which sounds more like a commercial enterprise/startup than a crowdfunded world-improver).  

Meanwhile, the platform they say has gotten away from its roots and is no longer focused on blogging can be run anywhere much more cheaply, appealing to...well, bloggers.
 

tortau

New Member
I was one of their KS backers and eventually, I also stopped using it. I don't use nodeJS all that much and find the whole separate process per application quite a pain. Had it running but it kept breaking (between updates) and occasionally, it would just take like 30 seconds to load and respond with content. I think it was my setup - no idea why because I was just using the guides. I'll even admit that I'm not terribly familiar with supporting nodeJS appliacation so eventually I abandoned the platform.

Honestly, the platform has failed to impress me so far, which is kinda sad because I really don't like WP as a blogging platform.
 

bauhaus

Member
Yeah, I unplugged that thing after like a 2 hour of testing. I consider myself a half decent linux user, but it is quite cumbersome to install and resource hungry. Ghost as a simple blogging platform can be nice but it needs to be rethinked at the back end. Right now is more popular just because people is tired of the old blog alternatives.

EDIT: Just because.
 
Last edited by a moderator:

wlanboy

Content Contributer
Probably more second thoughts at this point.

Free Hosted Jekyll?

:D
*sniff* you are suggesting a Ruby based project?

If you want to run a JekyII based service I would have (want) to write a WEB frontend for it.

Jekyll is a well written software (stack) and is using markdown.

But it is based on rake (terminal commands) and does not have a frontend.

But it is secure because it is generating plain js/css/html.

It might work to build a small Ruby/Phyton/Php web frontend to create markdown files and the templates.

The call of JekyII is simple and does not need any parameters.

So it can be done by a cron or by an action called by a button.
 

howardsl2

New Member
Buster is a static site generator for Ghost. You will find it by searching on GitHub. Once generated as static files it can be served directly via Nginx.
 
Last edited by a moderator:

sv01

Slow but sure
free hosted html/js/css (manage using git). so anyone can create website using their favorite web generator.
 

splitice

Just a little bit crazy...
Verified Provider
Static generation would definitely be an interesting solution. Either that or just heavy caching (its less heavy than Wordpress :p )
 

tortau

New Member
Maybe I should plug for sculpin.io since people seem to be throwing out recommendations :D

It's a PHP-based static site generator.
 
Top
amuck-landowner