php-sqlsrv/test/Performance/README.md

50 lines
3.6 KiB
Markdown
Raw Normal View History

2017-06-03 01:02:34 +02:00
## Setup Environment on a clean machine
2017-06-03 00:53:22 +02:00
2017-08-22 18:41:56 +02:00
The PHP zip file can be downloaded from <http://php.net/downloads.php>.
The SQLSRV and PDO_SQLSRV driver binaries can be downloaded from <https://github.com/Microsoft/msphpsql/releases>.
2017-06-03 00:53:22 +02:00
### Windows
2017-08-22 18:41:56 +02:00
Install Visual Studio 2015 redistributable before running the following commands.
Run `Windows PowerShell` as administrator.
2017-06-03 00:53:22 +02:00
Set-ExecutionPolicy Unrestricted
2017-08-22 18:41:56 +02:00
.\setup_env_windows.ps1 <absolute path to the PHP zip file> <absolute path to the SQLSRV driver DLL> <absolute path to the PDO_SQLSRV driver DLL>
2017-06-03 00:53:22 +02:00
### Ubuntu 16
2017-08-22 18:41:56 +02:00
sudo env "PATH=$PATH" bash setup_env_unix.sh Ubuntu16 <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
2017-06-03 00:53:22 +02:00
### RedHat 7
2017-08-22 18:41:56 +02:00
sudo env "PATH=$PATH" bash setup_env_unix.sh RedHat7 <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
### MacOS 10.12 Sierra
2017-06-03 00:53:22 +02:00
`brew` cannot be run with `sudo` on Sierra. Either enable passwordless `sudo` on the machine or enter the password when prompted.
2017-08-22 18:41:56 +02:00
bash setup_env_unix.sh Sierra <PHP_VERSION - 7.x.y> <PHP_THREAD - ts or nts> <absolute path to the SQLSRV driver so> <absolute path to the PDO_SQLSRV driver so>
## Run benchmarks
PHPBench is used to run the benchmarks. Visit http://phpbench.readthedocs.io/en/latest/introduction.html to have an idea how the tool works.
2017-08-22 18:41:56 +02:00
##### 1. Modify lib/connect.php with the test database credentials
##### 2. Modify lib/result_db.php with the result database credentials
##### 3. The number of iterations for each test can be modified in the test itself (e.g., in test/Performance/benchmark/sqlsrv). Each test has a @Iteration(n) annotation. If you change the number in this annotation, you will change the number of iterations run for this test. By default, most tests are set to 1000 iterations.
##### 4. Execute run-perf_tests.py.
2017-07-14 20:05:23 +02:00
### Windows
2017-08-10 20:02:49 +02:00
py.exe run-perf_tests.py -platform <PLATFORM> > tee run-perf_output.txt
2017-07-14 20:05:23 +02:00
### Linux and Mac
On Linux and Mac, the script must be executed with `sudo python3` because to enable pooling it needs to modify odbcinst.ini system file. As an improvement, the location of the odbcinst.ini file can be changed so that, sudo is not requiered.
2017-08-10 20:02:49 +02:00
python3 run-perf_tests.py -platform <PLATFORM> | tee run-perf_output.txt
2017-08-22 18:41:56 +02:00
<<<<<<< HEAD
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra.
`-php-driver` (optional) - The driver that the tests are ran on. Must be one of the following: sqlsrv, pdo_sqlsrv, or both. Default is both.
2017-08-22 18:41:56 +02:00
`-test-only` (optional) - The test to run. Must be the file name (not including path) of one test or 'all'. Default is 'all'. If one test is specified, must also specify the -php-driver option to sqlsrv or pdo_sqlsrv.
=======
`-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016, WindowsServer2012, Ubuntu16, RedHat7, Sierra.
`-iterations` - The number of iterations for regular tests.
`-iterations-large` - The number of iterations for the tests that fetch large data. Usually set to 1.
`-result-server` - The server containing the result database. It is assumed that the result database s already setup before running the tests.
`-result-db` - Database name. With the current result database setup files, this should be set to `TestResults`.
`-result-uid` - Result database username.
`-result-pwd` - Result database password.
>>>>>>> upstream/dev