background preloader

Apache

Facebook Twitter

Howto: Performance Benchmarks a Webserver. You can benchmark Apache, IIS and other web server with apache benchmarking tool called ab. Recently I was asked to performance benchmarks for different web servers. It is true that benchmarking a web server is not an easy task. From how to benchmark a web server: First, benchmarking a web server is not an easy thing. What is important is the average time it will take when you have a maximum number of users on your site simultaneously. Here are few tips to carry out procedure along with an example: Apache Benchmark Procedures You need to use same hardware configuration and kernel (OS) for all testsYou need to use same network configuration.

Webserver Benchmark Examples: Let us see how to benchmark a Apache 2.2 and lighttpd 1.4.xx web server. Static Non-KeepAlive test for Apache web server i) Note down server load using uptime command $ uptime ii) Create a static (small) html page as follows (snkpage.html) (assuming that server IP is 202.54.200.1) in /var/www/html (or use your own webroot): <! #! Ab - Apache HTTP server benchmarking tool. Ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.

Synopsis ab [ -A : ] [ -b ] [ -B ] [ -c ] [ -C = ] [ -d ] [ -e ] [ -E ] [ -f ] [ -g ] [ -h ] [ -H ] [ -i ] [ -k ] [ -l ] [ -m ] [ -n ] [ -p ] [ -P : ] [ -q ] [ -r ] [ -s ] [ -S ] [ -t ] [ -T ] [ -u ] [ -v ] [ -V ] [ -w ] [ -x ] [ -X [:] ] [ -y ] [ -z ] [ -Z ] [http[s]://][:]/ Options Supply BASIC Authentication credentials to the server. -b Size of TCP send/receive buffer, in bytes. Address to bind to when making outgoing connections. -c Number of multiple requests to perform at a time. Add a Cookie: line to the request. -d Do not display the "percentage served within XX [ms] table". -e When connecting to an SSL website, use the provided client certificate in PEM format to authenticate with the server.

-f -g -h -i -k -l -m -n -p. Using mpm-itk To Secure A Shared Serve. The challenge with securing a shared hosting server is how to secure the website from attack both from the outside and from the inside. PHP has built-in features to help, but ultimately it s the wrong place to address the problem. Apache has built-in features too, but the performance cost of these features is prohibitive. This has created a gap that a number of third-party solutions have attempted to fill. One solution you may have heard of is mpm-itk, by Steinar H. Gunderson. How well does it work, and how well does it perform? Mpm-itk: Running Apache As A Specified UserInstalling mpm-itkConfiguring ApacheSome BenchmarksOther ConsiderationsConclusions mpm-itk: Running Apache As A Specified User Like mpm-peruser, mpm-itk is an alternative multi-processing module (MPM) for Apache 2.x. Until I researched mpm-itk for this article, I didn’t realise that it didn’t recycle processes after each request.

Installing mpm-itk mpm-itk needs to be compiled into your Apache installation. . $ . Conclusions. m1tk4 » Apache2 MPM-itk on RHEL/CentOS. When you have to host several web applications on the same server, with each new one you probably feel less and less comfortable with all of them running as apache or nobody. This problem gets even bigger when some of your applications need to be able to write files to locations where they can later be executed by a http call, or even to be able to rewrite the application’s executable files themselves (to update, upgrade or install various “plugins”, for example). suEXEC and What’s Wrong With It The traditional solution to this problem was a small utility called suEXEC that ships with Apache. Here is how suEXEC works: In its design, suEXEC favors security over flexibility, and that’s why it has several important shortcomings: The privilege change (setuid) is only done when CGI’s are executed.

SuPHP and What’s Wrong With It Since PHP was mentioned several times already, here is another tool for isolating PHP applicaitons from each other: suPHP. Perchild and Metux ITK MPM module Perfect! Installing Apache2 With PHP5 And MySQL Support On CentOS 5.3 (LA. Version 1.0 Author: Falko Timme <ft [at] falkotimme [dot] com> Follow me on Twitter Last edited 07/24/2009 LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 5.3 server with PHP5 support (mod_php) and MySQL support.

I do not issue any guarantee that this will work for you! 1 Preliminary Note In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100. These settings might differ for you, so you have to replace them where appropriate. 2 Installing MySQL 5.0 To install MySQL, we do this: yum install mysql mysql-server Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server: chkconfig --levels 235 mysqld on /etc/init.d/mysqld start Run mysqladmin -u root password yourrootsqlpassword mysqladmin -h server1.example.com -u root password yourrootsqlpassword 3 Installing Apache2 yum install httpd chkconfig --levels 235 httpd on.