ZoomVPS Mach 1 Benchmark

The following is the unixbench-5.1.3 benchmark that was ran on ZoomVPS’s Mach 1 package. The VPS is an openVZ vps with 256MB guaranteed RAM. The benchmark was ran on May 2, 2010.

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.2)

   System: drache: GNU/Linux
   OS: GNU/Linux -- 2.6.18-164.10.1.el5.028stab067.4 -- #1 SMP Thu Jan 14 21:23:12 MSK 2010
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (4788.1 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   07:27:05 up  2:34,  1 user,  load average: 0.16, 0.03, 0.01; runlevel 3

------------------------------------------------------------------------
Benchmark Run: Sun May 02 2010 07:27:05 - 07:55:16
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       12177645.2 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2433.8 MWIPS (9.0 s, 7 samples)
Execl Throughput                               3198.7 lps   (29.6 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        384130.5 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          107375.3 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        816834.9 KBps  (30.0 s, 2 samples)
Pipe Throughput                              743996.7 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 223588.3 lps   (10.0 s, 7 samples)
Process Creation                               8351.6 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   3848.9 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    524.7 lpm   (60.1 s, 2 samples)
System Call Overhead                         654402.7 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   12177645.2   1043.5
Double-Precision Whetstone                       55.0       2433.8    442.5
Execl Throughput                                 43.0       3198.7    743.9
File Copy 1024 bufsize 2000 maxblocks          3960.0     384130.5    970.0
File Copy 256 bufsize 500 maxblocks            1655.0     107375.3    648.8
File Copy 4096 bufsize 8000 maxblocks          5800.0     816834.9   1408.3
Pipe Throughput                               12440.0     743996.7    598.1
Pipe-based Context Switching                   4000.0     223588.3    559.0
Process Creation                                126.0       8351.6    662.8
Shell Scripts (1 concurrent)                     42.4       3848.9    907.8
Shell Scripts (8 concurrent)                      6.0        524.7    874.5
System Call Overhead                          15000.0     654402.7    436.3
                                                                   ========
System Benchmarks Index Score                                         731.2

Addendum: The following is the same benchmark but after being moved to a new server in Chicago.

   BYTE UNIX Benchmarks (Version 5.1.2)

   System: drache: GNU/Linux
   OS: GNU/Linux -- 2.6.18-164.11.1.el5.028stab068.3 -- #1 SMP Wed Feb 17 15:22:30 MSK 2010
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Xeon(R) CPU X3460 @ 2.80GHz (5600.2 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET, Intel virtualization
   10:26:44 up 2 days,  4:36,  1 user,  load average: 0.00, 0.00, 0.00; runlevel

------------------------------------------------------------------------
Benchmark Run: Mon Jul 19 2010 10:26:44 - 10:54:47
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       14183196.8 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2965.5 MWIPS (8.5 s, 7 samples)
Execl Throughput                               3907.2 lps   (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        547997.0 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          161897.9 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1266099.8 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1104574.6 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 292532.5 lps   (10.0 s, 7 samples)
Process Creation                              12154.9 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   4804.1 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    671.2 lpm   (60.0 s, 2 samples)
System Call Overhead                         941924.6 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   14183196.8   1215.4
Double-Precision Whetstone                       55.0       2965.5    539.2
Execl Throughput                                 43.0       3907.2    908.7
File Copy 1024 bufsize 2000 maxblocks          3960.0     547997.0   1383.8
File Copy 256 bufsize 500 maxblocks            1655.0     161897.9    978.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    1266099.8   2182.9
Pipe Throughput                               12440.0    1104574.6    887.9
Pipe-based Context Switching                   4000.0     292532.5    731.3
Process Creation                                126.0      12154.9    964.7
Shell Scripts (1 concurrent)                     42.4       4804.1   1133.0
Shell Scripts (8 concurrent)                      6.0        671.2   1118.7
System Call Overhead                          15000.0     941924.6    627.9
                                                                   ========
System Benchmarks Index Score                                         989.2

Steadcom VPS Benchmark

The following is the unixbench-5.1.3 benchmark that was ran on SteadCom’s VPS on April 4, 2010. The VPS is XEN based, with 768MB RAM.

I highly recommend SteadCom‘s service as the server I’m on is rock solid :)

   BYTE UNIX Benchmarks (Version 5.1.2)

   System: titan.steamr.com: GNU/Linux
   OS: GNU/Linux -- 2.6.18-164.6.1.el5xen -- #1 SMP Tue Nov 3 16:48:13 EST 2009
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (5989.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET, Intel virtualization
   CPU 1: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (5989.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET, Intel virtualization
   CPU 2: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (5989.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET, Intel virtualization
   CPU 3: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz (5989.7 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSCALL/SYSRET, Intel virtualization
   18:24:35 up 13 min,  1 user,  load average: 0.00, 0.05, 0.03; runlevel 3

------------------------------------------------------------------------
Benchmark Run: Sun Apr 04 2010 18:24:35 - 18:52:53
4 CPUs in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       13042327.4 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2669.4 MWIPS (9.9 s, 7 samples)
Execl Throughput                               1307.1 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        248291.5 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           69727.3 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        592833.4 KBps  (30.0 s, 2 samples)
Pipe Throughput                              390112.2 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  99829.1 lps   (10.0 s, 7 samples)
Process Creation                               3629.9 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   3368.4 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    786.1 lpm   (60.1 s, 2 samples)
System Call Overhead                         391664.3 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   13042327.4   1117.6
Double-Precision Whetstone                       55.0       2669.4    485.3
Execl Throughput                                 43.0       1307.1    304.0
File Copy 1024 bufsize 2000 maxblocks          3960.0     248291.5    627.0
File Copy 256 bufsize 500 maxblocks            1655.0      69727.3    421.3
File Copy 4096 bufsize 8000 maxblocks          5800.0     592833.4   1022.1
Pipe Throughput                               12440.0     390112.2    313.6
Pipe-based Context Switching                   4000.0      99829.1    249.6
Process Creation                                126.0       3629.9    288.1
Shell Scripts (1 concurrent)                     42.4       3368.4    794.4
Shell Scripts (8 concurrent)                      6.0        786.1   1310.1
System Call Overhead                          15000.0     391664.3    261.1
                                                                   ========
System Benchmarks Index Score                                         504.6

------------------------------------------------------------------------
Benchmark Run: Sun Apr 04 2010 18:52:53 - 19:21:37
4 CPUs in system; running 4 parallel copies of tests

Dhrystone 2 using register variables       49902512.7 lps   (10.2 s, 7 samples)
Double-Precision Whetstone                    10786.8 MWIPS (9.5 s, 7 samples)
Execl Throughput                               3069.3 lps   (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        134467.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           37855.2 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks        397348.9 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1513149.3 lps   (10.1 s, 7 samples)
Pipe-based Context Switching                 362776.5 lps   (10.1 s, 7 samples)
Process Creation                               5225.1 lps   (30.1 s, 2 samples)
Shell Scripts (1 concurrent)                   6223.9 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    903.1 lpm   (60.2 s, 2 samples)
System Call Overhead                        1323583.9 lps   (10.2 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   49902512.7   4276.1
Double-Precision Whetstone                       55.0      10786.8   1961.2
Execl Throughput                                 43.0       3069.3    713.8
File Copy 1024 bufsize 2000 maxblocks          3960.0     134467.2    339.6
File Copy 256 bufsize 500 maxblocks            1655.0      37855.2    228.7
File Copy 4096 bufsize 8000 maxblocks          5800.0     397348.9    685.1
Pipe Throughput                               12440.0    1513149.3   1216.4
Pipe-based Context Switching                   4000.0     362776.5    906.9
Process Creation                                126.0       5225.1    414.7
Shell Scripts (1 concurrent)                     42.4       6223.9   1467.9
Shell Scripts (8 concurrent)                      6.0        903.1   1505.2
System Call Overhead                          15000.0    1323583.9    882.4
                                                                   ========
System Benchmarks Index Score                                         900.4

Godaddy’s Retarded Rewrite Rules

The following .htaccess is required to get mod_rewrite to work as expected under godaddy:

# Options
Options -Multiviews
Options +FollowSymLinks

#Enable mod rewrite
RewriteEngine On

#the location of the root of your site
#if writing for subdirectories, you would enter /subdirectory
RewriteBase /

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#This last condition enables access to the images and css
#folders, and the robots.txt file
RewriteCond $1 !^(index\.php|images|robots\.txt|css)

RewriteRule ^(.*)$ index.php?/$1 [L]

(The above code was from a google search from someone using CI with the same issue)

vs. original:


<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

I don’t know why one works, not the other, and I really don’t care.

Kohana 3: Getting the insert_id after an INSERT query

Since the database library in Kohana 3 is so much different than in Kohana 2, to get the last insert id of a row, use the following code instead:


$insertTable = DB::query(Database::INSERT,
		"INSERT INTO table (x, y, z) " .
		"VALUES(@x, @y, @z)"
);
$insertTable->param('@x', $x);
$insertTable->param('@y', $y);
$insertTable->param('@z', $z);
$insertTableResult = $insertTable->execute();

$insert_id = $insertTableResult[0];

I’m not too sure what the other ways of doing it is, but this is the only way I found after looking at the code.

No thanks to kohana 3’s non-existent documentation.


Addendum: As Sicabol suggested, the code above can be simplified by using list() instead of manually creating and using a separate array. That is:


$insertTable = DB::query(Database::INSERT,
		"INSERT INTO table (x, y, z) " .
		"VALUES(@x, @y, @z)"
);
$insertTable->param('@x', $x);
$insertTable->param('@y', $y);
$insertTable->param('@z', $z);
list($insert_id, $total_rows_affected) = $insertTable->execute();

Kohana 3: Unable to find a route to match the URI

If you get Unable to find a route to match the URI: /some/uri/path/args on Kohana 3 when attempting to request a action with more than one paramter, you will need to update the code in /application/bootstrap.php:


Route::set('default', '(<controller>(/<action>(/<id>(/<overflow>))))', array('overflow' => '.*?'))
	->defaults(array(
		'controller' => 'home',
		'action'     => 'index',
	));

I don’t get why this wasn’t added by default, along with all the controller, helper, model, views directories in /application similar to Kohana 2. Compounded with the poor documentation, Kohana 3 really is starting to tick me off. The time saved by Kohana is wasted on these things.