Today I felt a compulsion to install Smalltalk on my little 256MB Slicehost slice. It was an itch I just had to scratch.
My first step was to admit (to myself) that I don’t know the first thing about deploying any kind Smalltalk anywhere. I can deploy PHP and Rails in my sleep, but I’m clueless about Smalltalk. I would have to do some research.
My first resource was James Robertson’s blog. He’s the Smalltalk evangelist for Cincom Smalltalk and has created countless Smalltalk tutorials and screencasts over the years. I’ve been following his experiences installing VisualWorks Smalltalk on his Slicehost server and noted that he mentioned having a problem running his 32-bit VM on a 64-bit server. He solved that problem by installing the ia32-libs. I anticipated that I would run into the same problem since I am running a 64-bit version of Ubuntu.
My second resource was the Linode.com support library. My original plan was to install both VisualWorks and Squeak, but as time slipped away, I realized that I had dreamed too grandly. I don’t know much about Squeak, but I know nothing about VisualWorks. I realized it would be less painful to go with Squeak. I googled “deploy pharo” and found a nice Seaside deployment guide on the Linode site. I took that path of least resistance and decided to install Pharo and Pier (a CMS written in Smalltalk).
I cut and pasted the Linode commands into the terminal and in 5 minutes I was ready to go. But, when I issued the command to start Seaside, I got the message: “Could not find squeak”. I recalled James Robertson’s gotcha and installed the 32-bit Intel libraries. I’m running Ubuntu, so I used this command:
sudo aptitude install ia32-libs
I won’t post the Linode article here; you can check it out for yourself if you’re interested. I just cut and pasted away as directed. Seaside started up on port 8080 perfectly. I poked around a little, took a few screenshots, then shut it down. It’s completely unsecured, and since I don’t know how to make it safe yet, I don’t want to leave it running unprotected. Right now I’m happy with taking baby steps.
By the way, here’s the command I used to run a squeak without a gui (headless). I’m saving it here for future reference; I had to do considerable digging to find it.
/opt/pharo-vm-15-2/squeak -vm-display-null /srv/www/pier-app-1.2/Contents/Resources/pier.image
My next step is to configure Apache to proxy Seaside. Once I get the proxy working, and learn more about securing the site, I’ll leave Seaside running. By the way, I have proof of life. Cool.
When I saw this page I rewarded myself with a cup of hot chocolate.
Keep hacking…
Today I put up a proof of concept Seaside Smalltalk site…for a few minutes. You can read about it on my Smalltalk blog if you are interested in this nerdy stuff: SmalltalkTheGoodParts.com
Keep hacking…
I recently rented a 256MB slice from Slicehost for my SmalltalkTheGoodParts.com work. I have a WordPress blog running there, and I’ll be installing Smalltalk and Seaside as part of my self-taught Smalltalk course.
Bad-mouthing Dreamhost
I hear a lot of bad-mouthing about Dreamhost. I have several domains on DH, and I’ve done some of that bad-mouthing myself. However, I’m here to tell you that all is not gloom and doom at Dreamhost. Nor is Slicehost always perfect.
Server Down at Slicehost
Slicehost is subject to the same laws of physics as Dreamhost. Within 24 hours of starting my slice I got an email informing me my server would be out of action for an hour or two. The Slice guys gave me a specific time and did their thing at the appointed hour. Sure, the server was down, but the nice thing about this “negative” experieince was that Slicehost noticed the problem before I did and let me know in advance that things were going South.
Server Down at Dreamhost
That same week my Dreamhost server was out of action every morning at 1AM and had to be rebooted by the Dreamhost sys admins. I noticed this because I work late. The cause of the problem, I am told, was a faulty RAID subsytem. The unannounced outages were so common that I became discouraged and decided to move the newest of my domains (my Smalltalk site) to Slicehost. To Dreamhost’s credit the faulty hardware was replaced and I haven’t had any further problems.
My main gripe with Dreamhost is the poor communication when these problems arise. When I’m warned in advance, I’m quite tolerant. I’ve worked on large systems and I understand that things break. Just let me know that your team is on top of it, and don’t try to BS me.
A 256MB Slicehost Slice vs Dreamhost Shared Host
Now that all of my servers are running fine and dandy, I ran a few tests to get a general idea of the relative speeds of my Dreamhost shared host and my Slicehost slice. To make it more interesting, I ran the same test on my i7 iMac.
The Test
I usually run a Ruby Fibonacci generator to see what level of processing speed I’m dealing with. This test puts a 100% load on the CPU, so it’s a good idea to keep it brief. On a shared host it’s a good idea to fly under the radar.
# fib.rb
require ‘profile’
def fib(n)
return n if n < 2
return fib(n-2)+fib(n-1)
end
1.upto(22) do |n|
puts(fib(n));
end
Slicehost 256MB Slice
% cumulative self self total
time seconds seconds calls ms/call ms/call name
77.51 20.89 20.89 150024 0.14 2.48 Object#fib
9.87 23.55 2.66 150024 0.02 0.02 Fixnum#<
8.53 25.85 2.30 150002 0.02 0.02 Fixnum#-
4.08 26.95 1.10 75001 0.01 0.01 Fixnum#+
0.00 26.95 0.00 22 0.00 0.00 Kernel.puts
0.00 26.95 0.00 44 0.00 0.00 IO#write
0.00 26.95 0.00 22 0.00 0.00 Fixnum#to_s
0.00 26.95 0.00 1 0.00 26950.00 Integer#upto
0.00 26.95 0.00 1 0.00 0.00 Module#method_added
0.00 26.95 0.00 1 0.00 26950.00 #toplevel
Dreamhost
% cumulative self self total
time seconds seconds calls ms/call ms/call name
77.87 16.68 16.68 150024 0.11 1.96 Object#fib
9.24 18.66 1.98 150024 0.01 0.01 Fixnum#<
8.50 20.48 1.82 150002 0.01 0.01 Fixnum#-
4.39 21.42 0.94 75001 0.01 0.01 Fixnum#+
0.00 21.42 0.00 22 0.00 0.00 Kernel.puts
0.00 21.42 0.00 44 0.00 0.00 IO#write
0.00 21.42 0.00 1 0.00 21420.00 Integer#upto
0.00 21.42 0.00 1 0.00 0.00 Module#method_added
0.00 21.42 0.00 22 0.00 0.00 Fixnum#to_s
0.00 21.42 0.00 1 0.00 21420.00 #toplevel
iMac i7
% cumulative self self total
time seconds seconds calls ms/call ms/call name
76.73 9.10 9.10 150024 0.06 1.09 Object#fib
10.46 10.34 1.24 150024 0.01 0.01 Fixnum#<
8.35 11.33 0.99 150002 0.01 0.01 Fixnum#-
4.38 11.85 0.52 75001 0.01 0.01 Fixnum#+
0.08 11.86 0.01 44 0.23 0.23 IO#write
0.00 11.86 0.00 1 0.00 11860.00 Integer#upto
0.00 11.86 0.00 22 0.00 0.00 Fixnum#to_s
0.00 11.86 0.00 1 0.00 0.00 Module#method_added
0.00 11.86 0.00 22 0.00 0.45 Kernel.puts
0.00 11.86 0.00 1 0.00 11860.00 #toplevel
Dreamhost Edges out the Little Slice
You can see that Dreamhost runs this test a little quicker than the Slice. This jibes with my gut feeling that the little slice is slightly underpowered. The Really Nice Thing thing about Slicehost is that I can turn up the juice if I need it. I can’t do that at Dreamhost. Where Slicehost really wins is that I can run my own Linux box for cheap.
Conclusion
If I could have only one account I would probably stick with Dreamhost. I’m lazy enough to appreciate all the goodies DH provides, along with infinite bandwidth and storage. However, I’d rather not choose. Dreamhost and the Tiny Slice are affordable enough that I can have Dreamhost for the cheap goodies, and Slicehost for the complete freedom to do whatever I want with my Linux server, including running Smalltalk.
Happy hacking…