25
Jan
12

Benchmarking GoGrid Servers Old 1 core 2.27 server

    1 Geekbench 2.2.6 : http://www.primatelabs.ca/geekbench/
    2
    3 System Information
    4   Operating System      Linux 2.6.18-274.7.1.el5 x86_64
    5   Model                 Xen HVM domU
    6   Motherboard
    7   Processor             Intel(R) Xeon(R) CPU           E5520  @ 2.27GHz @ 2.27 GHz
    8                         1 Processor
    9   Processor ID          GenuineIntel Family 6 Model 26 Stepping 5
   10   L1 Instruction Cache  32.0 KB
   11   L1 Data Cache         32.0 KB
   12   L2 Cache              256 KB
   13   L3 Cache              8.00 MB
   14   Memory                3.87 GB
   15   BIOS                  Xen 3.1.2-164.11.1.el5
   16
   17 Integer
   18   Blowfish
   19     single-threaded scalar    832 |||
   20     multi-threaded scalar    1079 ||||
   21   Text Compress
   22     single-threaded scalar   1941 |||||||
   23     multi-threaded scalar    1863 |||||||
   24   Text Decompress
   25     single-threaded scalar   2110 ||||||||
   26     multi-threaded scalar    2186 ||||||||
   27   Image Compress
   28     single-threaded scalar   1725 ||||||
   29     multi-threaded scalar    1687 ||||||
   30   Image Decompress
   31     single-threaded scalar   2046 ||||||||
   32     multi-threaded scalar    2141 ||||||||
   33   Lua
   34     single-threaded scalar   3726 ||||||||||||||
   35     multi-threaded scalar    3753 |||||||||||||||
   36
   37 Floating Point
   38   Mandelbrot
   39     single-threaded scalar   1893 |||||||
   40     multi-threaded scalar    1917 |||||||
   41   Dot Product
   42     single-threaded scalar   2478 |||||||||
   43     multi-threaded scalar    2601 ||||||||||
   44     single-threaded vector   3180 ||||||||||||
   45     multi-threaded vector    3649 ||||||||||||||
   46   LU Decomposition
   47     single-threaded scalar   1788 |||||||
   48     multi-threaded scalar    1797 |||||||
   49   Primality Test
   50     single-threaded scalar   3781 |||||||||||||||
   51     multi-threaded scalar    2983 |||||||||||
   52   Sharpen Image
   53     single-threaded scalar   5221 ||||||||||||||||||||
   54     multi-threaded scalar    5291 |||||||||||||||||||||
   55   Blur Image
   56     single-threaded scalar   1801 |||||||
   57     multi-threaded scalar    1817 |||||||
   58
   59 Memory
   60   Read Sequential
   61     single-threaded scalar   3089 ||||||||||||
   62   Write Sequential
   63     single-threaded scalar   4039 ||||||||||||||||
   64   Stdlib Allocate
   65     single-threaded scalar   3511 ||||||||||||||
   66   Stdlib Write
   67     single-threaded scalar   2440 |||||||||
   68   Stdlib Copy
   69     single-threaded scalar   5008 ||||||||||||||||||||
   70
   71 Stream
   72   Stream Copy
   73     single-threaded scalar   3459 |||||||||||||
   74     single-threaded vector   5537 ||||||||||||||||||||||
   75   Stream Scale
   76     single-threaded scalar   3495 |||||||||||||
   77     single-threaded vector   5174 ||||||||||||||||||||
   78   Stream Add
   79     single-threaded scalar   3697 ||||||||||||||
   80     single-threaded vector   5526 ||||||||||||||||||||||
   81   Stream Triad
   82     single-threaded scalar   3592 ||||||||||||||
   83     single-threaded vector   3915 |||||||||||||||
   84
   85 Benchmark Summary
   86   Integer Score              2090 ||||||||
   87   Floating Point Score       2871 |||||||||||
   88   Memory Score               3617 ||||||||||||||
   89   Stream Score               4299 |||||||||||||||||
   90
   91   Geekbench Score            2889 |||||||||||
   92
   93 
25
Jan
12

Benchmarking GoGrid Servers New 8 core 2.67 server

    1 Geekbench 2.2.6 : http://www.primatelabs.ca/geekbench/
    2
    3 System Information
    4   Operating System      Linux 2.6.18-274.7.1.el5 x86_64
    5   Model                 Xen HVM domU
    6   Motherboard
    7   Processor             Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz @ 2.67 GHz
    8                         1 Processor, 8 Threads
    9   Processor ID          GenuineIntel Family 6 Model 44 Stepping 2
   10   L1 Instruction Cache  32.0 KB x 8
   11   L1 Data Cache         32.0 KB x 8
   12   L2 Cache              256 KB x 8
   13   L3 Cache              12.0 MB x 8
   14   Memory                7.81 GB
   15   BIOS                  Xen 3.1.2-164.11.1.el5
   16
   17 Integer
   18   Blowfish
   19     single-threaded scalar   1800 |||||||
   20     multi-threaded scalar   13754 ||||||||||||||||||||||||||||||||||||||||
   21   Text Compress
   22     single-threaded scalar   2200 ||||||||
   23     multi-threaded scalar   14993 ||||||||||||||||||||||||||||||||||||||||
   24   Text Decompress
   25     single-threaded scalar   2433 |||||||||
   26     multi-threaded scalar   16283 ||||||||||||||||||||||||||||||||||||||||
   27   Image Compress
   28     single-threaded scalar   1997 |||||||
   29     multi-threaded scalar    9861 |||||||||||||||||||||||||||||||||||||||
   30   Image Decompress
   31     single-threaded scalar   2239 ||||||||
   32     multi-threaded scalar    8465 |||||||||||||||||||||||||||||||||
   33   Lua
   34     single-threaded scalar   4210 ||||||||||||||||
   35     multi-threaded scalar   27226 ||||||||||||||||||||||||||||||||||||||||
   36
   37 Floating Point
   38   Mandelbrot
   39     single-threaded scalar   2223 ||||||||
   40     multi-threaded scalar   15518 ||||||||||||||||||||||||||||||||||||||||
   41   Dot Product
   42     single-threaded scalar   2923 |||||||||||
   43     multi-threaded scalar   21016 ||||||||||||||||||||||||||||||||||||||||
   44     single-threaded vector   3547 ||||||||||||||
   45     multi-threaded vector   27470 ||||||||||||||||||||||||||||||||||||||||
   46   LU Decomposition
   47     single-threaded scalar   1998 |||||||
   48     multi-threaded scalar   11009 ||||||||||||||||||||||||||||||||||||||||
   49   Primality Test
   50     single-threaded scalar   4276 |||||||||||||||||
   51     multi-threaded scalar   23493 ||||||||||||||||||||||||||||||||||||||||
   52   Sharpen Image
   53     single-threaded scalar   6097 ||||||||||||||||||||||||
   54     multi-threaded scalar   24567 ||||||||||||||||||||||||||||||||||||||||
   55   Blur Image
   56     single-threaded scalar   2117 ||||||||
   57     multi-threaded scalar   16269 ||||||||||||||||||||||||||||||||||||||||
   58
   59 Memory
   60   Read Sequential
   61     single-threaded scalar   3553 ||||||||||||||
   62   Write Sequential
   63     single-threaded scalar   4808 |||||||||||||||||||
   64   Stdlib Allocate
   65     single-threaded scalar   3886 |||||||||||||||
   66   Stdlib Write
   67     single-threaded scalar   2191 ||||||||
   68   Stdlib Copy
   69     single-threaded scalar   4324 |||||||||||||||||
   70
   71 Stream
   72   Stream Copy
   73     single-threaded scalar   2939 |||||||||||
   74     single-threaded vector   3639 ||||||||||||||
   75   Stream Scale
   76     single-threaded scalar   2848 |||||||||||
   77     single-threaded vector   3267 |||||||||||||
   78   Stream Add
   79     single-threaded scalar   2721 ||||||||||
   80     single-threaded vector   3698 ||||||||||||||
   81   Stream Triad
   82     single-threaded scalar   2957 |||||||||||
   83     single-threaded vector   2711 ||||||||||
   84
   85 Benchmark Summary
   86   Integer Score              8788 |||||||||||||||||||||||||||||||||||
   87   Floating Point Score      11608 ||||||||||||||||||||||||||||||||||||||||
   88   Memory Score               3752 |||||||||||||||
   89   Stream Score               3097 ||||||||||||
   90
   91   Geekbench Score            8198 ||||||||||||||||||||||||||||||||
   92
   93 
15
May
11

Using ruby to parse .bex files from Billings Pro

#!/usr/bin/env ruby
# bex_parser.rb

# If you are a Ruby Programmer, this script may be interesting to you.

require 'rubygems'
require 'hpricot'
require 'mysql'
require 'time'

# Set the File to read from the slips that were exported.
doc = Hpricot::XML(File.read("Desktop/slips.bex"))
# Loop through the top element, silly since there is only one, but needed
(doc/'plist').each do |sx|

  # Loop through all the time slips that were exported and exist in the .bex file.
  (sx/'dict array dict').each do |sm|

    # Loop through each component of time slip
    (sm/'array').each do |st|

      # Setting the billing comment from the position, may be in 1 or 2 [0][1]
      ((st.parent/'key')[1].inner_html == 'comment') ? @billing_comment = (st.parent/'string')[0].inner_html : @billing_comment = ''
      ((st.parent/'key')[2].inner_html == 'comment') ? @billing_comment = (st.parent/'string')[1].inner_html : @billing_comment = ''

      # Setting the category from the position, may be in 1 or 2 [0][1]
      ((st.parent/'key')[1].inner_html == 'category.name') ? @billing_category = (st.parent/'string')[0].inner_html : @billing_category = ''

      if ((st.parent/'string')[2].inner_html == 'Billings')
        @billing_description = ((st.parent/'string')[2].inner_html == 'Billings' ? (st.parent/'string')[3].inner_html : (st.parent/'string')[2].inner_html)
        @billing_worker = ((st.parent/'string')[2].inner_html == 'Billings' ? (st.parent/'string')[4].inner_html : (st.parent/'string')[3].inner_html)
      else
        @billing_description = ((st.parent/'string')[4].inner_html == 'Billings' ? (st.parent/'string')[5].inner_html : (st.parent/'string')[4].inner_html)
        @billing_worker = ((st.parent/'string')[4].inner_html == 'Billings' ? (st.parent/'string')[6].inner_html : (st.parent/'string')[5].inner_html)
      end

      # Look through each time entry for each timeslip.
      (st/'dict').each do |sz|
        @time_uuid = (sz/'string')[1].inner_html
        @time_start = (sz/'date')[2].inner_html
        @time_end = (sz/'date')[1].inner_html
        @time_duration = (Time.parse(@time_end) - Time.parse(@time_start)) / 3600 

        begin
          db = Mysql.real_connect("localhost", "username", "password", "dbname")
          sth = db.prepare(
                            "INSERT INTO timeslips
                              (uuid, begin, end, title, duration, worker, description, category)
                            VALUES
                              (?,?,?,?,?,?,?,?)
                            ON DUPLICATE KEY UPDATE
                              count=count + 1, begin=?, end=?, title=?, duration=?, worker=?, description=?, category=?"
                            )
          sth.execute(@time_uuid, @time_start, @time_end, @billing_description, @time_duration, @billing_worker, @billing_comment, @billing_category, @time_start, @time_end, @billing_description, @time_duration, @billing_worker, @billing_comment, @billing_category)

        # puts "Number of rows inserted: #{db.affected_rows}"
        rescue Mysql::Error => e
          puts "Error code: #{e.errno}"
          puts "Error message: #{e.error}"
          puts "Error SQLSTATE: #{e.sqlstate}" if e.respond_to?("sqlstate")

        ensure
          db.close if db
        end
      end # Ends (st/'dict').each
    end # Ends (sm/'array').each
  end # Ends (sx/'dict array dict').each
end # (doc/'plist').each
28
Jun
10

Uninitialized constant MysqlCompat::MysqlRes when running rake tasks in Rails.

Having just recently upgraded my Rails install to 2.3.8 from 2.0.something, I started to set up a redmine site when I ran into the following error when trying to run the rake task:

rake db:migrate

This was frustrating!

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.rake aborted!dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): no suitable image found. Did find:/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: mach-o, but wrong architecture - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

Looks like I was going to have to dig around and see what was broken. The message told me that the gem for MySQL connectivity was not bundled anymore in Rails so I was going to have to install it on my own.

I issued:

sudo gem install mysql

and it looked like it was installed correctly but when I tried to run the rake task again I got the same error along with a whole string of errors for missing documentation in rDoc (which I could care less about but if you are reading this you an flag for no rDoc on the gem install so don’t let a bunch of errors freak you out)

I decided to uninstall the gem and install again – and for those of you asking, I use sudo so that these all end up in the /Library, not the ~Library

sudo gem uninstall mysqlSelect gem to uninstall: 1. mysql-2.7 2. mysql-2.8.1 3. All versions

I selected 3 and uninstalled all the MySQL gems from my whole system.

The problem here isn’t that Rails or MySQL is broken, it’s that Rails can’t talk to MySQL because the gem can be needing different configurations for different architectures. I also stumbled through a MySQL install which upgraded me from MySQL 5.1.42 to 5.1.48 that I didn’t need and also tried this: (with the flags for no docs so I don’t get all the command line errors.

sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config

But I was still getting the abort errors on the rake task. That was until I stumbled across this post:

Basically this shows how to install the mysql gem with environment and architecture specific flags. I ran through the gem uninstall and then reinstalled it again with:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Once this was done I attempted to run the rake task again and was rewarded with the full redmine install of all MySQL databases, and a minute later had my redmine install up and running.

24
Jun
10

CodeIgniter and switch from Subversion to Mercurial

Recently CodeIgniter, a product form Ellis Labs, switched their version control system from subverison to mercurial. After reading several forums where users were finding this out a little late and were disappointed about it I decided to investigate further. What I found surprised me.

As I mentioned in the my talks on version control at the Lasso Developers conference, there’s a major divide in the version control world, viz. centralized vs. decentralized version control systems. Subversion, perforce, cvs etc are all centralized version control systems, while git and hg (mercurial) are distributed. Check this link for more info.

Previous to the move, many users of CodeIgniter used svn externals to link to the latest CodeIgniter build across many of their websites. When Ellis Labs switched to Mercurial they didn’t realize that many users had linked to their libraries this way. In fact, it broke a lot on installations and many users setups for their sites when they went to update them again.

There’s a forum thread over at the CodeIgniter website about the switch and you can see why a lot of people aren’t happy. Basically, mercurial doesn’t support externals at all. This is pretty sucky. Maybe I’ll put CodeIgniter under version control at github so that instead of having to download the zip files all the time now that I can just use git submodules instead.




Tweets

del.icio.us motion


Follow

Get every new post delivered to your Inbox.