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...
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...