doc:scratchpad:benchmark

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:scratchpad:benchmark [2009/07/01 22:36] – prettyfied hjalledoc:scratchpad:benchmark [2009/08/18 09:21] – added available files hjalle
Line 79: Line 79:
 --------------- bench.php End Comparison ----------- --------------- bench.php End Comparison -----------
 </code> </code>
 +
 +===== PHP Web-app benchmark =====
 +
 +The web application benchmark works by deploying three virtual machines using XEN. The machines that are deployed are:
 +
 +Web server with apache and php5 with mysql (in future it will be possible to switch version and compile from scratch).
 +
 +Client server with php5-cli with curl. This serves as the machine which makes the requests for the server.
 +
 +Database server with mysql-server. This server is used by the web server.
 +====Requirements====
 +To be able to run the web applications benchmark, you will have to have a xen environment working along with xen-tools. Xen-tools is used to create and deploy the virtual machines and set up the network connection along with their roles. Their roles are specified in individual files, which can be found in /benchweb/roles/.
 +
 +
 +====Deployment====
 +To be able to deploy the virtual machines, there are a couple of things that needs to be known.
 +Currently, the config.php file contains information that need to be modified in order to get the network settings to work. In this file, you will have to modify the gateway, netmask and the $HOME_DIR to the directory where the deployment files are, such as config.php and deploy.php.
 +
 +After those settings have been configured, you can call deploy.php with your starting IP. The IP's will take a range of 3, which means that it will need 3 IP adresses in a row to work. This call:
 +<code>
 +./deploy 192.168.0.150
 +</code>
 +Will setup the webserver at 192.168.0.150, the client at 192.168.0.151 and the database server at 192.168.0.152.
 +The creation of these servers take a while because of its nature. It downloads the packages needed and will, when created, boot the images and when they appear to be running, the script will execute some commands that set up their environments. The speed of the installation is very dependent on the speed of your internet connection. This is the setup.php script that is called and it will change some configuration-files and make some adjustments to the system to make it ready for benchmarking.
 +
 +
 +When the deploy.php script has finished, the servers are ready for installing the web applications (currently only phpBB).
 +
 +==Available files==
 +  * config.php 
 +Configuration before the deployment of the virtual machines
 +  * deploy.php START-IP
 +Deployment script that deploys the three virtual machines to START-IP, START-IP + 1 and START-IP + 2.
 +  * functions.php
 +Functions used for the deployment and upload/execution of commands.
 +  * installers/
 +This is were the applications are stored
 +  * machines/
 +This is were machine-specific files are stored, such as configuration-files and such.
 +  * roles/
 +Here are the role-files places (files that choose which packages that are installed after the deployment)
 +  * setup.php
 +This is a file that's included when all the servers has booted up in the deployment script and this performs configurations and additional setups.
 +  * shutdown.php
 +This shutdowns (destroys) the virtual machines and removes the created files (ips.txt which contains the IP-adresses of the VM's) and the known_hosts file that is created when ssh and scp commands are executed.
 +
 +===phpBB3 benchmark===
 +To install and setup phpBB3 for benchmarking you can change directory to "installers/phpbb/". The setup file in this directory will download phpBB 3.0.5 and deploy it and setup a slightly modified version of it that enables benchmarking (allows faster postings) along with a database that is setup with some categories. The setup file will also move the bench-directory to the client, which will serve as the files that are used when benchmarking phpBB3.
 +
 +To execute a benchmark and get the value of requests per second, you simply do:
 +<code>
 +php setup.php
 +php benchmark.php Number_of_user_scenarios concurrency
 +</code>
 +Where Number_of_user_scenarios are a number of record of requests that will be made. A scenario when a user registers can be described like this:
 +<code>
 +User requests the register-page.
 +User accepts the terms.
 +User fills in the information and posts the data.
 +</code>
 +This scenario is made up of three requests but will only count as one scenario. It's basically the same for creating a thread, posting a reply and viewing a thread.
 +
 +If you want to configure the size of posts or frequency of creating threads, registering or such you can find the configuration file inside of the /installers/phpbb/bench/config.php file. This file has to be modified before you run the setup.php file, since it is uploaded to the server during this call.
 +
 +
 +===Runtime modification===
 +It is fully possible to ssh to the virtual machines and modify files, configurations or anything just like a normal server.
doc/scratchpad/benchmark.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1