Mosso hosting cloud 5

Posted by Slobodan Kovačević on September 17, 2008

Mosso’s hosting cloud at $100 / month seems like a good solution to get a scalable server. However one thing bugs me, actually two things…

First one: they offer FTP only access. Meaning you cannot deploy sites directly from code repositories (i.e. git or svn). That sucks.

Second thing that bugs me: for $100 you get quite a lot of computing power which can be used to run multiple sites – but you are only allowed to have one Rails app running. Only one. If you want additional Rails apps (for example to have a test server) you need to pay an extra fee.

I know it’s cloud computing and that you have to be able to run it with any additional configuration (that’s why I think it’s ok that you have to freeze your gems in Rails apps, because you cannot install any gems yourself)… but not being able to checkout my code from repository and having to upload the whole app each time you make changes is really annoying.

In their defense, the support guy said that they are working on it, but he could give me an ETA when they’ll allow something like that.

Share/Save/Bookmark

InnoDB per-table tablespaces – split ibdata1 to smaller chunks 2

Posted by Slobodan Kovačević on July 24, 2008

Today I had to import 3GB of InnoDB tables in MySQL. Unfortunately, while importing the server run out of disk space – which caused whole server to grind to a halt. Naively I tried to delete imported data to free up space… I was in for an unpleasant surprise.

By default when MySQL uses InnoDB engine it stores most of the information in single file called ibdata1. One downside is that once ibdata1 file grows it cannot shrink – even if you delete all InnoDB tables. For some reason MySQL is set to use single file instead of per-table tablespaces similar to MyISAM.

Enabling per-table tablespaces is easy just add innodb_file_per_table to my.cnf file. Problem is that all newly created tables, only new tables, will be in separate files. It seems that there’s no easy way to convert old tables and reclaim the space taken by ibdata1.

There are 3 ways and two are basically export-drop-delete-import type of solutions:

  1. Convert all InnoDB tables to MyISAM
  2. Export only InnoDB tables, drop them, delete ibdata1 and import InnoDB tables.
  3. Export all databases, delete ibdata1 and import everything back.

I choose option 2 because I luckily had only 40 InnoDB tables and much more using MyISAM. For details on how to apply each solution and down/up sides of each read MySQL: Reducing ibdata1.

Share/Save/Bookmark

This should be interesting weekly – week 28

Posted by Slobodan Kovačević on July 13, 2008

[condensed from 'this should be interesting' tumblelog]

Share/Save/Bookmark

Collection partial variable naming – new in edge rails 2

Posted by Slobodan Kovačević on July 07, 2008

One thing that always annoyed me when rendering collection partials is that a local var in partial is named same as a partial template name. So, to go around this I always created another local variable in partial and gave it a more meaningful name.

No longer… As the Ryan says from now on in the Edge Rails you can specify the name of the local variable in which each collection element will be exposed within a partial. You will can do this:

render :partial => 'employees', :collection => @workers, :as => :person

It’s a simple thing, but it’s just one of the things that bugged me. I am glad it’s gone now.

Share/Save/Bookmark

This should be interesting weekly – week 27

Posted by Slobodan Kovačević on July 06, 2008

This is the first weekly condensed edition of my “This should be interesting” tumblelog. Every Sunday I will re-post most interesting posts here on the Icebergist.

Share/Save/Bookmark