All about the technical things at Tanga:

We use Joyent Accelerators.

What’s cool to use:
  • asset_packager It packages up all your javascript and css files into one file each. Also does minimizing and reduces whitespace. If running on edge rails and are using the asset_host functionality, you’ll need to remove some code from the plugin. I should talk to the guy about that.
  • exception notifier Tells me when stuff breaks.
  • attachment_fu Handles file uploads. I had to modify it a lot to do SWF uploads. I used it with image_science. image_science doesn’t deal nicely with certain gifts, so I rename gifs to pngs.
  • ActiveMerchant is a great Ruby credit card processing library. No complaints.
  • RSpec is fantastic for testing. All my new tests are doing using RSpec.
Other random notes:
  • I’ve got three accelerators running mongrels. Mongrels do the dynamic Rails page generation. Static files are served by lighttpd. Load balancing of the mongrels is done by a Big-IP. The Big-IP also does hardware SSL.
  • Rough benchmark shows that I can do a few hundred dynamic Rails pages per second. It’s fast enough for me. Should scale up to a couple thousand per second just by adding new accelerators.
  • Subversion is used for source code version control.
  • I do (or used to do, hasn’t worked for a while) continuous integration. So, on every subversion check in, all the tests should run and it should tell the developers if stuff breaks.
  • Nagios is running on a friend’s server. It monitors Tanga—watches stuff like disk space, tries to log in to the website, make sure the front page loads ok, makes sure that the media servers serve stuff ok, checks to make sure the ssl certificate for tanga is valid, stuff like that. It’s great! I love how flexible it is. It’s really easy to customize and extend.
  • Backups are sent to Amazon’s S3 using a modified copy of S3 Rake.
  • I’m using postgresql 8.2.4. Works great! Worried about replication though.

Stats

note: I have a lot more tests—for some reason, only the RSpec tests are included in this, the rest of the old-school tests are not included in the total.

+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Libraries            |   606 |   482 |      21 |      74 |   3 |     4 |
| Models               |  3618 |  2887 |      64 |     454 |   7 |     4 |
| Helpers              |   646 |   553 |       0 |      67 |   0 |     6 |
| Components           |     0 |     0 |       0 |       0 |   0 |     0 |
| Controllers          |  2844 |  2400 |      53 |     329 |   6 |     5 |
| APIs                 |     0 |     0 |       0 |       0 |   0 |     0 |
| Model specs          |   817 |   679 |       0 |       2 |   0 |   337 |
| View specs           |   284 |   241 |       0 |       1 |   0 |   239 |
| Controller specs     |   415 |   335 |       0 |       1 |   0 |   333 |
| Helper specs         |   284 |   241 |       0 |       1 |   0 |   239 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                |  9514 |  7818 |     138 |     929 |   6 |     6 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 6322     Test LOC: 1496     Code to Test Ratio: 1:0.2

Books and websites

Other useful software

Owies

We’ve had some downtime:

  • Every so often, our credit card provider (authorize.net) acts up and gives us an empty response back when we try to authorize a credit card. I’m rewriting our credit card processing software so I’m curious if the problem happens after the rewrite.
  • Joyent is investigating a problem with SSL and the Big-IP load balancer. I’m not sure if they’ve resolved it yet. The problem manifests itself by not letting people connect to https://secure.tanga.com. Which people need to login and buy stuff from us. Highly important! And unfortunately, their monitoring system wasn’t set up to catch this sort of problem. It’s really unfortunate when I go to bed and then wake up to see eight hours of past downtime.

Nagios is great for letting me know about problems when they occur—I just need to be awake.

Other misc

We use AppRiver for email (Exchange) hosting.

I’ve got a BlackBerry Pearl that keeps me in the email loop.

Leave a Reply