Skip to content

Instantly share code, notes, and snippets.

@misterion
Created December 16, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterion/85c5d6cb32e4ddd487ce to your computer and use it in GitHub Desktop.
Save misterion/85c5d6cb32e4ddd487ce to your computer and use it in GitHub Desktop.
Test freetds connection speed
<?php
$ip = '192.168.1.17';
$port = 5000;
$dbname = 'users';
$user = 'sa';
$password = 'sa';
$totalCount = 1000;
$t = microtime(true);
for ($i = 0; $i < $totalCount; $i++) {
$link = new PDO("dblib:host=$ip:$port;dbname=$dbname", $user, $password);
}
echo 'Time per connection is' . (microtime(true) - $t) / $totalCount . 'ms';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment