tpcc-mysql rough benchmark for Amazon RDS

I tried to do tpcc-mysql benchmark for Amazon RDS. Before do that, did the same test for EC2 small instance.

From EC2 small instance to small. Fedora8 and MySQL 5.0.45. Default configuration. (no change for a my.cnf; innodb_buffer_pool_size = 8388608)

# mysql -h domU-12-31-39-06-7C-86.compute-1.internal -u mymasteruser -p
mysql> grant all privileges on tpcc.* to tpcc@'%' identified by 'hogehoge';
mysql> create database tpcc;
# mysql -u tpcc -p -h domU-12-31-39-06-7C-86.compute-1.internal tpcc < create_table.sql
# mysql -u tpcc -p -h domU-12-31-39-06-7C-86.compute-1.internal tpcc < add_fkey_idx.sql
# ./tpcc_load domU-12-31-39-06-7C-86.compute-1.internal tpcc tpcc hogehoge 10
# ./tpcc_start domU-12-31-39-06-7C-86.compute-1.internal tpcc tpcc hogehoge 10 3 60 60
527.000 TpmC
# ./tpcc_start domU-12-31-39-06-7C-86.compute-1.internal tpcc tpcc hogehoge 10 6 60 180
560.667 TpmC

Changed to innodb_buffer_pool_size = 1336934400. (same as RDS small instance) Drop database, and restore. Then,

# ./tpcc_start domU-12-31-39-06-7C-86.compute-1.internal tpcc tpcc hogehoge 10 6 60 180
2358.667 TpmC

From EC2 small instance to RDS small instance. (MySQL 5.1.38)

# ./tpcc_load myinstance.cpxpgflqvl3w.us-east-1.rds.amazonaws.com tpcc tpcc hogehoge 10

There will be an error "server phrase is too long". Use IP address.

# ./tpcc_start 10.210.155.149 tpcc tpcc hogehoge 10 6 60 180
2437.000 TpmC

This is a pretty rough benchmark, but I can say EC2 small instance and RDS small instance have the same performances as CPU and memory are the same spec. RDS is about 30% expensive. (EC2=$0.085, RDS=$0.11/h)

ref) tpcc-mysqlによるMySQLのベンチマーク

Posted in Tweak | Tagged , | 1 Comment

Amazon RDS quick start

I’ve tried to use Amazon Relational Database Service. Easy to scale-up appeals to me.

Official Getting Started Guide is very good. I almost followed this document.

Works on Mac OSX 10.5.8.

% rds-create-db-instance --db-instance-identifier myinstance  --allocated-storage 5 --db-instance-class db.m1.small --engine MySQL5.1 --master-username mymasteruser --master-user-password **** --db-name MyDatabase --headers

It takes several minutes.

% rds-describe-db-instances --headers
Unable to find a $JAVA_HOME at "/usr/", continuing with system-provided Java...
Unable to find a $JAVA_HOME at "/usr/", continuing with system-provided Java...
DBINSTANCE  DBInstanceId  Class        Engine    Storage  Master Username  Status    AZ          Backup Retention
DBINSTANCE  myinstance    db.m1.small  mysql5.1  5        mymasteruser     creating  us-east-1d  1
      SECGROUP  Name     Status
      SECGROUP  default  active
      PARAMGRP  Group Name        Apply Status      PARAMGRP  default.mysql5.1  in-sync
% rds-describe-db-instances --headers
Unable to find a $JAVA_HOME at "/usr/", continuing with system-provided Java...
Unable to find a $JAVA_HOME at "/usr/", continuing with system-provided Java...
DBINSTANCE  DBInstanceId  Created                   Class        Engine    Storage  Master Username  Status     Endpoint Address                                     Port  AZ          Backup Retention
DBINSTANCE  myinstance    2009-10-30T07:01:42.163Z  db.m1.small  mysql5.1  5        mymasteruser     available  myinstance.cpxpgflqvl3w.us-east-1.rds.amazonaws.com  3306  us-east-1d  1
      SECGROUP  Name     Status
      SECGROUP  default  active
      PARAMGRP  Group Name        Apply Status
      PARAMGRP  default.mysql5.1  in-sync

There is an error about $JAVA_HOME, but it works.

% rds-authorize-db-security-group-ingress default --ec2-security-group-name mytestgroup --ec2-security-group-owner-id 69145810****

You can see ec2-security-group-name (Security Groups) and ec2-security-group-owner-id (Owner) on AWS Management Console for EC2.

Login to EC2 server, then:

# mysql -h myinstance.cpxpgflqvl3w.us-east-1.rds.amazonaws.com -P 3306 -u mymasteruser -p

Create snapshot, and delete.

% rds-create-db-snapshot myinstance --db-snapshot-identifier myinstance-snapshot
% rds-delete-db-instance myinstance --skip-final-snapshot true --headers

It takes a couple of minutes.

Restore.

% rds-restore-db-instance-from-db-snapshot myinstance2 --db-snapshot-identifier myinstance-snapshot

Modify instance size (scale-up).

% rds-modify-db-instance myinstance --db-instance-class db.m1.large --apply-immediately

small to large takes about 5 minutes. (mysqldumped-size is 700MB)

similar post:
tpcc-mysql rough benchmark for Amazon RDS

Posted in Tweak | Tagged | Leave a comment

rackspacecloud.com’s Cloud Files network benchmark

I got a rough benchmark.
Main purpose is to know how Cloud Files(rackspacecloud.com) is fast from Tokyo, Japan. Also I compared the speed with Amazon EC2/CloudFront and Sakura Internet 7,800yen dedicated hosting service.

% ab -n 50 -c 5 http://server/image-file(jpg/png/gif)
Transfer rate (Kbytes/sec):

1527 (www.google.com)
1245 (s3.amazonaws.com)
3796 (cloudfront.net)
45 (sakura internet 7800yen server)
2135 (cdn.cloudfiles.rackspacecloud.com)
42 (rackspacecloud cloud server mem 256M)

@San Jose, CA (3.2Mb/s by speedtest.net)

1558 (www.google.com)
381 (s3.amazonaws.com)
3753 (cloudfront.net)
304 (sakura internet 7800yen server)
2058 (cdn.cloudfiles.rackspacecloud.com)

@Tokyo, Japan (35.4Mb/s by speedtest.net)

Cloud File is pretty good. Indeed, Cloud Servers plan is good at low-end scale-up. Never change its IP to resize 256M memory to 512M. There is a down time like a couple of minutes. Unfortunately, DirectoryIndex (like index.html) doesn’t work on Cloud Files just like S3/CloudFront.

ref) AmazonS3上のファイルを国内でも高速配信可能なAmazon CloudFrontリリース — Media Technology Labs

Posted in Tweak | Leave a comment

Using MAMP is better than source compile PHP on Mac OS 10.5.8

PHP5.2.10 couldn’t be compiled on Mac OS 10.5.8.

% ./configure --with-readline --with-mysql --with-pdo-mysql --enable-mbstring --with-openssl --with-curl --with-apxs2=/usr/local/apache2/bin/apxs
% make
Undefined symbols:
  "_EVP_CIPHER_CTX_block_size", referenced from:
      _zif_openssl_seal in openssl.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

I tried to compile openssl0.9.8j, then set –with-openssl=/usr/local/ssl, but the same error occurred.

–with-openssl=shared works fine. However, openssl.so doesn’t work.

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'openssl.so'  in Unknown on line 0

PHP5.1.6 & ./configure –with-openssl=shared –without-iconv & openssl.so works well.

In short, MAMP1.7.2(PHP5.2.6 with openssl) is much easier than compiling from source code.

UPDATE:
MAMP1.8 includes PHP5.2.10 + openssl.

Posted in Tweak | Leave a comment

screencapture + ftp upload in AppleScript

set this_file to "/tmp/com.zuzara.desktop.png"
set ftp_host to "***"
set ftp_user to "***"
set ftp_password to "***"
set ftp_path to "/***"
set ftp_newfile to do shell script "date '+%Y%m%d%H%M.png'"
 
try
        do shell script "screencapture " & quoted form of POSIX path of this_file
        tell application "Image Events"
                launch
                set this_image to open this_file
                scale this_image to size 100 -- resize to 100px width
                save this_image with icon
                close this_image
        end tell
        tell application "Preview"
                try
                        open this_file
                        set question to display dialog "Will upload this picture!"
                        set answer to button returned of question
                        if answer is equal to "OK" then
                                -- FTP upload
                                do shell script "curl -T " & this_file & " ftp://" & ftp_user & ":" & ftp_password & "@" & ftp_host & ftp_path & ftp_newfile
                                quit -- close window 1 doesn't work...
                        end if
                on error
                        quit -- Cancel
                end try
        end tell
end try

Take a screenshot, resize it and upload it.

cron/crontab doesn’t work for this AppleScript. This error message appears in /var/log/system.log:
com.apple.launchd[1] (0x10b490.cron[9481]): Could not se
tup Mach task special port 9: (os/kern) no access

Instead of cron, we can use launchd. GUI controller is Lingon.

My hourly desktop is here.

Mac OS 10.5.8

Posted in Create | Tagged , | Leave a comment

screencapture doesn’t work on GNU screen

While using screen screencapture command doesn’t work well. It creates only a black image file.

% screen
% screencapture ~/Desktop/desktop.png // it doesn't work
% exit
% screencapture ~/Desktop/desktop.png // it works!

Mac OS 10.5.7

Posted in Uncategorized | Leave a comment

SweetCatcher for Skype First Release

SweetCatcher

SweetCatcher is an application that shows you your important person’s Skype status in your menu bar, so you can see her/his status (online or offline) anytime without having to open a contact list.

Download: SweetCatcher_v20090630.dmg
md5 checksum: 7bc5420c4c034b0a2317f9a21baca62d

Requirements:

  • Mac OS 10.5+
  • Skype 2.7+

Thanks Icon Drawer for using a cute icon.

Don’t waste any time calling to your sweet!

Posted in Create | Tagged , , | 7 Comments

Skype4Sweet First Release

Oops, I needed to change the name: SweetCatcher

According to Skype API Terms of Use (http://www.skype.com/legal/terms/api/) § 4.1 using the word “Skype” in product’s name is not allowed. The following names would be OK:

  • “works with Skype”
  • “uses Skype Software” or “uses Skype”
  • “for Skype Software” or “for Skype”
Posted in Create | Leave a comment

Back up Gmail Starred with fetchmail and procmail

% fetchmail --all --proto IMAP --port 993 --user *your gmail account name* --ssl --folder '[Gmail]/Starred' --mda "/usr/bin/procmail -d %T" --keep imap.gmail.com

You can get mails at /var/mail/*your mac account name*.
On Mac OSX 10.5.5.

Posted in Tweak | Tagged | Leave a comment

Additional information: How to build a Firefox extension


Mozilla pins (wallpaper) on Flickr – Photo Sharing!

This entry inspired me.
How to build a Firefox extension (lifehacker.com)

I use Mac OSX 10.5 and Firefox 3.0.5.

Set up your development environment

ref:
https://developer.mozilla.org/en/Setting_up_extension_development_environment

Small script for starting firefox.
% cat ~/bin/firefox-debug.sh
#!/bin/sh
/Applications/Firefox.app/Contents/MacOS/firefox-bin -no-remote -P dev

I created a new profile “dev” for development.

I mainly use 2 add-ons.

Event Spy catch the events like “click”, “mousedown” etc.

Debugging

ref:
https://developer.mozilla.org/en/Extension_Frequently_Asked_Questions

Use dump(); for simple print debug.

Browser layout overview

If you want to hook and change default event, you should learn about browser layout. browser.js, browser.xul may help you. These files are in /Applications/Firefox.app/Contents/MacOS/chrome/browser.jar
% unzip browser.jar
Or you can find in the firefox source:
% tar jxvf firefox-3.0.5-source.tar.bz2
% find . -name browser.js
./browser/base/content/browser.js

Firefox toolbar and some default buttons are made by browser.xul. Some events and functions defined at browser.js.

XUL tips

<menupopupset> needs <popupset>. Use document.loadOverlay for <popupset>. It doesn’t work with document.createElement().

Release candidate

% zip -r ~/your-add-on.xpi . -x "*.svn*"

If you submit your add-on then its status turns in sandbox. A few days later your add-on will appear Newest Add-ons. (you must log in and check “show experimental add-ons”)

Posted in Tweak | Tagged , | Leave a comment
  • About

    I'm Nobu, a web developer living in Mountain View, CA. Feel free to comment on any posts. I'm also tweeting on twitter.

  • Archives

  • Recent Posts