Forum: Building VoltDB Clients

Post: VoltDB PHP client exception & benchmark

VoltDB PHP client exception & benchmark
rbetts
Feb 5, 2010
Sumit,
There appears to be an error in the example script. Instead of setting maxContestants to 0, simply delete the assignment of maxContestants at voter.php line 142.
I ran this on my desktop (a quad core i7) vs. a local running instance of the voter example database:
rbetts@rbetts-desktop:examples$ php5 ./voter.php 1000 10000 100 500 10 120 1 localhost
Allowing 1000 votes per phone number
Allowing between 100 and 500 oustanding SP calls at a time
Submitting 10,000 SP Calls/sec
Feedback interval = 10 second(s)
Running for 120 second(s)
Latency not recorded for 1 second(s)
Connecting to server: 'localhost'
Running for 12 contestant(s)
8.334% Complete | SP Calls: 121,050 at 12,104.38 SP/sec | outstanding = 10 (10) | min = 0 | max = 5 | avg = 0.00
16.667% Complete | SP Calls: 242,946 at 12,146.99 SP/sec | outstanding = 16 (6) | min = 0 | max = 5 | avg = 0.00
25.001% Complete | SP Calls: 367,090 at 12,235.96 SP/sec | outstanding = 10 (-6) | min = 0 | max = 5 | avg = 0.00
33.335% Complete | SP Calls: 489,910 at 12,247.27 SP/sec | outstanding = 10 (0) | min = 0 | max = 5 | avg = 0.00
41.668% Complete | SP Calls: 612,322 at 12,246.05 SP/sec | outstanding = 12 (2) | min = 0 | max = 5 | avg = 0.00
50.002% Complete | SP Calls: 740,240 at 12,336.96 SP/sec | outstanding = 10 (-2) | min = 0 | max = 6 | avg = 0.00
58.335% Complete | SP Calls: 864,890 at 12,355.21 SP/sec | outstanding = 20 (10) | min = 0 | max = 6 | avg = 0.00
And checked that real inserts were happening after the run completed:
1> select count(*) from votes;
C1
--------
1469418
Let me know if you want me to email you modified voter.php. I'll file an issue to repackage the fixed example.
Thanks,
Ryan.
VoltDB PHP client exception & benchmark
sumitk1
Feb 2, 2012
Hi,
I am running the Voter example with the PHP client and got some issues. At first when I run the php-client I am getting an Uncaught Exception:
Resource id #17PHP Fatal error: Uncaught exception 'InvalidColumnException' with message 'Attempted to retrieve a column with an invalid index or name, or an invalid type for the specified column' in /<path>/voltdb-client-php-linux-x86_64-1.3.6.1/include/voltdb.php:2385
Stack trace:
#0 /<path>/voltdb-client-php-linux-x86_64-1.3.6.1/include/voltdb.php(2385): row_getint32(Resource id #17, 0)
#1 /<path>/voltdb-client-php-linux-x86_64-1.3.6.1/examples/voter.php(142): Row->getInt32(0)
#2 {main}
thrown in /<path>/voltdb-client-php-linux-x86_64-1.3.6.1/include/voltdb.php on line 2385
So then I put a try-catch for the line 142(voter.php)
$maxContestants = $row->getInt32(0);
it solves the above problem and I am able to run the test. But then I get a warning
PHP Warning: Division by zero in /<path>/voltdb-client-php-linux-x86_64-1.3.6.1/examples/voter.php on line 303
Also I am not getting the same through put when using the PHP client as compared to the Java async client. I am getting around 2.5k TPS with PHP where as with Java client I am getting more than 25k TPS. Although when I run multiple PHP clients I get a linear increase in the TPS.
Is there something that I need to configure on my machine for PHP client? Since both benchmark are run on the same machine I was wondering if PHP is slow or is Java doing it multi-threaded? I am running the "async-benchmark" for java client.
Thanks
Sumit
PHP Client throughput
sumitk1
Feb 3, 2012
Sumit,
There appears to be an error in the example script. Instead of setting maxContestants to 0, simply delete the assignment of maxContestants at voter.php line 142.
I ran this on my desktop (a quad core i7) vs. a local running instance of the voter example database:
rbetts@rbetts-desktop:examples$ php5 ./voter.php 1000 10000 100 500 10 120 1 localhost
Allowing 1000 votes per phone number
Allowing between 100 and 500 oustanding SP calls at a time
Submitting 10,000 SP Calls/sec
Feedback interval = 10 second(s)
Running for 120 second(s)
Latency not recorded for 1 second(s)
Connecting to server: 'localhost'
Running for 12 contestant(s)
8.334% Complete | SP Calls: 121,050 at 12,104.38 SP/sec | outstanding = 10 (10) | min = 0 | max = 5 | avg = 0.00
16.667% Complete | SP Calls: 242,946 at 12,146.99 SP/sec | outstanding = 16 (6) | min = 0 | max = 5 | avg = 0.00
25.001% Complete | SP Calls: 367,090 at 12,235.96 SP/sec | outstanding = 10 (-6) | min = 0 | max = 5 | avg = 0.00
33.335% Complete | SP Calls: 489,910 at 12,247.27 SP/sec | outstanding = 10 (0) | min = 0 | max = 5 | avg = 0.00
41.668% Complete | SP Calls: 612,322 at 12,246.05 SP/sec | outstanding = 12 (2) | min = 0 | max = 5 | avg = 0.00
50.002% Complete | SP Calls: 740,240 at 12,336.96 SP/sec | outstanding = 10 (-2) | min = 0 | max = 6 | avg = 0.00
58.335% Complete | SP Calls: 864,890 at 12,355.21 SP/sec | outstanding = 20 (10) | min = 0 | max = 6 | avg = 0.00
And checked that real inserts were happening after the run completed:
1> select count(*) from votes;
C1
--------
1469418
Let me know if you want me to email you modified voter.php. I'll file an issue to repackage the fixed example.
Thanks,
Ryan.


Hi Ryan,
I did comment that line out and tried running the example but I am still getting 2.5k TPS with PHP client. For the Java its always around 27-31k TPS.
My server and client are on the same machine x86_64 CentOS-5, Single socket 4 cores.
Can you explain this?
Thanks
Sumit
re: 2.5k tps
rbetts
Feb 6, 2012
Hi Ryan,
I did comment that line out and tried running the example but I am still getting 2.5k TPS with PHP client. For the Java its always around 27-31k TPS.
My server and client are on the same machine x86_64 CentOS-5, Single socket 4 cores.
Can you explain this?
Thanks
Sumit


Did you use the same command line parameters I used above?
2.5k TPS
sumitk1
Feb 6, 2012
Did you use the same command line parameters I used above?


I used the following two commands:
php voter.php 3 40000 100 400 5 120 2 localhost
php voter.php 1000 10000 100 500 10 120 1 localhost
But both of them gave me the same 2.5k TPS. Where as when I ran the Java client it gave me 27-31k TPS.
I am pretty sure there would be some configuration that will make the PHP client take that much because I am running the async-benchmark for the java client.