typo 3.99.3 → 3.99.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. data/README +1 -39
  2. data/app/controllers/admin/feedback_controller.rb +71 -0
  3. data/app/controllers/articles_controller.rb +11 -0
  4. data/app/helpers/admin/feedback_helper.rb +9 -0
  5. data/app/helpers/application_helper.rb +5 -1
  6. data/app/models/article.rb +21 -1
  7. data/app/models/blog.rb +25 -1
  8. data/app/models/comment.rb +12 -2
  9. data/app/models/content.rb +63 -4
  10. data/app/models/ping.rb +3 -3
  11. data/app/models/text_filter.rb +1 -1
  12. data/app/models/trackback.rb +12 -1
  13. data/app/views/admin/content/_form.rhtml +2 -2
  14. data/app/views/admin/feedback/_item.rhtml +15 -0
  15. data/app/views/admin/feedback/list.rhtml +46 -0
  16. data/app/views/admin/general/index.rhtml +26 -0
  17. data/app/views/articles/_comment.rhtml +3 -0
  18. data/app/views/articles/read.rhtml +2 -2
  19. data/app/views/layouts/administration.rhtml +1 -0
  20. data/bin/typo +3 -23
  21. data/components/plugins/sidebars/archives_controller.rb +1 -1
  22. data/components/plugins/sidebars/xml_controller.rb +1 -1
  23. data/components/plugins/textfilters/flickr_controller.rb +1 -1
  24. data/components/plugins/textfilters/sparkline_controller.rb +3 -2
  25. data/components/plugins/textfilters/textile_controller.rb +6 -0
  26. data/config/mongrel.conf +2 -0
  27. data/db/converters/wordpress2.rb +291 -0
  28. data/db/migrate/022_superclass_trackbacks.rb +1 -0
  29. data/db/migrate/023_superclass_pages.rb +4 -3
  30. data/db/schema.rb +4 -4
  31. data/doc/Installer.txt +81 -6
  32. data/doc/typo-4.0-release-notes.txt +135 -0
  33. data/installer/rails-installer.rb +22 -3
  34. data/installer/rails-installer/commands.rb +27 -26
  35. data/installer/rails-installer/web-servers.rb +2 -0
  36. data/lib/sidebars/plugin.rb +10 -8
  37. data/lib/tasks/release.rake +1 -1
  38. data/lib/typo_version.rb +1 -1
  39. data/public/javascripts/dragdrop.js +252 -63
  40. data/public/javascripts/effects.js +15 -10
  41. data/public/javascripts/prototype.js +59 -38
  42. data/public/javascripts/typo.js +10 -0
  43. data/public/stylesheets/administration.css +111 -66
  44. data/test/functional/admin/feedback_controller_test.rb +24 -0
  45. data/test/mocks/test/http_mock.rb +2 -1
  46. data/test/unit/article_test.rb +6 -0
  47. data/test/unit/comment_test.rb +12 -9
  48. data/test/unit/ping_test.rb +1 -1
  49. data/test/unit/trackback_test.rb +3 -5
  50. data/themes/azure/stylesheets/azure.css +7 -0
  51. data/themes/scribbish/views/articles/_article.rhtml +1 -1
  52. data/themes/scribbish/views/articles/_comment_form.rhtml +1 -1
  53. data/vendor/akismet/Akismet.rb +36 -17
  54. data/vendor/plugins/expiring_action_cache/lib/actionparamcache.rb +3 -1
  55. metadata +11 -42
  56. data/installer/rails-installer/web-server.rb +0 -108
  57. data/tmp/cache/META/DATA/ACTION_PARAM/10.1.0.181/articles/index/.cache +0 -537
  58. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/articles/index/.cache +0 -537
  59. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache +0 -671
  60. data/tmp/cache/META/DATA/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache +0 -401
  61. data/tmp/cache/META/META/ACTION_PARAM/10.1.0.181/articles/index/.cache +0 -2
  62. data/tmp/cache/META/META/ACTION_PARAM/localhost/articles/index/.cache +0 -2
  63. data/tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=atom&type=feed.cache +0 -2
  64. data/tmp/cache/META/META/ACTION_PARAM/localhost/xml/feed/format=rss20&type=feed.cache +0 -2
@@ -1,671 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
3
- <title>*scottstuff*</title>
4
- <id>tag:localhost,2005:Typo</id>
5
- <generator uri="http://www.typosphere.org" version="4.0">Typo</generator>
6
- <link href="http://localhost/xml/atom/feed.xml" rel="self" type="application/atom+xml"/>
7
- <link href="http://localhost/" rel="alternate" type="text/html"/>
8
- <updated>2006-07-09T08:47:58-07:00</updated>
9
- <entry>
10
- <author>
11
- <name>Scott Laird</name>
12
- </author>
13
- <id>urn:uuid:7e2dde43-86c0-443f-9cd1-8351ef13ffa9</id>
14
- <published>2006-07-09T08:47:58-07:00</published>
15
- <updated>2006-07-09T08:47:58-07:00</updated>
16
- <title type="html">AT&amp;amp;T</title>
17
- <link href="http://localhost/articles/2006/07/09/at-t" rel="alternate" type="text/html"/>
18
- <summary type="html">&lt;p&gt;Does the &amp;amp; get rendered right in sitemaps?&lt;/p&gt;</summary>
19
- <content type="html">&lt;p&gt;Does the &amp;amp; get rendered right in sitemaps?&lt;/p&gt;</content>
20
- </entry>
21
- <entry>
22
- <author>
23
- <name>Scott Laird</name>
24
- </author>
25
- <id>urn:uuid:72b555a8-f6f9-498c-81b7-763d28bdf0ba</id>
26
- <published>2006-01-20T21:48:00-08:00</published>
27
- <updated>2006-06-21T20:26:42-07:00</updated>
28
- <title type="html">foo</title>
29
- <link href="http://localhost/articles/2006/01/20/foo" rel="alternate" type="text/html"/>
30
- <summary type="html">&lt;p&gt;sadfsadfasdf&lt;/p&gt;</summary>
31
- <content type="html">&lt;p&gt;sadfsadfasdf&lt;/p&gt;</content>
32
- </entry>
33
- <entry>
34
- <author>
35
- <name>Scott Laird</name>
36
- </author>
37
- <id>urn:uuid:46230d6fc2f05b5c545d139e089aec5e</id>
38
- <published>2005-11-03T15:02:49-08:00</published>
39
- <updated>2006-06-21T20:24:48-07:00</updated>
40
- <title type="html">to_proc</title>
41
- <link href="http://localhost/articles/2005/11/03/to_proc" rel="alternate" type="text/html"/>
42
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
43
- <category term="programming" scheme="http://localhost/articles/tag/programming"/>
44
- <summary type="html">&lt;p&gt;&lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi"&gt;Dave Thomas&lt;/a&gt; just &lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/ToProc.rdoc"&gt;pointed out&lt;/a&gt; a great little hack from the &lt;a href="http://extensions.rubyforge.org/"&gt;Ruby Extensions Project&lt;/a&gt;. They added this little snippet to &lt;code&gt;Object&lt;/code&gt;:&lt;/p&gt;
45
-
46
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;to_proc&lt;/span&gt;
47
- &lt;span class="ident"&gt;proc&lt;/span&gt; &lt;span class="punct"&gt;{&lt;/span&gt; &lt;span class="punct"&gt;|&lt;/span&gt;&lt;span class="ident"&gt;obj&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="punct"&gt;*&lt;/span&gt;&lt;span class="ident"&gt;args&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt; &lt;span class="ident"&gt;obj&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;send&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="constant"&gt;self&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="punct"&gt;*&lt;/span&gt;&lt;span class="ident"&gt;args&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt; &lt;span class="punct"&gt;}&lt;/span&gt;
48
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
49
-
50
- &lt;p&gt;and now instead of writing this:&lt;/p&gt;
51
-
52
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;result&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;names&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;map&lt;/span&gt; &lt;span class="punct"&gt;{|&lt;/span&gt;&lt;span class="ident"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt; &lt;span class="ident"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;upcase&lt;/span&gt;&lt;span class="punct"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
53
-
54
- &lt;p&gt;you can write this:&lt;/p&gt;
55
-
56
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;result&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;names&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;map&lt;/span&gt;&lt;span class="punct"&gt;(&amp;amp;&lt;/span&gt;&lt;span class="symbol"&gt;:upcase&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
57
-
58
- &lt;p&gt;The &amp;#8220;wave this method over all objects in a collection&amp;#8221; idiom is very common in Ruby, and Ruby&amp;#8217;s native block syntax isn&amp;#8217;t &lt;em&gt;too&lt;/em&gt; bad for this use, but it&amp;#8217;s not as clean as Python&amp;#8217;s list comprehension syntax would be:&lt;/p&gt;
59
-
60
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_python "&gt;result = [n.upper() for n in names]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
61
-
62
- &lt;p&gt;With the &lt;code&gt;to_proc&lt;/code&gt; hack in place, Ruby&amp;#8217;s code is a bit cleaner, at the cost of using a non-standard extension to the language. Personally, I&amp;#8217;d prefer to see &lt;code&gt;map&lt;/code&gt; extended to take an optional symbol, then we could ditch the ugly &lt;code&gt;&amp;amp;&lt;/code&gt; when we&amp;#8217;re using a single method with no parameters.&lt;/p&gt;</summary>
63
- <content type="html">&lt;p&gt;&lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi"&gt;Dave Thomas&lt;/a&gt; just &lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/ToProc.rdoc"&gt;pointed out&lt;/a&gt; a great little hack from the &lt;a href="http://extensions.rubyforge.org/"&gt;Ruby Extensions Project&lt;/a&gt;. They added this little snippet to &lt;code&gt;Object&lt;/code&gt;:&lt;/p&gt;
64
-
65
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;to_proc&lt;/span&gt;
66
- &lt;span class="ident"&gt;proc&lt;/span&gt; &lt;span class="punct"&gt;{&lt;/span&gt; &lt;span class="punct"&gt;|&lt;/span&gt;&lt;span class="ident"&gt;obj&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="punct"&gt;*&lt;/span&gt;&lt;span class="ident"&gt;args&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt; &lt;span class="ident"&gt;obj&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;send&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="constant"&gt;self&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt; &lt;span class="punct"&gt;*&lt;/span&gt;&lt;span class="ident"&gt;args&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt; &lt;span class="punct"&gt;}&lt;/span&gt;
67
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
68
-
69
- &lt;p&gt;and now instead of writing this:&lt;/p&gt;
70
-
71
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;result&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;names&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;map&lt;/span&gt; &lt;span class="punct"&gt;{|&lt;/span&gt;&lt;span class="ident"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;|&lt;/span&gt; &lt;span class="ident"&gt;name&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;upcase&lt;/span&gt;&lt;span class="punct"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
72
-
73
- &lt;p&gt;you can write this:&lt;/p&gt;
74
-
75
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;result&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="ident"&gt;names&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;map&lt;/span&gt;&lt;span class="punct"&gt;(&amp;amp;&lt;/span&gt;&lt;span class="symbol"&gt;:upcase&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
76
-
77
- &lt;p&gt;The &amp;#8220;wave this method over all objects in a collection&amp;#8221; idiom is very common in Ruby, and Ruby&amp;#8217;s native block syntax isn&amp;#8217;t &lt;em&gt;too&lt;/em&gt; bad for this use, but it&amp;#8217;s not as clean as Python&amp;#8217;s list comprehension syntax would be:&lt;/p&gt;
78
-
79
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_python "&gt;result = [n.upper() for n in names]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
80
-
81
- &lt;p&gt;With the &lt;code&gt;to_proc&lt;/code&gt; hack in place, Ruby&amp;#8217;s code is a bit cleaner, at the cost of using a non-standard extension to the language. Personally, I&amp;#8217;d prefer to see &lt;code&gt;map&lt;/code&gt; extended to take an optional symbol, then we could ditch the ugly &lt;code&gt;&amp;amp;&lt;/code&gt; when we&amp;#8217;re using a single method with no parameters.&lt;/p&gt;</content>
82
- </entry>
83
- <entry>
84
- <author>
85
- <name>Scott Laird</name>
86
- </author>
87
- <id>urn:uuid:339c8be347aab7dacaf05b14ec602146</id>
88
- <published>2005-10-31T08:32:42-08:00</published>
89
- <updated>2006-06-21T20:26:42-07:00</updated>
90
- <title type="html">Migrating in two dimensions</title>
91
- <link href="http://localhost/articles/2005/10/31/migrating-in-two-dimensions" rel="alternate" type="text/html"/>
92
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
93
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
94
- <category term="typo" scheme="http://localhost/articles/tag/typo"/>
95
- <category term="migrations" scheme="http://localhost/articles/tag/migrations"/>
96
- <category term="database" scheme="http://localhost/articles/tag/database"/>
97
- <summary type="html">&lt;p&gt;This seems to be the season for &lt;a href="http://glu.ttono.us/articles/2005/10/27/the-joy-of-migrations"&gt;talking about&lt;/a&gt; &lt;a href="http://api.rubyonrails.com/classes/ActiveRecord/Migration.html"&gt;Rails migrations&lt;/a&gt;. A lot of people are finally discovering them and finding that they&amp;#8217;re very useful for maintaining your database schema over time. I&amp;#8217;m a big fan of Rails migrations; we&amp;#8217;ve been using them with &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; since the middle of July, when they were all new and shiny. We&amp;#8217;re currently up to 24 migrations in the &lt;a href="http://typo.leetsoft.com/trac/browser/trunk/db/migrate/"&gt;Typo source tree&lt;/a&gt;. We&amp;#8217;re even using migrations to create our initial database, via my &lt;a href="http://scottstuff.net/blog/articles/tag/schema"&gt;Schema Generator&lt;/a&gt;. I haven&amp;#8217;t done a formal survey, but I suspect that Typo is the biggest open-source user of migrations, and may actually be the biggest user overall.&lt;/p&gt;
98
-
99
- &lt;p&gt;The big problem is that we&amp;#8217;ve been using migrations wrong the whole time, and we just realized it.&lt;/p&gt;
100
-
101
- &lt;p&gt;There are probably a dozen bugs in Typo&amp;#8217;s bug tracker that boil down to &amp;#8220;I fell behind the trunk and now &lt;code&gt;rake migrate&lt;/code&gt; throws exceptions and I can&amp;#8217;t upgrade anymore.&amp;#8221; The problem is that migrations are designed to run against an earlier version of your database, but they use the &lt;em&gt;current&lt;/em&gt; version of your code. The first time that this caused problems was with the migration from Typo 2.0 to 2.5&amp;#8211;we&amp;#8217;d added two new fields to &lt;code&gt;articles&lt;/code&gt;. Migration number 7 added the &lt;code&gt;permalink&lt;/code&gt; field and a &lt;code&gt;before_save&lt;/code&gt; hook to make sure that all saved articles have permalinks. Then migration number 9 added GUIDs and a second &lt;code&gt;before_save&lt;/code&gt; hook to fill the &lt;code&gt;guid&lt;/code&gt; field. Both migrations did &lt;code&gt;Articles.find(:all).each { |a| a.save }&lt;/code&gt; to update each &lt;code&gt;Article&lt;/code&gt; and populate the new fields.&lt;/p&gt;
102
-
103
- &lt;p&gt;This worked great for developers who frequently upgraded. A few days after the GUID migration went in, though, we started getting weird bug reports&amp;#8211;users who tried to do both upgrades at the same time found that migration number 7 was dying. What was happening was that migration number 7 added the new &lt;code&gt;permalink&lt;/code&gt; field to &lt;code&gt;articles&lt;/code&gt;, but when it went to run the &lt;code&gt;save&lt;/code&gt; loop &lt;em&gt;both&lt;/em&gt; &lt;code&gt;before_save&lt;/code&gt; hooks ran, and Typo tried to add a GUID to each article. However, the &lt;code&gt;guid&lt;/code&gt; field didn&amp;#8217;t exist yet, so the migration threw a bunch of exceptions and died.&lt;/p&gt;
104
-
105
- &lt;p&gt;This caused a bunch of grumbling on the Typo IRC channel. We threw around a bunch of possible fixes. Our favorite was separating migrations into two parts&amp;#8211;a schema change part and a data change part. First we&amp;#8217;d run all of the schema changes, and then update all of the data. As a work-around, we added a hack that checked the current schema version and disabled specific &lt;code&gt;before_save&lt;/code&gt; filters for older versions.&lt;/p&gt;
106
-
107
- &lt;p&gt;We managed to keep this little bandaid working until a couple weeks ago, when a huge set of new migrations went it; they renamed the &lt;code&gt;articles&lt;/code&gt; table and merged several other tables into the new &lt;code&gt;contents&lt;/code&gt; table using &lt;a href="http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance"&gt;STI&lt;/a&gt;. And, again, we found that older migrations broke when users tried to upgrade from Typo 2.5.6 to the current dev tree. Unlink the permalink/guid case, this time there was no simple workaround. We couldn&amp;#8217;t just add a couple &lt;code&gt;if&lt;/code&gt; statements in a filter and make it all go away.&lt;/p&gt;
108
-
109
- &lt;p&gt;The fundamental problem is that we were using the wrong mental model for migrations. I saw migrations as a one-dimensional thing&amp;#8211;a list of steps for migrating old data into the new format. In this view, the migration for going from schema version 6 to schema version 7 is constant&amp;#8211;once it&amp;#8217;s been written, the only reason to change it is if a bug turns up in the logic for that migration. Otherwise, the migration code should remain unchanged over time.&lt;/p&gt;
110
-
111
- &lt;p&gt;And that&amp;#8217;s the problem&amp;#8211;migrations &lt;em&gt;aren&amp;#8217;t&lt;/em&gt; one-dimensional. They are (and &lt;em&gt;need to be&lt;/em&gt;) two dimensional&amp;#8211;the schema version is one dimension and the code version is the other. Individual migrations exist to migrate from a specific old schema version to the current version, &lt;em&gt;using the current code&lt;/em&gt;. Each migration &lt;em&gt;should&lt;/em&gt; change over time to adapt to the changes in the code. So, the right fix for the &lt;code&gt;permalink&lt;/code&gt; migration that caused so many problems &lt;em&gt;wasn&amp;#8217;t&lt;/em&gt; to add a bunch of logic to &lt;code&gt;before_save&lt;/code&gt;. Instead, we should have deleted the entire &lt;code&gt;save&lt;/code&gt; loop from the migration, and trusted the GUID migration to update both fields. If that wasn&amp;#8217;t good enough, then we should have added a new migration at the end to do permalink cleanup after the GUIDs were added.&lt;/p&gt;
112
-
113
- &lt;p&gt;Once I came to grips with this, the migration changes needed to allow 2.5.x users to upgrade to the current trunk were pretty simple, and took about 5 minutes to write and test.&lt;/p&gt;
114
-
115
- &lt;p&gt;Or was I the only person in the Rails universe who thought about migrations this way?&lt;/p&gt;</summary>
116
- <content type="html">&lt;p&gt;This seems to be the season for &lt;a href="http://glu.ttono.us/articles/2005/10/27/the-joy-of-migrations"&gt;talking about&lt;/a&gt; &lt;a href="http://api.rubyonrails.com/classes/ActiveRecord/Migration.html"&gt;Rails migrations&lt;/a&gt;. A lot of people are finally discovering them and finding that they&amp;#8217;re very useful for maintaining your database schema over time. I&amp;#8217;m a big fan of Rails migrations; we&amp;#8217;ve been using them with &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; since the middle of July, when they were all new and shiny. We&amp;#8217;re currently up to 24 migrations in the &lt;a href="http://typo.leetsoft.com/trac/browser/trunk/db/migrate/"&gt;Typo source tree&lt;/a&gt;. We&amp;#8217;re even using migrations to create our initial database, via my &lt;a href="http://scottstuff.net/blog/articles/tag/schema"&gt;Schema Generator&lt;/a&gt;. I haven&amp;#8217;t done a formal survey, but I suspect that Typo is the biggest open-source user of migrations, and may actually be the biggest user overall.&lt;/p&gt;
117
-
118
- &lt;p&gt;The big problem is that we&amp;#8217;ve been using migrations wrong the whole time, and we just realized it.&lt;/p&gt;
119
-
120
- &lt;p&gt;There are probably a dozen bugs in Typo&amp;#8217;s bug tracker that boil down to &amp;#8220;I fell behind the trunk and now &lt;code&gt;rake migrate&lt;/code&gt; throws exceptions and I can&amp;#8217;t upgrade anymore.&amp;#8221; The problem is that migrations are designed to run against an earlier version of your database, but they use the &lt;em&gt;current&lt;/em&gt; version of your code. The first time that this caused problems was with the migration from Typo 2.0 to 2.5&amp;#8211;we&amp;#8217;d added two new fields to &lt;code&gt;articles&lt;/code&gt;. Migration number 7 added the &lt;code&gt;permalink&lt;/code&gt; field and a &lt;code&gt;before_save&lt;/code&gt; hook to make sure that all saved articles have permalinks. Then migration number 9 added GUIDs and a second &lt;code&gt;before_save&lt;/code&gt; hook to fill the &lt;code&gt;guid&lt;/code&gt; field. Both migrations did &lt;code&gt;Articles.find(:all).each { |a| a.save }&lt;/code&gt; to update each &lt;code&gt;Article&lt;/code&gt; and populate the new fields.&lt;/p&gt;
121
-
122
- &lt;p&gt;This worked great for developers who frequently upgraded. A few days after the GUID migration went in, though, we started getting weird bug reports&amp;#8211;users who tried to do both upgrades at the same time found that migration number 7 was dying. What was happening was that migration number 7 added the new &lt;code&gt;permalink&lt;/code&gt; field to &lt;code&gt;articles&lt;/code&gt;, but when it went to run the &lt;code&gt;save&lt;/code&gt; loop &lt;em&gt;both&lt;/em&gt; &lt;code&gt;before_save&lt;/code&gt; hooks ran, and Typo tried to add a GUID to each article. However, the &lt;code&gt;guid&lt;/code&gt; field didn&amp;#8217;t exist yet, so the migration threw a bunch of exceptions and died.&lt;/p&gt;
123
-
124
- &lt;p&gt;This caused a bunch of grumbling on the Typo IRC channel. We threw around a bunch of possible fixes. Our favorite was separating migrations into two parts&amp;#8211;a schema change part and a data change part. First we&amp;#8217;d run all of the schema changes, and then update all of the data. As a work-around, we added a hack that checked the current schema version and disabled specific &lt;code&gt;before_save&lt;/code&gt; filters for older versions.&lt;/p&gt;
125
-
126
- &lt;p&gt;We managed to keep this little bandaid working until a couple weeks ago, when a huge set of new migrations went it; they renamed the &lt;code&gt;articles&lt;/code&gt; table and merged several other tables into the new &lt;code&gt;contents&lt;/code&gt; table using &lt;a href="http://wiki.rubyonrails.com/rails/pages/SingleTableInheritance"&gt;STI&lt;/a&gt;. And, again, we found that older migrations broke when users tried to upgrade from Typo 2.5.6 to the current dev tree. Unlink the permalink/guid case, this time there was no simple workaround. We couldn&amp;#8217;t just add a couple &lt;code&gt;if&lt;/code&gt; statements in a filter and make it all go away.&lt;/p&gt;
127
-
128
- &lt;p&gt;The fundamental problem is that we were using the wrong mental model for migrations. I saw migrations as a one-dimensional thing&amp;#8211;a list of steps for migrating old data into the new format. In this view, the migration for going from schema version 6 to schema version 7 is constant&amp;#8211;once it&amp;#8217;s been written, the only reason to change it is if a bug turns up in the logic for that migration. Otherwise, the migration code should remain unchanged over time.&lt;/p&gt;
129
-
130
- &lt;p&gt;And that&amp;#8217;s the problem&amp;#8211;migrations &lt;em&gt;aren&amp;#8217;t&lt;/em&gt; one-dimensional. They are (and &lt;em&gt;need to be&lt;/em&gt;) two dimensional&amp;#8211;the schema version is one dimension and the code version is the other. Individual migrations exist to migrate from a specific old schema version to the current version, &lt;em&gt;using the current code&lt;/em&gt;. Each migration &lt;em&gt;should&lt;/em&gt; change over time to adapt to the changes in the code. So, the right fix for the &lt;code&gt;permalink&lt;/code&gt; migration that caused so many problems &lt;em&gt;wasn&amp;#8217;t&lt;/em&gt; to add a bunch of logic to &lt;code&gt;before_save&lt;/code&gt;. Instead, we should have deleted the entire &lt;code&gt;save&lt;/code&gt; loop from the migration, and trusted the GUID migration to update both fields. If that wasn&amp;#8217;t good enough, then we should have added a new migration at the end to do permalink cleanup after the GUIDs were added.&lt;/p&gt;
131
-
132
- &lt;p&gt;Once I came to grips with this, the migration changes needed to allow 2.5.x users to upgrade to the current trunk were pretty simple, and took about 5 minutes to write and test.&lt;/p&gt;
133
-
134
- &lt;p&gt;Or was I the only person in the Rails universe who thought about migrations this way?&lt;/p&gt;</content>
135
- </entry>
136
- <entry>
137
- <author>
138
- <name>Scott Laird</name>
139
- </author>
140
- <id>urn:uuid:42c98cc47201a49a611e628a2feee115</id>
141
- <published>2005-10-30T19:49:49-08:00</published>
142
- <updated>2006-06-21T20:26:42-07:00</updated>
143
- <title type="html">Have you seen my shutter?</title>
144
- <link href="http://localhost/articles/2005/10/30/have-you-seen-my-shutter" rel="alternate" type="text/html"/>
145
- <category term="photography" scheme="http://localhost/articles/tag/photography"/>
146
- <category term="broken" scheme="http://localhost/articles/tag/broken"/>
147
- <category term="camera" scheme="http://localhost/articles/tag/camera"/>
148
- <summary type="html">&lt;p&gt;This was one of those weekends where I practically lived with a camera in my hand; I took around 500 halloween pictures yesterday and then moved on to Christmas-card pictures of the kids today. Everything was going well enough until late in the day, when I was trying to get a nice black and white shot of my son. In the middle of shooting I took a quick peek at my camera&amp;#8217;s LCD display and noticed that the last shot had been &lt;em&gt;completely&lt;/em&gt; underexposed. So I scrolled back a few shots and discovered that I&amp;#8217;d been shooting nothing but black frames for about 30 seconds. One second it worked, the next it didn&amp;#8217;t. All of the camera settings were the same&amp;#8211;same aperture, ISO, and shutter speed. Same light. But no picture.&lt;/p&gt;
149
-
150
- &lt;p&gt;I double-checked things, but I was still getting nothing but black. With a sinking feeling, I popped the lens off and took a multi-second exposure while staring into the camera. I could see the mirror flip up, but instead of seeing the sensor, I was left staring at a closed shutter, which strongly suggests that my shutter has died. The shutter on my D60 is rated for 30,000 exposures, and I think I&amp;#8217;m around 25,000 right now, so it&amp;#8217;s a bit earlier then normal, but not utterly unexpected.&lt;/p&gt;
151
-
152
- &lt;p&gt;So, I guess I&amp;#8217;ll be packing it up and shipping it off to Canon for service this week. I&amp;#8217;m not sure how long it&amp;#8217;ll take to get back, but I was hoping to use it at &lt;a href="http://www.seattlemind.com"&gt;Mind Camp&lt;/a&gt; next weekend. It looks like I&amp;#8217;m going to have to make alternate plans.&lt;/p&gt;</summary>
153
- <content type="html">&lt;p&gt;This was one of those weekends where I practically lived with a camera in my hand; I took around 500 halloween pictures yesterday and then moved on to Christmas-card pictures of the kids today. Everything was going well enough until late in the day, when I was trying to get a nice black and white shot of my son. In the middle of shooting I took a quick peek at my camera&amp;#8217;s LCD display and noticed that the last shot had been &lt;em&gt;completely&lt;/em&gt; underexposed. So I scrolled back a few shots and discovered that I&amp;#8217;d been shooting nothing but black frames for about 30 seconds. One second it worked, the next it didn&amp;#8217;t. All of the camera settings were the same&amp;#8211;same aperture, ISO, and shutter speed. Same light. But no picture.&lt;/p&gt;
154
-
155
- &lt;p&gt;I double-checked things, but I was still getting nothing but black. With a sinking feeling, I popped the lens off and took a multi-second exposure while staring into the camera. I could see the mirror flip up, but instead of seeing the sensor, I was left staring at a closed shutter, which strongly suggests that my shutter has died. The shutter on my D60 is rated for 30,000 exposures, and I think I&amp;#8217;m around 25,000 right now, so it&amp;#8217;s a bit earlier then normal, but not utterly unexpected.&lt;/p&gt;
156
-
157
- &lt;p&gt;So, I guess I&amp;#8217;ll be packing it up and shipping it off to Canon for service this week. I&amp;#8217;m not sure how long it&amp;#8217;ll take to get back, but I was hoping to use it at &lt;a href="http://www.seattlemind.com"&gt;Mind Camp&lt;/a&gt; next weekend. It looks like I&amp;#8217;m going to have to make alternate plans.&lt;/p&gt;</content>
158
- </entry>
159
- <entry>
160
- <author>
161
- <name>Scott Laird</name>
162
- </author>
163
- <id>urn:uuid:04325d3613126b2bf3caf091381d8a02</id>
164
- <published>2005-10-27T07:01:05-07:00</published>
165
- <updated>2006-06-21T20:26:42-07:00</updated>
166
- <title type="html">Flickr adds printing</title>
167
- <link href="http://localhost/articles/2005/10/27/flickr-adds-printing" rel="alternate" type="text/html"/>
168
- <category term="flickr" scheme="http://localhost/articles/tag/flickr"/>
169
- <category term="photography" scheme="http://localhost/articles/tag/photography"/>
170
- <category term="printing" scheme="http://localhost/articles/tag/printing"/>
171
- <category term="aperture" scheme="http://localhost/articles/tag/aperture"/>
172
- <summary type="html">&lt;p&gt;&lt;a href="http://flickr.com"&gt;Flickr&lt;/a&gt; has finally added &lt;a href="http://blog.flickr.com/flickrblog/2005/10/your_photos_on_.html"&gt;photo printing&lt;/a&gt;. As of today, US Flickr members can get 4x6 prints for $0.15. They also sell other sizes (5x7, 8x10, wallet, 5x5, [458]xD, and 20x30), but the other prices aren&amp;#8217;t quite as enticing.&lt;/p&gt;
173
-
174
- &lt;p&gt;By default, you&amp;#8217;re the only one allowed to print your pictures; it&amp;#8217;s a safe default for Flickr, but I don&amp;#8217;t really care &lt;em&gt;who&lt;/em&gt; prints my pictures any more then I care who looks at them. If I wanted them to be private, I wouldn&amp;#8217;t have put them on Flickr. You can change the setting via your flickr preference page; I changed mine so any Flickr member can order prints.&lt;/p&gt;
175
-
176
- &lt;p&gt;Er, well, &lt;em&gt;some&lt;/em&gt; Flickr members can order prints. For now, the printing service is US-only. Considering that Flickr was a Canadian company (until Yahoo snapped them up), I find the US-centric printing kind of funny. They claim that they&amp;#8217;re working on adding more countries.&lt;/p&gt;
177
-
178
- &lt;p&gt;I&amp;#8217;ll probably order a few prints to test it out, but I doubt I&amp;#8217;ll use Flickr&amp;#8217;s printing service much, for the same reason that I&amp;#8217;ve never been willing to use &lt;em&gt;any&lt;/em&gt; of the online photo-printing places: they don&amp;#8217;t do color management, so there&amp;#8217;s no guarantee that your prints will look anything like the images on your screen. Instead, I use the profiles from &lt;a href="http://drycreekphoto.com/"&gt;Dry Creek Photo&lt;/a&gt;, burn a CD, and take it to my local Costco. I&amp;#8217;ve had very good luck this way&amp;#8211;I&amp;#8217;ve churned out batches of 300 images without &lt;em&gt;any&lt;/em&gt; problems or rejects before. The only problem is that I need to burn a CD and then make a couple trips to Costco; one to drop off the CD and another to pick up the prints. Most of the time, I&amp;#8217;d rather just click &amp;#8220;print&amp;#8221; and wait a few days for a package to show up in the mail. There are a number of professional photo finishers that will accept color-managed images via FTP, but none of them are even close to being price-competitive with Flickr or Costco, and for big batches of 4x6 or 5x7 prints, price matters.&lt;/p&gt;
179
-
180
- &lt;p&gt;Which brings me back around to Apple&amp;#8217;s &lt;a href="http://www.apple.com/aperture/"&gt;Aperture&lt;/a&gt; again. One of the minor features that they&amp;#8217;re touting is color-managed printing from within Aperture. I&amp;#8217;d &lt;em&gt;love&lt;/em&gt; that. Unfortunately, I&amp;#8217;m not about to run out and buy a PowerMac and Aperture just to make photo printing easier, but it&amp;#8217;s definitely a step in the right direction.&lt;/p&gt;
181
-
182
- &lt;p&gt;On the other hand, while Flickr&amp;#8217;s non-color-managed prints may not be quite what &lt;em&gt;I&amp;#8217;m&lt;/em&gt; looking for, they&amp;#8217;ll almost certainly save me a lot of hassle&amp;#8211;I get a lot of requests for prints from friends and family, and I hate doing one-off prints for people. Now I can just point them to Flickr and let them do it themselves.&lt;/p&gt;</summary>
183
- <content type="html">&lt;p&gt;&lt;a href="http://flickr.com"&gt;Flickr&lt;/a&gt; has finally added &lt;a href="http://blog.flickr.com/flickrblog/2005/10/your_photos_on_.html"&gt;photo printing&lt;/a&gt;. As of today, US Flickr members can get 4x6 prints for $0.15. They also sell other sizes (5x7, 8x10, wallet, 5x5, [458]xD, and 20x30), but the other prices aren&amp;#8217;t quite as enticing.&lt;/p&gt;
184
-
185
- &lt;p&gt;By default, you&amp;#8217;re the only one allowed to print your pictures; it&amp;#8217;s a safe default for Flickr, but I don&amp;#8217;t really care &lt;em&gt;who&lt;/em&gt; prints my pictures any more then I care who looks at them. If I wanted them to be private, I wouldn&amp;#8217;t have put them on Flickr. You can change the setting via your flickr preference page; I changed mine so any Flickr member can order prints.&lt;/p&gt;
186
-
187
- &lt;p&gt;Er, well, &lt;em&gt;some&lt;/em&gt; Flickr members can order prints. For now, the printing service is US-only. Considering that Flickr was a Canadian company (until Yahoo snapped them up), I find the US-centric printing kind of funny. They claim that they&amp;#8217;re working on adding more countries.&lt;/p&gt;
188
-
189
- &lt;p&gt;I&amp;#8217;ll probably order a few prints to test it out, but I doubt I&amp;#8217;ll use Flickr&amp;#8217;s printing service much, for the same reason that I&amp;#8217;ve never been willing to use &lt;em&gt;any&lt;/em&gt; of the online photo-printing places: they don&amp;#8217;t do color management, so there&amp;#8217;s no guarantee that your prints will look anything like the images on your screen. Instead, I use the profiles from &lt;a href="http://drycreekphoto.com/"&gt;Dry Creek Photo&lt;/a&gt;, burn a CD, and take it to my local Costco. I&amp;#8217;ve had very good luck this way&amp;#8211;I&amp;#8217;ve churned out batches of 300 images without &lt;em&gt;any&lt;/em&gt; problems or rejects before. The only problem is that I need to burn a CD and then make a couple trips to Costco; one to drop off the CD and another to pick up the prints. Most of the time, I&amp;#8217;d rather just click &amp;#8220;print&amp;#8221; and wait a few days for a package to show up in the mail. There are a number of professional photo finishers that will accept color-managed images via FTP, but none of them are even close to being price-competitive with Flickr or Costco, and for big batches of 4x6 or 5x7 prints, price matters.&lt;/p&gt;
190
-
191
- &lt;p&gt;Which brings me back around to Apple&amp;#8217;s &lt;a href="http://www.apple.com/aperture/"&gt;Aperture&lt;/a&gt; again. One of the minor features that they&amp;#8217;re touting is color-managed printing from within Aperture. I&amp;#8217;d &lt;em&gt;love&lt;/em&gt; that. Unfortunately, I&amp;#8217;m not about to run out and buy a PowerMac and Aperture just to make photo printing easier, but it&amp;#8217;s definitely a step in the right direction.&lt;/p&gt;
192
-
193
- &lt;p&gt;On the other hand, while Flickr&amp;#8217;s non-color-managed prints may not be quite what &lt;em&gt;I&amp;#8217;m&lt;/em&gt; looking for, they&amp;#8217;ll almost certainly save me a lot of hassle&amp;#8211;I get a lot of requests for prints from friends and family, and I hate doing one-off prints for people. Now I can just point them to Flickr and let them do it themselves.&lt;/p&gt;</content>
194
- </entry>
195
- <entry>
196
- <author>
197
- <name>Scott Laird</name>
198
- </author>
199
- <id>urn:uuid:09ba8d40bebbf7ef9432bd07072e99b4</id>
200
- <published>2005-10-24T12:30:55-07:00</published>
201
- <updated>2006-06-21T20:24:37-07:00</updated>
202
- <title type="html">The Great Typo Memory Leak</title>
203
- <link href="http://localhost/articles/2005/10/24/the-great-typo-memory-leak" rel="alternate" type="text/html"/>
204
- <category term="Typo" scheme="http://localhost/articles/category/Typo" label="Typo"/>
205
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
206
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
207
- <category term="typo" scheme="http://localhost/articles/tag/typo"/>
208
- <category term="memoryleak" scheme="http://localhost/articles/tag/memoryleak"/>
209
- <summary type="html">&lt;p&gt;A number of users &lt;a href="http://rubyforge.org/pipermail/typo-list/2005-October/000893.html"&gt;complained&lt;/a&gt; this weekend that &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; was using &lt;em&gt;way&lt;/em&gt; too much memory, with reports of 100+ MB per FastCGI dispatcher. Typo usually uses around 20 MB, and even that&amp;#8217;s too much; 100 MB is enough to cause big problems with hosting providers like &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt;.&lt;/p&gt;
210
-
211
- &lt;p&gt;The first step that I took was to verify that the problem actually exists outside of TextDrive. I set up a test Apache/FastCGI/Typo server, disabled caching, and then pounded on it using &lt;code&gt;curl&lt;/code&gt;:&lt;/p&gt;
212
-
213
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;# while true; do curl http://typo1/ &amp;gt; /dev/null; done&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
214
-
215
- &lt;p&gt;I let that run for a few seconds and watched while my &lt;code&gt;dispatch.fcgi&lt;/code&gt; processes grew from 22 MB to 80 MB. I then did a bit of experimenting:&lt;/p&gt;
216
-
217
- &lt;ul&gt;
218
- &lt;li&gt;The main index page leaked&lt;/li&gt;
219
- &lt;li&gt;RSS feeds &lt;strong&gt;didn&amp;#8217;t&lt;/strong&gt; leak&lt;/li&gt;
220
- &lt;li&gt;Individual article pages leak&lt;/li&gt;
221
- &lt;li&gt;Static pages, like &lt;code&gt;/pages/about&lt;/code&gt; leak&lt;/li&gt;
222
- &lt;li&gt;Error pages even leak&lt;/li&gt;
223
- &lt;/ul&gt;
224
-
225
- &lt;p&gt;Disabling the layout for a leaking page and then re-testing it showed that the leak followed the layout. Turning layouts back on and removing the sidebar block fixed the leak.&lt;/p&gt;
226
-
227
- &lt;p&gt;Entertainingly enough, disabling the sidebar from &lt;em&gt;inside&lt;/em&gt; of the sidebar infrastructure didn&amp;#8217;t fix the leak. The mere act of calling &lt;code&gt;render_component&lt;/code&gt; to generate the sidebars seemed to be causing the memory leak. Since Typo is one of the very few users of Rails components, this suggests that &lt;code&gt;render_component&lt;/code&gt; may have a leak that no one else has noticed, so I created a new test Rails app with only two files. First, &lt;code&gt;app/controllers/foo_controller.rb&lt;/code&gt;:&lt;/p&gt;
228
-
229
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;FooController&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt; &lt;span class="constant"&gt;ApplicationController&lt;/span&gt;
230
- &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;bar&lt;/span&gt;
231
- &lt;span class="ident"&gt;render_component&lt;/span&gt; &lt;span class="symbol"&gt;:layout&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;false&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;
232
- &lt;span class="symbol"&gt;:controller&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;sidebars/sidebar&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:action&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;index&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
233
- &lt;span class="keyword"&gt;end&lt;/span&gt;
234
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
235
-
236
- &lt;p&gt;Then &lt;code&gt;components/sidebars/sidebar_controller.rb&lt;/code&gt;:&lt;/p&gt;
237
-
238
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;module &lt;/span&gt;&lt;span class="module"&gt;Sidebars&lt;/span&gt;
239
- &lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;SidebarController&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt; &lt;span class="constant"&gt;ApplicationController&lt;/span&gt;
240
- &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;index&lt;/span&gt;
241
- &lt;span class="ident"&gt;render&lt;/span&gt; &lt;span class="symbol"&gt;:text&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;test&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:layout&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;false&lt;/span&gt;
242
- &lt;span class="keyword"&gt;end&lt;/span&gt;
243
- &lt;span class="keyword"&gt;end&lt;/span&gt;
244
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
245
-
246
- &lt;p&gt;This is about as minimal as a Rails app can get. Then I set up a FastCGI server running this project, and ran &lt;code&gt;curl&lt;/code&gt; against &lt;code&gt;/foo/bar&lt;/code&gt;, and watched the process size climb. So the leak is part of Rails, not really part of Typo.&lt;/p&gt;
247
-
248
- &lt;p&gt;Unfortunately, I&amp;#8217;m not sure where the leak is coming from. I read &lt;code&gt;component.rb&lt;/code&gt; and made a few small changes, but the leak hasn&amp;#8217;t stopped. So I&amp;#8217;m going to file this as a Rails bug and see if we can get it fixed before 1.0.&lt;/p&gt;
249
-
250
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Rails bug &lt;a href="http://dev.rubyonrails.com/ticket/2589"&gt;2589&lt;/a&gt;.&lt;/p&gt;
251
-
252
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Thanks to &lt;a href="http://scott.elitists.net/"&gt;Scott Barron&lt;/a&gt;, the bug has been &lt;a href="http://dev.rubyonrails.com/changeset/2722"&gt;fixed&lt;/a&gt;. Users with memory problems should probably install the patch, although a bit of testing would obviously be recommended first. The next release of Rails (either 1.0rc3 or 1.0; I&amp;#8217;m not sure what they&amp;#8217;re planning) should include this fix.&lt;/p&gt;</summary>
253
- <content type="html">&lt;p&gt;A number of users &lt;a href="http://rubyforge.org/pipermail/typo-list/2005-October/000893.html"&gt;complained&lt;/a&gt; this weekend that &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; was using &lt;em&gt;way&lt;/em&gt; too much memory, with reports of 100+ MB per FastCGI dispatcher. Typo usually uses around 20 MB, and even that&amp;#8217;s too much; 100 MB is enough to cause big problems with hosting providers like &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt;.&lt;/p&gt;
254
-
255
- &lt;p&gt;The first step that I took was to verify that the problem actually exists outside of TextDrive. I set up a test Apache/FastCGI/Typo server, disabled caching, and then pounded on it using &lt;code&gt;curl&lt;/code&gt;:&lt;/p&gt;
256
-
257
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;# while true; do curl http://typo1/ &amp;gt; /dev/null; done&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
258
-
259
- &lt;p&gt;I let that run for a few seconds and watched while my &lt;code&gt;dispatch.fcgi&lt;/code&gt; processes grew from 22 MB to 80 MB. I then did a bit of experimenting:&lt;/p&gt;
260
-
261
- &lt;ul&gt;
262
- &lt;li&gt;The main index page leaked&lt;/li&gt;
263
- &lt;li&gt;RSS feeds &lt;strong&gt;didn&amp;#8217;t&lt;/strong&gt; leak&lt;/li&gt;
264
- &lt;li&gt;Individual article pages leak&lt;/li&gt;
265
- &lt;li&gt;Static pages, like &lt;code&gt;/pages/about&lt;/code&gt; leak&lt;/li&gt;
266
- &lt;li&gt;Error pages even leak&lt;/li&gt;
267
- &lt;/ul&gt;
268
-
269
- &lt;p&gt;Disabling the layout for a leaking page and then re-testing it showed that the leak followed the layout. Turning layouts back on and removing the sidebar block fixed the leak.&lt;/p&gt;
270
-
271
- &lt;p&gt;Entertainingly enough, disabling the sidebar from &lt;em&gt;inside&lt;/em&gt; of the sidebar infrastructure didn&amp;#8217;t fix the leak. The mere act of calling &lt;code&gt;render_component&lt;/code&gt; to generate the sidebars seemed to be causing the memory leak. Since Typo is one of the very few users of Rails components, this suggests that &lt;code&gt;render_component&lt;/code&gt; may have a leak that no one else has noticed, so I created a new test Rails app with only two files. First, &lt;code&gt;app/controllers/foo_controller.rb&lt;/code&gt;:&lt;/p&gt;
272
-
273
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;FooController&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt; &lt;span class="constant"&gt;ApplicationController&lt;/span&gt;
274
- &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;bar&lt;/span&gt;
275
- &lt;span class="ident"&gt;render_component&lt;/span&gt; &lt;span class="symbol"&gt;:layout&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;false&lt;/span&gt;&lt;span class="punct"&gt;,&lt;/span&gt;
276
- &lt;span class="symbol"&gt;:controller&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;sidebars/sidebar&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:action&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;index&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
277
- &lt;span class="keyword"&gt;end&lt;/span&gt;
278
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
279
-
280
- &lt;p&gt;Then &lt;code&gt;components/sidebars/sidebar_controller.rb&lt;/code&gt;:&lt;/p&gt;
281
-
282
- &lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="keyword"&gt;module &lt;/span&gt;&lt;span class="module"&gt;Sidebars&lt;/span&gt;
283
- &lt;span class="keyword"&gt;class &lt;/span&gt;&lt;span class="class"&gt;SidebarController&lt;/span&gt; &lt;span class="punct"&gt;&amp;lt;&lt;/span&gt; &lt;span class="constant"&gt;ApplicationController&lt;/span&gt;
284
- &lt;span class="keyword"&gt;def &lt;/span&gt;&lt;span class="method"&gt;index&lt;/span&gt;
285
- &lt;span class="ident"&gt;render&lt;/span&gt; &lt;span class="symbol"&gt;:text&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;test&lt;/span&gt;&lt;span class="punct"&gt;',&lt;/span&gt; &lt;span class="symbol"&gt;:layout&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;false&lt;/span&gt;
286
- &lt;span class="keyword"&gt;end&lt;/span&gt;
287
- &lt;span class="keyword"&gt;end&lt;/span&gt;
288
- &lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
289
-
290
- &lt;p&gt;This is about as minimal as a Rails app can get. Then I set up a FastCGI server running this project, and ran &lt;code&gt;curl&lt;/code&gt; against &lt;code&gt;/foo/bar&lt;/code&gt;, and watched the process size climb. So the leak is part of Rails, not really part of Typo.&lt;/p&gt;
291
-
292
- &lt;p&gt;Unfortunately, I&amp;#8217;m not sure where the leak is coming from. I read &lt;code&gt;component.rb&lt;/code&gt; and made a few small changes, but the leak hasn&amp;#8217;t stopped. So I&amp;#8217;m going to file this as a Rails bug and see if we can get it fixed before 1.0.&lt;/p&gt;
293
-
294
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Rails bug &lt;a href="http://dev.rubyonrails.com/ticket/2589"&gt;2589&lt;/a&gt;.&lt;/p&gt;
295
-
296
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Thanks to &lt;a href="http://scott.elitists.net/"&gt;Scott Barron&lt;/a&gt;, the bug has been &lt;a href="http://dev.rubyonrails.com/changeset/2722"&gt;fixed&lt;/a&gt;. Users with memory problems should probably install the patch, although a bit of testing would obviously be recommended first. The next release of Rails (either 1.0rc3 or 1.0; I&amp;#8217;m not sure what they&amp;#8217;re planning) should include this fix.&lt;/p&gt;</content>
297
- </entry>
298
- <entry>
299
- <author>
300
- <name>Scott Laird</name>
301
- </author>
302
- <id>urn:uuid:24c9eb9a143f7623a391683f87f84227</id>
303
- <published>2005-10-24T10:25:30-07:00</published>
304
- <updated>2006-06-21T20:26:42-07:00</updated>
305
- <title type="html">Rails Schema Generator 0.2.0</title>
306
- <link href="http://localhost/articles/2005/10/24/rails-schema-generator-0-2-0" rel="alternate" type="text/html"/>
307
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
308
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
309
- <category term="database" scheme="http://localhost/articles/tag/database"/>
310
- <category term="generator" scheme="http://localhost/articles/tag/generator"/>
311
- <category term="schemagenerator" scheme="http://localhost/articles/tag/schemagenerator"/>
312
- <category term="schema" scheme="http://localhost/articles/tag/schema"/>
313
- <summary type="html">&lt;p&gt;I just uploaded &lt;a href="http://rubyforge.org/projects/schemagenerator/"&gt;version 0.2.0&lt;/a&gt; of my &lt;a href="http://scottstuff.net/blog/articles/2005/09/03/rails-schema-generator-0-1-0"&gt;Rails Schema Generator&lt;/a&gt; to &lt;a href="http://rubyforge.org"&gt;Rubyforge&lt;/a&gt;. This is a minor update, but it was needed to make the schema generator work with &lt;a href="http://rubyonrails.com"&gt;Rails&lt;/a&gt; 1.0rc2 (AKA 0.14.1).&lt;/p&gt;
314
-
315
- &lt;p&gt;The schema generator is sort of the flip side of the new &lt;a href="http://documentation.rubyonrails.com/release_notes/rc2.html"&gt;schema code&lt;/a&gt; in Rails 1.0. It takes a set of Rails migrations, aggregates them all together, and spits out a SQL file that describes the DB that you&amp;#8217;d get if you ran all of the migrations. Or, viewed in a more useful light, it gives you a SQL file that you can use to create a new DB from scratch. The current version actually produces three different schema files, one for PostgreSQL, one for MySQL, and one for SQLite, each with DB-appropriate syntax and types.&lt;/p&gt;
316
-
317
- &lt;p&gt;This is an outgrowth of &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt;; we&amp;#8217;re up to 25 migrations now, and we actively support 3 different DBs. It was getting really painful to maintain 3 distinct schema files in addition to the collection of migrations, so I wrote this schema generator. Now we&amp;#8217;re back to DRY-land&amp;#8211;we create new migrations and let the schema generator do all of the hard work.&lt;/p&gt;</summary>
318
- <content type="html">&lt;p&gt;I just uploaded &lt;a href="http://rubyforge.org/projects/schemagenerator/"&gt;version 0.2.0&lt;/a&gt; of my &lt;a href="http://scottstuff.net/blog/articles/2005/09/03/rails-schema-generator-0-1-0"&gt;Rails Schema Generator&lt;/a&gt; to &lt;a href="http://rubyforge.org"&gt;Rubyforge&lt;/a&gt;. This is a minor update, but it was needed to make the schema generator work with &lt;a href="http://rubyonrails.com"&gt;Rails&lt;/a&gt; 1.0rc2 (AKA 0.14.1).&lt;/p&gt;
319
-
320
- &lt;p&gt;The schema generator is sort of the flip side of the new &lt;a href="http://documentation.rubyonrails.com/release_notes/rc2.html"&gt;schema code&lt;/a&gt; in Rails 1.0. It takes a set of Rails migrations, aggregates them all together, and spits out a SQL file that describes the DB that you&amp;#8217;d get if you ran all of the migrations. Or, viewed in a more useful light, it gives you a SQL file that you can use to create a new DB from scratch. The current version actually produces three different schema files, one for PostgreSQL, one for MySQL, and one for SQLite, each with DB-appropriate syntax and types.&lt;/p&gt;
321
-
322
- &lt;p&gt;This is an outgrowth of &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt;; we&amp;#8217;re up to 25 migrations now, and we actively support 3 different DBs. It was getting really painful to maintain 3 distinct schema files in addition to the collection of migrations, so I wrote this schema generator. Now we&amp;#8217;re back to DRY-land&amp;#8211;we create new migrations and let the schema generator do all of the hard work.&lt;/p&gt;</content>
323
- </entry>
324
- <entry>
325
- <author>
326
- <name>Scott Laird</name>
327
- </author>
328
- <id>urn:uuid:6220ad722c027fc3d7cd6be279a2d1b0</id>
329
- <published>2005-10-24T05:25:55-07:00</published>
330
- <updated>2006-06-21T20:26:42-07:00</updated>
331
- <title type="html">Tom Douglas's Iron Chef Party</title>
332
- <link href="http://localhost/articles/2005/10/24/tom-douglass-iron-chef-party" rel="alternate" type="text/html"/>
333
- <category term="seattle" scheme="http://localhost/articles/tag/seattle"/>
334
- <category term="tomdouglas" scheme="http://localhost/articles/tag/tomdouglas"/>
335
- <category term="ironchef" scheme="http://localhost/articles/tag/ironchef"/>
336
- <category term="salmon" scheme="http://localhost/articles/tag/salmon"/>
337
- <summary type="html">&lt;p&gt;It looks like the long-fabled &lt;a href="http://www.foodnetwork.com/food/show_ia"&gt;Iron Chef America&lt;/a&gt; episode featuring &lt;a href="http://tomdouglas.com/"&gt;Tom Douglas&lt;/a&gt; is finally going to air.&lt;/p&gt;
338
-
339
- &lt;p&gt;And he&amp;#8217;s throwing a party. From the &lt;a href="http://seattlepi.nwsource.com/food/245517_tf224.html"&gt;Seattle P-I&lt;/a&gt;:&lt;/p&gt;
340
-
341
- &lt;blockquote&gt;
342
- &lt;p&gt;The &amp;#8220;Battle Salmon&amp;#8221; pitting Masaharu Morimoto against our own Tom Douglas will air on Nov. 6, and Douglas is hosting a dinner-and-viewing that night, starting at 6:30 p.m. at the Palace Ballroom, 2100 Fifth Ave.&lt;/p&gt;
343
-
344
- &lt;p&gt;Douglas promises slightly kitschy festivities featuring the same five-course meal he and colleagues Mark Fuller and Eric Tanaka presented in the Food Network show, plus a Japanese hachimaki headband, two cocktails, and a chance to watch the show ($95/person). For reservations call 206-448-2001.&lt;/p&gt;
345
- &lt;/blockquote&gt;
346
-
347
- &lt;p&gt;That&amp;#8217;s a bit steep for me, but I&amp;#8217;d still be tempted if it wasn&amp;#8217;t the same day as &lt;a href="http://seattlemind.com"&gt;Mind Camp&lt;/a&gt;.&lt;/p&gt;</summary>
348
- <content type="html">&lt;p&gt;It looks like the long-fabled &lt;a href="http://www.foodnetwork.com/food/show_ia"&gt;Iron Chef America&lt;/a&gt; episode featuring &lt;a href="http://tomdouglas.com/"&gt;Tom Douglas&lt;/a&gt; is finally going to air.&lt;/p&gt;
349
-
350
- &lt;p&gt;And he&amp;#8217;s throwing a party. From the &lt;a href="http://seattlepi.nwsource.com/food/245517_tf224.html"&gt;Seattle P-I&lt;/a&gt;:&lt;/p&gt;
351
-
352
- &lt;blockquote&gt;
353
- &lt;p&gt;The &amp;#8220;Battle Salmon&amp;#8221; pitting Masaharu Morimoto against our own Tom Douglas will air on Nov. 6, and Douglas is hosting a dinner-and-viewing that night, starting at 6:30 p.m. at the Palace Ballroom, 2100 Fifth Ave.&lt;/p&gt;
354
-
355
- &lt;p&gt;Douglas promises slightly kitschy festivities featuring the same five-course meal he and colleagues Mark Fuller and Eric Tanaka presented in the Food Network show, plus a Japanese hachimaki headband, two cocktails, and a chance to watch the show ($95/person). For reservations call 206-448-2001.&lt;/p&gt;
356
- &lt;/blockquote&gt;
357
-
358
- &lt;p&gt;That&amp;#8217;s a bit steep for me, but I&amp;#8217;d still be tempted if it wasn&amp;#8217;t the same day as &lt;a href="http://seattlemind.com"&gt;Mind Camp&lt;/a&gt;.&lt;/p&gt;</content>
359
- </entry>
360
- <entry>
361
- <author>
362
- <name>Scott Laird</name>
363
- </author>
364
- <id>urn:uuid:b0e3d9dead81eb7253736b84399b77af</id>
365
- <published>2005-10-21T08:42:57-07:00</published>
366
- <updated>2006-06-21T20:24:37-07:00</updated>
367
- <title type="html">Seattle Mind Camp</title>
368
- <link href="http://localhost/articles/2005/10/21/seattle-mind-camp" rel="alternate" type="text/html"/>
369
- <category term="Seattle" scheme="http://localhost/articles/category/Seattle" label="Seattle"/>
370
- <category term="seattle" scheme="http://localhost/articles/tag/seattle"/>
371
- <category term="mindcamp" scheme="http://localhost/articles/tag/mindcamp"/>
372
- <category term="seattlemindcamp" scheme="http://localhost/articles/tag/seattlemindcamp"/>
373
- <category term="hacking" scheme="http://localhost/articles/tag/hacking"/>
374
- <summary type="html">&lt;p&gt;Apparently I need to track more local blogs, because I missed the original announcement of the &lt;a href="http://seattlemind.com"&gt;Seattle MindCamp&lt;/a&gt;. Fortunately, &lt;a href="http://www.sauria.com/blog"&gt;Ted Leung&lt;/a&gt; pointed it out to me, or I probably would have missed it entirely. This should be interesting&amp;#8211;it&amp;#8217;s essentially a local version of &lt;a href="http://wiki.oreillynet.com/foocamp05/index.cgi"&gt;Foo Camp&lt;/a&gt; (or &lt;a href="http://barcamp.org/"&gt;Bar Camp&lt;/a&gt;), held in an office building over a 26-hour span during the first weekend in November.&lt;/p&gt;
375
-
376
- &lt;p&gt;From the MindCamp website:&lt;/p&gt;
377
-
378
- &lt;blockquote&gt;
379
- &lt;p&gt;Seattle Mind Camp is a self-organizing, digitally minded, entrepreneur-driven, overnight Seattle confab. What happens when you put 150 of Seattle’s smartest geeks in an empty office building for 24 hours? We’re not sure either, but we’d like to find out. It’s time to meet and connect with those involved in the interesting projects going on in Seattle in a relaxed environment.&lt;/p&gt;
380
-
381
- &lt;p&gt;&lt;em&gt;What&lt;/em&gt;: A weekend, 24-hour, multi-track event. Think huge space with breakout rooms, broadband Wi-Fi, projectors, white boards - and you.&lt;/p&gt;
382
-
383
- &lt;p&gt;&lt;em&gt;Who&lt;/em&gt;: 150 of Seattle’s forward thinkers: techies, entrepreneurs, executives, gamers, musicians, and anyone else with a great idea.&lt;/p&gt;
384
-
385
- &lt;p&gt;&lt;em&gt;When&lt;/em&gt;: Mind Camp will take place on November 5-6&lt;/p&gt;
386
-
387
- &lt;p&gt;&lt;em&gt;Why?&lt;/em&gt;: You know all those hallway conversations that never get to flourish during a “normal” conference? Now they will.&lt;/p&gt;
388
-
389
- &lt;p&gt;Seattle Mind Camp is completely free of charge, and registration will begin very soon. In the meantime, check out the &lt;a href="http://www.seattlemind.com/index.php/mindcamp/about/"&gt;About page&lt;/a&gt; for a little more information.&lt;/p&gt;
390
- &lt;/blockquote&gt;
391
-
392
- &lt;p&gt;It looks like there are still a few spots left, but I doubt they&amp;#8217;ll last very long.&lt;/p&gt;
393
-
394
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: In the spirit of information spreading, I should probably mention &lt;a href="http://pacwest.ms/codecamp/sea/1/"&gt;Seattle Code Camp&lt;/a&gt;, which is happening this weekend. From looking at the code camp website, it looks a bit more organized, with pre-scheduled talks, and there seems to be a big Microsoft/C#/.NET focus on a lot of the events. There are a couple Perl/Linux sessions and an introduction to Ruby, as well as a pair of Cocoa/Objective C talks, but most of the content seems to be &amp;#8220;cool new stuff in C#.&amp;#8221; Which is fine, but it&amp;#8217;s not really my sort of conference. MindCamp, on the other hand, seems to be drawing a more diverse crowd, with a number of open source people on the roster.&lt;/p&gt;</summary>
395
- <content type="html">&lt;p&gt;Apparently I need to track more local blogs, because I missed the original announcement of the &lt;a href="http://seattlemind.com"&gt;Seattle MindCamp&lt;/a&gt;. Fortunately, &lt;a href="http://www.sauria.com/blog"&gt;Ted Leung&lt;/a&gt; pointed it out to me, or I probably would have missed it entirely. This should be interesting&amp;#8211;it&amp;#8217;s essentially a local version of &lt;a href="http://wiki.oreillynet.com/foocamp05/index.cgi"&gt;Foo Camp&lt;/a&gt; (or &lt;a href="http://barcamp.org/"&gt;Bar Camp&lt;/a&gt;), held in an office building over a 26-hour span during the first weekend in November.&lt;/p&gt;
396
-
397
- &lt;p&gt;From the MindCamp website:&lt;/p&gt;
398
-
399
- &lt;blockquote&gt;
400
- &lt;p&gt;Seattle Mind Camp is a self-organizing, digitally minded, entrepreneur-driven, overnight Seattle confab. What happens when you put 150 of Seattle’s smartest geeks in an empty office building for 24 hours? We’re not sure either, but we’d like to find out. It’s time to meet and connect with those involved in the interesting projects going on in Seattle in a relaxed environment.&lt;/p&gt;
401
-
402
- &lt;p&gt;&lt;em&gt;What&lt;/em&gt;: A weekend, 24-hour, multi-track event. Think huge space with breakout rooms, broadband Wi-Fi, projectors, white boards - and you.&lt;/p&gt;
403
-
404
- &lt;p&gt;&lt;em&gt;Who&lt;/em&gt;: 150 of Seattle’s forward thinkers: techies, entrepreneurs, executives, gamers, musicians, and anyone else with a great idea.&lt;/p&gt;
405
-
406
- &lt;p&gt;&lt;em&gt;When&lt;/em&gt;: Mind Camp will take place on November 5-6&lt;/p&gt;
407
-
408
- &lt;p&gt;&lt;em&gt;Why?&lt;/em&gt;: You know all those hallway conversations that never get to flourish during a “normal” conference? Now they will.&lt;/p&gt;
409
-
410
- &lt;p&gt;Seattle Mind Camp is completely free of charge, and registration will begin very soon. In the meantime, check out the &lt;a href="http://www.seattlemind.com/index.php/mindcamp/about/"&gt;About page&lt;/a&gt; for a little more information.&lt;/p&gt;
411
- &lt;/blockquote&gt;
412
-
413
- &lt;p&gt;It looks like there are still a few spots left, but I doubt they&amp;#8217;ll last very long.&lt;/p&gt;
414
-
415
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: In the spirit of information spreading, I should probably mention &lt;a href="http://pacwest.ms/codecamp/sea/1/"&gt;Seattle Code Camp&lt;/a&gt;, which is happening this weekend. From looking at the code camp website, it looks a bit more organized, with pre-scheduled talks, and there seems to be a big Microsoft/C#/.NET focus on a lot of the events. There are a couple Perl/Linux sessions and an introduction to Ruby, as well as a pair of Cocoa/Objective C talks, but most of the content seems to be &amp;#8220;cool new stuff in C#.&amp;#8221; Which is fine, but it&amp;#8217;s not really my sort of conference. MindCamp, on the other hand, seems to be drawing a more diverse crowd, with a number of open source people on the roster.&lt;/p&gt;</content>
416
- </entry>
417
- <entry>
418
- <author>
419
- <name>Scott Laird</name>
420
- </author>
421
- <id>urn:uuid:a2dae45baa0cdf1803c652ccc26b542e</id>
422
- <published>2005-10-20T16:30:21-07:00</published>
423
- <updated>2006-06-21T20:24:49-07:00</updated>
424
- <title type="html">The Rails Book is number one on Amazon</title>
425
- <link href="http://localhost/articles/2005/10/20/the-rails-book-is-number-one-on-amazon" rel="alternate" type="text/html"/>
426
- <category term="Ruby" scheme="http://localhost/articles/category/Ruby" label="Ruby"/>
427
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
428
- <summary type="html">&lt;p&gt;&lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi"&gt;Dave Thomas&lt;/a&gt; has a nice little &lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/TopTen.htm"&gt;announcement&lt;/a&gt;, complete with screenshot: &lt;a href="http://www.amazon.com/exec/obidos/ASIN/097669400X/scottstuff-20"&gt;Agile Web Development with Rails&lt;/a&gt; is the best-selling programming book on Amazon.com. Even better, &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0974514055/scottstuff-20"&gt;Programming Ruby&lt;/a&gt; has the number two spot. Corgratulations.&lt;/p&gt;</summary>
429
- <content type="html">&lt;p&gt;&lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi"&gt;Dave Thomas&lt;/a&gt; has a nice little &lt;a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi/Tech/Ruby/TopTen.htm"&gt;announcement&lt;/a&gt;, complete with screenshot: &lt;a href="http://www.amazon.com/exec/obidos/ASIN/097669400X/scottstuff-20"&gt;Agile Web Development with Rails&lt;/a&gt; is the best-selling programming book on Amazon.com. Even better, &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0974514055/scottstuff-20"&gt;Programming Ruby&lt;/a&gt; has the number two spot. Corgratulations.&lt;/p&gt;</content>
430
- </entry>
431
- <entry>
432
- <author>
433
- <name>Scott Laird</name>
434
- </author>
435
- <id>urn:uuid:8bec4878b92f89922cfac083d41a1fff</id>
436
- <published>2005-10-19T18:37:53-07:00</published>
437
- <updated>2006-06-21T20:26:42-07:00</updated>
438
- <title type="html">Typo 2.5.6 and Rails 1.0</title>
439
- <link href="http://localhost/articles/2005/10/19/typo-2-5-6-and-rails-1-0" rel="alternate" type="text/html"/>
440
- <category term="Typo" scheme="http://localhost/articles/category/Typo" label="Typo"/>
441
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
442
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
443
- <category term="typo" scheme="http://localhost/articles/tag/typo"/>
444
- <summary type="html">&lt;p&gt;As far as I can see, &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; 2.5.6 (the most recently released stable version) should work fine with &lt;a href="http://www.rubyonrails.com"&gt;Rails&lt;/a&gt; 1.0. I just did a brief round of testing with 1.0rc2, and all of the tests pass. Er, except for one test that had a stupid typo that somehow still worked with Rails 0.13.1; the bug is in the test itself, though, so it&amp;#8217;s not worth releasing Typo 2.5.7 just for that. If we ever release Typo 2.5.7, then I&amp;#8217;ll make sure that the fixed test is included.&lt;/p&gt;
445
-
446
- &lt;p&gt;Also, Typo 2.5.6 should work just fine with Ruby 1.8.3, too, as long as you&amp;#8217;re using Rails 1.0. I haven&amp;#8217;t actually tested this yet, but I&amp;#8217;d be surprised if it doesn&amp;#8217;t work perfectly.&lt;/p&gt;
447
-
448
- &lt;p&gt;Surprisingly enough, the current Typo trunk (r683 or so) &lt;em&gt;doesn&amp;#8217;t&lt;/em&gt; work with Rails 1.0. All of the filtering code is broken; I&amp;#8217;ll fix it shortly and check in the fix. Fortunately, the current Typo trunk is pinned to Rails 0.13.1 for now, so it should be safe to upgrade the version of Rails on the box; Typo will just ignore the new Rails for now.&lt;/p&gt;
449
-
450
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: the Typo trunk r685 or later should be compatible with Rails 1.0rc2. I&amp;#8217;ll probably break Rails 0.13.1 compatibility soon, so it&amp;#8217;s time to upgrade.&lt;/p&gt;</summary>
451
- <content type="html">&lt;p&gt;As far as I can see, &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; 2.5.6 (the most recently released stable version) should work fine with &lt;a href="http://www.rubyonrails.com"&gt;Rails&lt;/a&gt; 1.0. I just did a brief round of testing with 1.0rc2, and all of the tests pass. Er, except for one test that had a stupid typo that somehow still worked with Rails 0.13.1; the bug is in the test itself, though, so it&amp;#8217;s not worth releasing Typo 2.5.7 just for that. If we ever release Typo 2.5.7, then I&amp;#8217;ll make sure that the fixed test is included.&lt;/p&gt;
452
-
453
- &lt;p&gt;Also, Typo 2.5.6 should work just fine with Ruby 1.8.3, too, as long as you&amp;#8217;re using Rails 1.0. I haven&amp;#8217;t actually tested this yet, but I&amp;#8217;d be surprised if it doesn&amp;#8217;t work perfectly.&lt;/p&gt;
454
-
455
- &lt;p&gt;Surprisingly enough, the current Typo trunk (r683 or so) &lt;em&gt;doesn&amp;#8217;t&lt;/em&gt; work with Rails 1.0. All of the filtering code is broken; I&amp;#8217;ll fix it shortly and check in the fix. Fortunately, the current Typo trunk is pinned to Rails 0.13.1 for now, so it should be safe to upgrade the version of Rails on the box; Typo will just ignore the new Rails for now.&lt;/p&gt;
456
-
457
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: the Typo trunk r685 or later should be compatible with Rails 1.0rc2. I&amp;#8217;ll probably break Rails 0.13.1 compatibility soon, so it&amp;#8217;s time to upgrade.&lt;/p&gt;</content>
458
- </entry>
459
- <entry>
460
- <author>
461
- <name>Scott Laird</name>
462
- </author>
463
- <id>urn:uuid:f8c9c82a26d38dd93a9b9d7dab783e4b</id>
464
- <published>2005-10-19T07:51:48-07:00</published>
465
- <updated>2006-06-21T20:26:42-07:00</updated>
466
- <title type="html">Typo and Ruby 1.8.3</title>
467
- <link href="http://localhost/articles/2005/10/19/typo-and-ruby-1-8-3" rel="alternate" type="text/html"/>
468
- <category term="Typo" scheme="http://localhost/articles/category/Typo" label="Typo"/>
469
- <category term="ruby" scheme="http://localhost/articles/tag/ruby"/>
470
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
471
- <category term="typo" scheme="http://localhost/articles/tag/typo"/>
472
- <summary type="html">&lt;p&gt;Just for the record, current versions of &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; (either 2.5.6 or the current Subversion trunk) don&amp;#8217;t work with Ruby 1.8.3. There are two problems&amp;#8211;the &lt;code&gt;Logger&lt;/code&gt; bug that keeps Rails 0.13.1 from working with Ruby 1.8.3 (this is easy to fix), and a second bug that I haven&amp;#8217;t read about anywhere else&amp;#8211;apparently YAML serialization is broken with Ruby 1.8.3 and Rails 0.13.1. This keeps Typo&amp;#8217;s sidebar from working properly.&lt;/p&gt;
473
-
474
- &lt;p&gt;I&amp;#8217;m going to see what it&amp;#8217;ll take to get the Typo trunk working with Rails 1.0 (rc1 or rc2, if it&amp;#8217;s out today), and then see if it works properly with Ruby 1.8.3. Once that&amp;#8217;s done, the trunk will probably shift from 0.13.1-only to 1.0-only.&lt;/p&gt;
475
-
476
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: That was quick. ChrisNolan on IRC pointed out that Rails bug &lt;a href="http://dev.rubyonrails.com/ticket/2304"&gt;#2304&lt;/a&gt; contains a patch to fix this. The patch is already a part of the current Rails trunk, but you&amp;#8217;ll need to patch 0.13.1 manually if you want to use it with Ruby 1.8.3.&lt;/p&gt;</summary>
477
- <content type="html">&lt;p&gt;Just for the record, current versions of &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; (either 2.5.6 or the current Subversion trunk) don&amp;#8217;t work with Ruby 1.8.3. There are two problems&amp;#8211;the &lt;code&gt;Logger&lt;/code&gt; bug that keeps Rails 0.13.1 from working with Ruby 1.8.3 (this is easy to fix), and a second bug that I haven&amp;#8217;t read about anywhere else&amp;#8211;apparently YAML serialization is broken with Ruby 1.8.3 and Rails 0.13.1. This keeps Typo&amp;#8217;s sidebar from working properly.&lt;/p&gt;
478
-
479
- &lt;p&gt;I&amp;#8217;m going to see what it&amp;#8217;ll take to get the Typo trunk working with Rails 1.0 (rc1 or rc2, if it&amp;#8217;s out today), and then see if it works properly with Ruby 1.8.3. Once that&amp;#8217;s done, the trunk will probably shift from 0.13.1-only to 1.0-only.&lt;/p&gt;
480
-
481
- &lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: That was quick. ChrisNolan on IRC pointed out that Rails bug &lt;a href="http://dev.rubyonrails.com/ticket/2304"&gt;#2304&lt;/a&gt; contains a patch to fix this. The patch is already a part of the current Rails trunk, but you&amp;#8217;ll need to patch 0.13.1 manually if you want to use it with Ruby 1.8.3.&lt;/p&gt;</content>
482
- </entry>
483
- <entry>
484
- <author>
485
- <name>Scott Laird</name>
486
- </author>
487
- <id>urn:uuid:3fa891e3888648d240996df8f7ab06c2</id>
488
- <published>2005-10-17T09:51:13-07:00</published>
489
- <updated>2006-06-21T20:26:42-07:00</updated>
490
- <title type="html">Benchmarking Typo</title>
491
- <link href="http://localhost/articles/2005/10/17/benchmarking-typo" rel="alternate" type="text/html"/>
492
- <category term="Typo" scheme="http://localhost/articles/category/Typo" label="Typo"/>
493
- <category term="rubyonrails" scheme="http://localhost/articles/tag/rubyonrails"/>
494
- <category term="typo" scheme="http://localhost/articles/tag/typo"/>
495
- <category term="apache" scheme="http://localhost/articles/tag/apache"/>
496
- <category term="benchmark" scheme="http://localhost/articles/tag/benchmark"/>
497
- <category term="caching" scheme="http://localhost/articles/tag/caching"/>
498
- <summary type="html">&lt;p&gt;I finally had a bit of time to do some &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; benchmarking over the weekend and (as usual) found that my instincts were all wrong.&lt;/p&gt;
499
-
500
- &lt;p&gt;I was specifically interested in the performance difference between the &lt;a href="http://api.rubyonrails.com/classes/ActionController/Caching/Pages.html"&gt;page cache&lt;/a&gt; and the &lt;a href="http://api.rubyonrails.com/classes/ActionController/Caching/Actions.html"&gt;action cache&lt;/a&gt;&amp;#8211;my guess was that the action cache was a 10x performance hit.&lt;/p&gt;
501
-
502
- &lt;p&gt;So I set up a test environment under Xen, running Typo r683, PostgreSQL, Apache 2, FastCGI, Ruby 1.8.2, and Rails 0.13.1. I didn&amp;#8217;t do any Apache or Postgres tuning&amp;#8211;I just ran them out of the box.&lt;/p&gt;
503
-
504
- &lt;p&gt;Then I ran &lt;a href="http://httpd.apache.org/docs/2.1/programs/ab.html"&gt;&lt;code&gt;ab&lt;/code&gt;&lt;/a&gt; against a snapshot of &lt;a href="http://scottstuff.net"&gt;scottstuff.net&lt;/a&gt; from a couple weeks ago. I used the index page for my testing, as it&amp;#8217;s a fairly large page and I wanted to give Typo a real workout.&lt;/p&gt;
505
-
506
- &lt;p&gt;Here&amp;#8217;s what I found:&lt;/p&gt;
507
-
508
- &lt;div align="center"&gt;
509
- &lt;table&gt;
510
- &lt;tr&gt;&lt;th&gt;Cache Type&lt;/th&gt;&lt;th&gt;Requests per second&lt;/th&gt;&lt;/tr&gt;
511
- &lt;tr&gt;&lt;td&gt;Page Cache&lt;/td&gt;&lt;td align="right"&gt;2357&lt;/td&gt;&lt;/tr&gt;
512
- &lt;tr&gt;&lt;td&gt;Action Cache&lt;/td&gt;&lt;td align="right"&gt;10.6&lt;/td&gt;&lt;/tr&gt;
513
- &lt;tr&gt;&lt;td&gt;No cache&lt;/td&gt;&lt;td align="right"&gt;1.01&lt;/td&gt;&lt;/tr&gt;
514
- &lt;/table&gt;
515
- &lt;/div&gt;
516
-
517
- &lt;p&gt;That really wasn&amp;#8217;t what I&amp;#8217;d expected. The action cache underperformed my expectations by a factor of 20.&lt;/p&gt;
518
-
519
- &lt;p&gt;I then did a bit of experimentation. I created a new uncached action in my test Typo setup that did nothing but &lt;code&gt;render :text =&amp;gt; 'foo', :layout =&amp;gt; false&lt;/code&gt;, just to see if the caching system was slowing things down. Result? 10 requests/second. Then I created a new Rails project from scratch and added a new controller with the same action, and saw the same results. Still 10 requests/second.&lt;/p&gt;
520
-
521
- &lt;p&gt;However, in Rails&amp;#8217;s logs, it said that it handled the request in 2 ms, and I should be seeing 500 hits/sec for the &amp;#8220;foo&amp;#8221; page. So something is adding an extra 98 ms to each request. I&amp;#8217;m still hunting for this&amp;#8211;I don&amp;#8217;t know if it&amp;#8217;s something Xen-related on my system, an artifact of my Apache config, or what.&lt;/p&gt;
522
-
523
- &lt;p&gt;I&amp;#8217;ve tried upgrading to Rails 0.14.0, but that&amp;#8217;s a whole &lt;em&gt;other&lt;/em&gt; article.&lt;/p&gt;
524
-
525
- &lt;p&gt;Conclusions:&lt;/p&gt;
526
-
527
- &lt;ol&gt;
528
- &lt;li&gt;The page cache is really, really fast.&lt;/li&gt;
529
- &lt;li&gt;The action cache is a substantial improvement over the uncached case&amp;#8211;about 10x on this system&amp;#8211;but can&amp;#8217;t touch the performance of the page cache.&lt;/li&gt;
530
- &lt;li&gt;Changing the concurrency settings on &lt;code&gt;ab&lt;/code&gt; and/or the number of FastCGI backends in use didn&amp;#8217;t make a substantial performance difference. Settings 2-15 gave roughly the same results.&lt;/li&gt;
531
- &lt;li&gt;My &lt;a href="http://typo.leetsoft.com/trac/attachment/ticket/437/action_cache.patch"&gt;&lt;code&gt;caches_action_with_params&lt;/code&gt;&lt;/a&gt; is slightly faster then the stock action cache.&lt;/li&gt;
532
- &lt;li&gt;Moving the action/fragment cache from the FileStore (Typo default) to MemoryStore gives no real performance boost. Moving to the MemCacheStore is a substantial performance hit (~2 hits/sec vs 10 hits/sec).&lt;/li&gt;
533
- &lt;li&gt;Adding a new uncached action in ArticlesController that simply returns a fixed string (&lt;code&gt;render :layout =&amp;gt; false, :text =&amp;gt; 'foo'&lt;/code&gt;) is no faster then the action cache.&lt;/li&gt;
534
- &lt;li&gt;Moving the new action from the previous step to a Controller of its own doesn&amp;#8217;t help.&lt;/li&gt;
535
- &lt;li&gt;Removing all of the routes except the default &lt;code&gt;:controller/:action/:id&lt;/code&gt; route doesn&amp;#8217;t help, either.&lt;/li&gt;
536
- &lt;/ol&gt;
537
-
538
- &lt;p&gt;Frankly, on this hardware, I don&amp;#8217;t seem to be able to get more then 10 requests/sec out of Rails no matter what I do. I&amp;#8217;m pretty sure that this is a mistake, so I&amp;#8217;ll post a followup when I figure out what&amp;#8217;s wrong.&lt;/p&gt;
539
-
540
- &lt;p&gt;&lt;strong&gt;Update 1&lt;/strong&gt;: Another datapoint. Running an &lt;a href="http://www.rubygarden.org/ruby?FCGIExampleProgramThatPrintsTheEnvironment"&gt;example Ruby FCGI&lt;/a&gt; on this box gives me 832 hits per second. So whatever the problem is, it&amp;#8217;s not fundamental to Ruby FCGI on this box. So I need to look into Rails and see what&amp;#8217;s happening.&lt;/p&gt;
541
-
542
- &lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;: Making some progress. Apparently I screwed up when I tested a new, standalone Rails FCGI app before (forgot to restart FCGI?). This time, I got 130 req/sec, which is a vast improvement over the 10 req/sec that I was seeing before. Most of that speed hit seems to come from using Postgres for session storage. Unfortunately, even after making that change, my null controller is still only getting 40 req/sec with Typo. Transporting the same controller to a blank Rails project gives me 130 req/sec with the same code. Watching strace, it looks like something is forcing Typo to reload the &lt;code&gt;digest/md5&lt;/code&gt; module for every hit. Unfortunately, I can&amp;#8217;t figure out how that&amp;#8217;s happening&amp;#8211;my &lt;code&gt;environment.rb&lt;/code&gt; is identical between the two trees, as is my &lt;code&gt;database.yml&lt;/code&gt;. I&amp;#8217;ll get back to this later; I have other things that I need to finish today.&lt;/p&gt;</summary>
543
- <content type="html">&lt;p&gt;I finally had a bit of time to do some &lt;a href="http://typo.leetsoft.com"&gt;Typo&lt;/a&gt; benchmarking over the weekend and (as usual) found that my instincts were all wrong.&lt;/p&gt;
544
-
545
- &lt;p&gt;I was specifically interested in the performance difference between the &lt;a href="http://api.rubyonrails.com/classes/ActionController/Caching/Pages.html"&gt;page cache&lt;/a&gt; and the &lt;a href="http://api.rubyonrails.com/classes/ActionController/Caching/Actions.html"&gt;action cache&lt;/a&gt;&amp;#8211;my guess was that the action cache was a 10x performance hit.&lt;/p&gt;
546
-
547
- &lt;p&gt;So I set up a test environment under Xen, running Typo r683, PostgreSQL, Apache 2, FastCGI, Ruby 1.8.2, and Rails 0.13.1. I didn&amp;#8217;t do any Apache or Postgres tuning&amp;#8211;I just ran them out of the box.&lt;/p&gt;
548
-
549
- &lt;p&gt;Then I ran &lt;a href="http://httpd.apache.org/docs/2.1/programs/ab.html"&gt;&lt;code&gt;ab&lt;/code&gt;&lt;/a&gt; against a snapshot of &lt;a href="http://scottstuff.net"&gt;scottstuff.net&lt;/a&gt; from a couple weeks ago. I used the index page for my testing, as it&amp;#8217;s a fairly large page and I wanted to give Typo a real workout.&lt;/p&gt;
550
-
551
- &lt;p&gt;Here&amp;#8217;s what I found:&lt;/p&gt;
552
-
553
- &lt;div align="center"&gt;
554
- &lt;table&gt;
555
- &lt;tr&gt;&lt;th&gt;Cache Type&lt;/th&gt;&lt;th&gt;Requests per second&lt;/th&gt;&lt;/tr&gt;
556
- &lt;tr&gt;&lt;td&gt;Page Cache&lt;/td&gt;&lt;td align="right"&gt;2357&lt;/td&gt;&lt;/tr&gt;
557
- &lt;tr&gt;&lt;td&gt;Action Cache&lt;/td&gt;&lt;td align="right"&gt;10.6&lt;/td&gt;&lt;/tr&gt;
558
- &lt;tr&gt;&lt;td&gt;No cache&lt;/td&gt;&lt;td align="right"&gt;1.01&lt;/td&gt;&lt;/tr&gt;
559
- &lt;/table&gt;
560
- &lt;/div&gt;
561
-
562
- &lt;p&gt;That really wasn&amp;#8217;t what I&amp;#8217;d expected. The action cache underperformed my expectations by a factor of 20.&lt;/p&gt;
563
-
564
- &lt;p&gt;I then did a bit of experimentation. I created a new uncached action in my test Typo setup that did nothing but &lt;code&gt;render :text =&amp;gt; 'foo', :layout =&amp;gt; false&lt;/code&gt;, just to see if the caching system was slowing things down. Result? 10 requests/second. Then I created a new Rails project from scratch and added a new controller with the same action, and saw the same results. Still 10 requests/second.&lt;/p&gt;
565
-
566
- &lt;p&gt;However, in Rails&amp;#8217;s logs, it said that it handled the request in 2 ms, and I should be seeing 500 hits/sec for the &amp;#8220;foo&amp;#8221; page. So something is adding an extra 98 ms to each request. I&amp;#8217;m still hunting for this&amp;#8211;I don&amp;#8217;t know if it&amp;#8217;s something Xen-related on my system, an artifact of my Apache config, or what.&lt;/p&gt;
567
-
568
- &lt;p&gt;I&amp;#8217;ve tried upgrading to Rails 0.14.0, but that&amp;#8217;s a whole &lt;em&gt;other&lt;/em&gt; article.&lt;/p&gt;
569
-
570
- &lt;p&gt;Conclusions:&lt;/p&gt;
571
-
572
- &lt;ol&gt;
573
- &lt;li&gt;The page cache is really, really fast.&lt;/li&gt;
574
- &lt;li&gt;The action cache is a substantial improvement over the uncached case&amp;#8211;about 10x on this system&amp;#8211;but can&amp;#8217;t touch the performance of the page cache.&lt;/li&gt;
575
- &lt;li&gt;Changing the concurrency settings on &lt;code&gt;ab&lt;/code&gt; and/or the number of FastCGI backends in use didn&amp;#8217;t make a substantial performance difference. Settings 2-15 gave roughly the same results.&lt;/li&gt;
576
- &lt;li&gt;My &lt;a href="http://typo.leetsoft.com/trac/attachment/ticket/437/action_cache.patch"&gt;&lt;code&gt;caches_action_with_params&lt;/code&gt;&lt;/a&gt; is slightly faster then the stock action cache.&lt;/li&gt;
577
- &lt;li&gt;Moving the action/fragment cache from the FileStore (Typo default) to MemoryStore gives no real performance boost. Moving to the MemCacheStore is a substantial performance hit (~2 hits/sec vs 10 hits/sec).&lt;/li&gt;
578
- &lt;li&gt;Adding a new uncached action in ArticlesController that simply returns a fixed string (&lt;code&gt;render :layout =&amp;gt; false, :text =&amp;gt; 'foo'&lt;/code&gt;) is no faster then the action cache.&lt;/li&gt;
579
- &lt;li&gt;Moving the new action from the previous step to a Controller of its own doesn&amp;#8217;t help.&lt;/li&gt;
580
- &lt;li&gt;Removing all of the routes except the default &lt;code&gt;:controller/:action/:id&lt;/code&gt; route doesn&amp;#8217;t help, either.&lt;/li&gt;
581
- &lt;/ol&gt;
582
-
583
- &lt;p&gt;Frankly, on this hardware, I don&amp;#8217;t seem to be able to get more then 10 requests/sec out of Rails no matter what I do. I&amp;#8217;m pretty sure that this is a mistake, so I&amp;#8217;ll post a followup when I figure out what&amp;#8217;s wrong.&lt;/p&gt;
584
-
585
- &lt;p&gt;&lt;strong&gt;Update 1&lt;/strong&gt;: Another datapoint. Running an &lt;a href="http://www.rubygarden.org/ruby?FCGIExampleProgramThatPrintsTheEnvironment"&gt;example Ruby FCGI&lt;/a&gt; on this box gives me 832 hits per second. So whatever the problem is, it&amp;#8217;s not fundamental to Ruby FCGI on this box. So I need to look into Rails and see what&amp;#8217;s happening.&lt;/p&gt;
586
-
587
- &lt;p&gt;&lt;strong&gt;Update 2&lt;/strong&gt;: Making some progress. Apparently I screwed up when I tested a new, standalone Rails FCGI app before (forgot to restart FCGI?). This time, I got 130 req/sec, which is a vast improvement over the 10 req/sec that I was seeing before. Most of that speed hit seems to come from using Postgres for session storage. Unfortunately, even after making that change, my null controller is still only getting 40 req/sec with Typo. Transporting the same controller to a blank Rails project gives me 130 req/sec with the same code. Watching strace, it looks like something is forcing Typo to reload the &lt;code&gt;digest/md5&lt;/code&gt; module for every hit. Unfortunately, I can&amp;#8217;t figure out how that&amp;#8217;s happening&amp;#8211;my &lt;code&gt;environment.rb&lt;/code&gt; is identical between the two trees, as is my &lt;code&gt;database.yml&lt;/code&gt;. I&amp;#8217;ll get back to this later; I have other things that I need to finish today.&lt;/p&gt;</content>
588
- </entry>
589
- <entry>
590
- <author>
591
- <name>Scott Laird</name>
592
- </author>
593
- <id>urn:uuid:9f62ba921c690e02fced915e25ecea24</id>
594
- <published>2005-10-12T09:43:22-07:00</published>
595
- <updated>2006-06-21T20:26:42-07:00</updated>
596
- <title type="html">Nokia E-series</title>
597
- <link href="http://localhost/articles/2005/10/12/nokia-e-series" rel="alternate" type="text/html"/>
598
- <category term="nokia" scheme="http://localhost/articles/tag/nokia"/>
599
- <category term="nokian91" scheme="http://localhost/articles/tag/nokian91"/>
600
- <category term="phones" scheme="http://localhost/articles/tag/phones"/>
601
- <category term="nokiaeseries" scheme="http://localhost/articles/tag/nokiaeseries"/>
602
- <summary type="html">&lt;p&gt;Nokia &lt;a href="http://news.com.com/E-mail+gets+top+billing+in+new+Nokia+phones/2100-1037_3-5893624.html?part=rss&amp;amp;tag=5893624&amp;amp;subj=news"&gt;announced&lt;/a&gt; a new block of phones today: the E60, E61, and E70. Unlike the earlier (and still pending) &lt;a href="http://www.nokia.com/nseries/"&gt;N-series&lt;/a&gt;, these are aimed towards corporate users. All three run Series 60 3rd edition and include 802.11g and Bluetooth. They also come with a SIP client so they can interact with business VoIP systems. The low-end model, the &lt;a href="http://www.mobileburn.com/news.jsp?Id=1710&amp;amp;source=RELATED"&gt;E60&lt;/a&gt; is yet another Series 60 candybar phone, like the 6682 and N70, but with WiFi. The &lt;a href="http://www.mobileburn.com/news.jsp?Id=1711&amp;amp;source=HOME"&gt;E61&lt;/a&gt; is a Blackberry-like model with a QWERTY keyboard and landscape display. Finally, the &lt;a href="http://www.mobileburn.com/news.jsp?Id=1712&amp;amp;source=RELATED"&gt;E70&lt;/a&gt; is a &amp;#8220;handlebar&amp;#8221; style phone that flips open to reveal a keyboard, half on the left side of the display and half on the right.&lt;/p&gt;
603
-
604
- &lt;p&gt;After playing with the Nokia 6682 and 9300 yesterday, I&amp;#8217;m starting to think that a keyboard would be really nice. I might actually be more interested in the E70 then the &lt;a href="http://scottstuff.net/blog/articles/2005/07/08/nokia-n91-lust"&gt;N91&lt;/a&gt;. Here&amp;#8217;s how they compare:&lt;/p&gt;
605
-
606
- &lt;p&gt;Same:&lt;/p&gt;
607
-
608
- &lt;ul&gt;
609
- &lt;li&gt;802.11g, bluetooth, 3G&lt;/li&gt;
610
- &lt;li&gt;Series 60, 3rd edition&lt;/li&gt;
611
- &lt;li&gt;2 MP camera&lt;/li&gt;
612
- &lt;li&gt;Scheduled for 1Q 2006 release&lt;/li&gt;
613
- &lt;li&gt;Similar sizes: (N91: 113.1x55.2x22, E70: 117x53x22)&lt;/li&gt;
614
- &lt;/ul&gt;
615
-
616
- &lt;p&gt;N91&amp;#8217;s favor:&lt;/p&gt;
617
-
618
- &lt;ul&gt;
619
- &lt;li&gt;4 GB hard drive&lt;/li&gt;
620
- &lt;li&gt;3.5mm headphone jack&lt;/li&gt;
621
- &lt;/ul&gt;
622
-
623
- &lt;p&gt;E70&amp;#8217;s favor:&lt;/p&gt;
624
-
625
- &lt;ul&gt;
626
- &lt;li&gt;built-in SIP client (might be on N91 also)&lt;/li&gt;
627
- &lt;li&gt;high-res display (352x416, 4x the pixel count)&lt;/li&gt;
628
- &lt;li&gt;QWERTY keyboard&lt;/li&gt;
629
- &lt;li&gt;miniSD slot (1 GB for $75, partially counters the HD on the N91)&lt;/li&gt;
630
- &lt;li&gt;lighter (127g vs 160g)&lt;/li&gt;
631
- &lt;/ul&gt;
632
-
633
- &lt;p&gt;I&amp;#8217;m not sure if the E70 includes the video player that comes on the N91. It&amp;#8217;s &lt;em&gt;possible&lt;/em&gt; that it includes a 3.5mm headphone jack&amp;#8211;the specs list a MP3/AAC player application. The pricing rumors that I&amp;#8217;ve seen put the whole E-series around €500 or so, which means that they may actually be cheaper then the N91.&lt;/p&gt;
634
-
635
- &lt;p&gt;Of course, availability is the key. The N91 was announced &lt;em&gt;months&lt;/em&gt; ago, while the E70 is new. However, the E70 isn&amp;#8217;t quite as innovative as the N91, so there&amp;#8217;s a chance that they&amp;#8217;ll arrive on the market (in Europe at least) in a similar timeframe. I have no idea which one will make it through the FCC first. I&amp;#8217;m not particularly concerned about US carriers carrying the phone, now that Nokia is &lt;a href="http://scottstuff.net/blog/articles/2005/07/22/nokias-selling-phones-directly-to-us-consumers-now"&gt;selling directly to US consumers&lt;/a&gt;. With any luck, our local &lt;a href="http://scottstuff.net/blog/articles/2005/10/08/nokia-kiosk-at-alderwood"&gt;Nokia demo kiosk&lt;/a&gt; will have both and I&amp;#8217;ll be able to compare them in person.&lt;/p&gt;</summary>
636
- <content type="html">&lt;p&gt;Nokia &lt;a href="http://news.com.com/E-mail+gets+top+billing+in+new+Nokia+phones/2100-1037_3-5893624.html?part=rss&amp;amp;tag=5893624&amp;amp;subj=news"&gt;announced&lt;/a&gt; a new block of phones today: the E60, E61, and E70. Unlike the earlier (and still pending) &lt;a href="http://www.nokia.com/nseries/"&gt;N-series&lt;/a&gt;, these are aimed towards corporate users. All three run Series 60 3rd edition and include 802.11g and Bluetooth. They also come with a SIP client so they can interact with business VoIP systems. The low-end model, the &lt;a href="http://www.mobileburn.com/news.jsp?Id=1710&amp;amp;source=RELATED"&gt;E60&lt;/a&gt; is yet another Series 60 candybar phone, like the 6682 and N70, but with WiFi. The &lt;a href="http://www.mobileburn.com/news.jsp?Id=1711&amp;amp;source=HOME"&gt;E61&lt;/a&gt; is a Blackberry-like model with a QWERTY keyboard and landscape display. Finally, the &lt;a href="http://www.mobileburn.com/news.jsp?Id=1712&amp;amp;source=RELATED"&gt;E70&lt;/a&gt; is a &amp;#8220;handlebar&amp;#8221; style phone that flips open to reveal a keyboard, half on the left side of the display and half on the right.&lt;/p&gt;
637
-
638
- &lt;p&gt;After playing with the Nokia 6682 and 9300 yesterday, I&amp;#8217;m starting to think that a keyboard would be really nice. I might actually be more interested in the E70 then the &lt;a href="http://scottstuff.net/blog/articles/2005/07/08/nokia-n91-lust"&gt;N91&lt;/a&gt;. Here&amp;#8217;s how they compare:&lt;/p&gt;
639
-
640
- &lt;p&gt;Same:&lt;/p&gt;
641
-
642
- &lt;ul&gt;
643
- &lt;li&gt;802.11g, bluetooth, 3G&lt;/li&gt;
644
- &lt;li&gt;Series 60, 3rd edition&lt;/li&gt;
645
- &lt;li&gt;2 MP camera&lt;/li&gt;
646
- &lt;li&gt;Scheduled for 1Q 2006 release&lt;/li&gt;
647
- &lt;li&gt;Similar sizes: (N91: 113.1x55.2x22, E70: 117x53x22)&lt;/li&gt;
648
- &lt;/ul&gt;
649
-
650
- &lt;p&gt;N91&amp;#8217;s favor:&lt;/p&gt;
651
-
652
- &lt;ul&gt;
653
- &lt;li&gt;4 GB hard drive&lt;/li&gt;
654
- &lt;li&gt;3.5mm headphone jack&lt;/li&gt;
655
- &lt;/ul&gt;
656
-
657
- &lt;p&gt;E70&amp;#8217;s favor:&lt;/p&gt;
658
-
659
- &lt;ul&gt;
660
- &lt;li&gt;built-in SIP client (might be on N91 also)&lt;/li&gt;
661
- &lt;li&gt;high-res display (352x416, 4x the pixel count)&lt;/li&gt;
662
- &lt;li&gt;QWERTY keyboard&lt;/li&gt;
663
- &lt;li&gt;miniSD slot (1 GB for $75, partially counters the HD on the N91)&lt;/li&gt;
664
- &lt;li&gt;lighter (127g vs 160g)&lt;/li&gt;
665
- &lt;/ul&gt;
666
-
667
- &lt;p&gt;I&amp;#8217;m not sure if the E70 includes the video player that comes on the N91. It&amp;#8217;s &lt;em&gt;possible&lt;/em&gt; that it includes a 3.5mm headphone jack&amp;#8211;the specs list a MP3/AAC player application. The pricing rumors that I&amp;#8217;ve seen put the whole E-series around €500 or so, which means that they may actually be cheaper then the N91.&lt;/p&gt;
668
-
669
- &lt;p&gt;Of course, availability is the key. The N91 was announced &lt;em&gt;months&lt;/em&gt; ago, while the E70 is new. However, the E70 isn&amp;#8217;t quite as innovative as the N91, so there&amp;#8217;s a chance that they&amp;#8217;ll arrive on the market (in Europe at least) in a similar timeframe. I have no idea which one will make it through the FCC first. I&amp;#8217;m not particularly concerned about US carriers carrying the phone, now that Nokia is &lt;a href="http://scottstuff.net/blog/articles/2005/07/22/nokias-selling-phones-directly-to-us-consumers-now"&gt;selling directly to US consumers&lt;/a&gt;. With any luck, our local &lt;a href="http://scottstuff.net/blog/articles/2005/10/08/nokia-kiosk-at-alderwood"&gt;Nokia demo kiosk&lt;/a&gt; will have both and I&amp;#8217;ll be able to compare them in person.&lt;/p&gt;</content>
670
- </entry>
671
- </feed>