Pat got me a new camera for my birthday this past October so I have been trying to take more pictures lately. One of my new years resolutions is to take more pictures! As a result, I’ve been trying out Yahoo’s Flickr and Google’s Picasa over the past couple of weeks. With Picasa recently added support on the Mac and Apple announcing iPhoto out-of-the-box Flickr integration, the feature sets from the desktop are pretty much identical. Both support (or will support) face recognition, tagging, and exporting.
For the web galleries, I really liked Picasa’s layout over Flickr’s. The web site is a lot more simplistic and easy to navigate. Maybe it’s becase I’m so familiar with other Google services. Flickr’s slideshow is so awesome though. Viewing your photostream through Cooliris is such beautiful eye candy.

I started with the free accounts. Google gives you a gig of space for the free account and you can create as many albums as you want. Flickr’s free account gives you 100 mb of upload per month and limits you to three sets.
For me, it really came down to pricing. In order to get more disk space for Picasa, you have to purchase more storage. Starting purchase goes for $20/yr for 10gigs up to $500/yr for 400GB. This storage is actually not specific to Picasa but is shared by all other Google services that need to use extra space. Flickr offers a Pro account, which gives you unlimited storage space for your videos and photos and allows you to create any number of sets and collections, for $24.95.
Given the number of photos I want to upload and my budget, I went with Flickr. Today, storage is so cheap. For $25 bucks, I should be able to get unlimited storage for a service like photo sharing. I’ve started to upload some photos I’ve had for awhile and never really shared them with those who would most enjoy them. It’s been really fun going through old pictures. My photostream can be found here.
Posted in
personal,
thoughts,
web at January 12th, 2009.
1 Comment.
Inspired by a discussion of URL shortening, I took a weekend and implemented one of my own. When thinking about tiny URLs, a quote always came to mind.
Don’t use a big word where a diminutive one will suffice.
So after finding out the domain was available, diminutiveurl.com was born. Yes, it’s poking a little fun at the idea of a tiny url but it was fun to hack on. It’s very minimilistic at this point but I hope to add some interesting features.
For no other reason than to build something, I hope you enjoy it! I am glad to present diminitiveurl.com! Please let me know what you think.
Posted in
geekery,
humor,
ruby,
web at January 11th, 2009.
No Comments.
Over the course of the past months in her free time between work and planning a wedding, Pat’s been hard at work at creating a web site for our wedding. We felt we had enough to show it off to the rest o the world so I finally got around to deploying it. I’m really happy with the way it turned out. I think she did a pretty awesome job. I contributed in a small way by setting up the web server, create the RSVP site, and installing the guestbook. The whole concept and design is Pat’s creation. She did all of the page layout and flash work. I’m so proud of her. She’s turning into a web geek and she doesn’t even know it.

I’m sure there are some kinks to iron out but please check out theoandpat.com and let us know what you think. Oh, yeah also, RSVP for the wedding. If you’re reading my blog, chances are I know you and you’re invited.
-Theo
Posted in
personal at January 11th, 2009.
4 Comments.
As I am running more and more on my 256mb slice, I’m trying to squeeze more performance out of the system. After a bit of digging, I’ve made a few changes.
First thing I did was switch out the default mysql config with one tweaked for smaller boxes. This configuration actually came with the mysql installation under /usr/share/doc/mysql-server-5.0/examples/. Just backup your existing my.cnf (mine is located under /etc/mysql) and use the following:
# The following options will be passed to all MySQL clients
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# Uncomment the following if you are NOT using BDB tables
#skip-bdb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout
You can see estimated memory usage with a config if you just copy paste the configuration file here.
Restart MySQL (/etc/init.d/mysql restart).
The second thing I did was check out MySQLTuner. Just download the perl script and run it. It will run some analysis on your mysql setup and provide some performance and configuration tweak recommendations.
Sample output looks like this:
>> MySQLTuner 1.0.0 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.51a-3ubuntu5.4
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 867K (Tables: 18)
[--] Data in InnoDB tables: 704K (Tables: 40)
[!!] Total fragmented tables: 2
-------- Performance Metrics -------------------------------------------------
[--] Up for: 14h 57m 0s (17K q [0.316 qps], 699 conn, TX: 55M, RX: 3M)
[--] Reads / Writes: 96% / 4%
[--] Total buffers: 26.0M global + 824.0K per thread (100 max threads)
[OK] Maximum possible memory usage: 106.5M (41% of installed RAM)
[OK] Slow queries: 0% (0/17K)
[OK] Highest usage of available connections: 6% (6/100)
[!!] Key buffer size / total MyISAM indexes: 16.0K/381.0K
[!!] Key buffer hit rate: 88.5% (154K cached / 17K reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 4K sorts)
[!!] Temporary tables created on disk: 30% (1K on disk / 4K total)
[!!] Thread cache is disabled
[!!] Table cache hit rate: 0% (4 open / 7K opened)
[OK] Open file limit used: 0% (8/1K)
[OK] Table locks acquired immediately: 99% (17K immediate / 17K locks)
[OK] InnoDB data size / buffer pool: 704.0K/8.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Enable the slow query log to troubleshoot bad queries
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Set thread_cache_size to 4 as a starting value
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
key_buffer_size (> 381.0K)
query_cache_size (>= 8M)
tmp_table_size (> 32M)
max_heap_table_size (> 16M)
thread_cache_size (start at 4)
table_cache (> 4)
I haven’t made any of the recommended changes yet though. I am going to try to see how this default small config performs.
I’ll try to follow up with any of my findings.
Posted in
tutorials at December 7th, 2008.
2 Comments.
Following up on my previous post , I’ve been experience slow load times (10-15 secs) on the initial request after application restarts. This has to do with the way mod_rails manages application instances (Although, I experienced this when using mongrel_cluster and proxy balancers). It will spin up instances on page request and each instance has an idle timeout. This just means after the timeout expires, mod_rails will shutdown that instance to conserve memory allocation. While you can change timeout value (see PassengerPoolIdleTime), this will only cause all instances that get spin up to live longer. After high load times, these instances will stick around longer than neccessary.
For low traffic sites (like mine), this idle timeout may be reached causing the next visitor to our website to experience a really long delay before page load. What we really want is an option to set a minimum number of instances. This would allow us to automatically spin up an instance during start up and keep it around. Unfortunately at this time, it doesn’t look like there is a way to set this.
As a workaround, I’ve setup a crontab that makes a request to my application every 5 minutes to prevent mod_rails from killing off all application instances.
To do this just run:
crontab -e
And then specific the following cron
*/5 * * * * wget -O /dev/null http://www.myapp.com 2>/dev/null
You can verify this is working correctly but just tailing your application logs and verify every 5 minutes you get a request.
You can also run
passenger-status
You should see at least the count variable to be at least 1 instance.
Note, this workaround will not immediate start up an instance upon restart. You can add an initial request as part of your post deploy capistrano task though. You probably should be making sure your application is up after deploying or restarting the application anyways.
Posted in
ruby,
tutorials at December 7th, 2008.
2 Comments.