he4rt / scylladb-php-driver

PHP Driver for ScyllaDB/Apache Cassandra
Other
103 stars 25 forks source link

Some observed sluggishness during benchmarks #95

Open LocalHostzero opened 6 months ago

LocalHostzero commented 6 months ago

Hi,

I recently started playing with this driver. In some simple benchmarks, I'm noticing things are taking longer than what I expect.

For example:

<?php
$start = microtime(true);
$cluster   = Cassandra::cluster()->withContactPoints('127.0.0.1')->withPort(9042)->build();
$keyspace  = 'ipaddr';
$session   = $cluster->connect($keyspace);

$end = microtime(true);
$diff = $end - $start;
echo "$diff\n";

?>

returns values between 0.055 to 0.060, which is 50+ms just to create object for a connection to localhost. Some simple SELECT statements using prepare() and execute() are taking a long time as well. About 250 SELECT requests take somewhere between 80 to 100ms on localhost.

These tests are performed on bare metal hardware with a a fresh Debian install. ScyllaDB itself performs fairly decent if cqlsh is used. For example, the copy command to export and import are fairly fast. However, interfacing with ScyllaDB with PHP feels a lot more sluggish.

I'm looking for some guidance on these performance metrics and if they're expected or not. If this community can provide any insight or direction, please let me know.

Thanks.

CodeLieutenant commented 6 months ago

I'll do some benchmarks this weekend, and come back with results, and see what I can do.

Thanks for the report