June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

WordPress Quotes

Be Content with what you have; rejoice in the way things are. When you realize there is nothing lacking, the whole world belongs to you.
Lao Tzu
June 2020
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
2930  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (270)
centos8 (3)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (2)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

0 visitors online now
0 guests, 0 bots, 0 members

Hit Counter provided by dental implants orange county

Performance Benchmarks a Webserver Apache concurrency

Performance Benchmarks a Webserver

Apache Benchmark Procedures

Tweak include the KeepAlive, KeepAliveTimeout, and MaxKeepAliveRequests settings. Recommended settings, which can all be set in the httpd.conf file, would be:

Code:
ServerLimit 128
MaxClients 128
KeepAlive On
KeepAliveTimeout 2
MaxKeepAliveRequests 100

Testing a stock Apache configuration (MaxClients is 256, ServerLimit is 256, KeepAliveTimeout is 15) using ab configured to make 1000 requests with a concurrency of 100 consecutive requests would be as follows.

 

$ ab -n 1000 -c 5 http://10.4.85.106/index.html
Where,

-n 1000: ab will send 1000 number of requests to server 10.4.85.106 in order to perform for the benchmarking session
-c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a time to server 10.4.85.106

For example if you want to send 10 request, type following command:
$ ab -n 10 -c 2 http://www.test.com/

Please note that 1000 request is a small number you need to send bigger (i.e. the hits you want to test) requests, for example following command will send 50000 requests :
$ ab -k -n 50000 -c 2 http://10.4.85.106/index.html

How do I carry out Web server Static KeepAlive test?

Use -k option that enables the HTTP KeepAlive feature using ab test tool. For example:
$ ab -k -n 1000 -c 5 http://10.4.85.106/index.html

How do I save result as a Comma separated value?

Use -e option that allows to write a comma separated value (CSV) file which contains for each percentage (from 1% to 100%) the time (in milliseconds) it took to serve that percentage of the requests:
$ ab -k -n 50000 -c 2 -e apache2r1.cvs http://10.4.85.106/index.html
How do I import result into excel or gnuplot programs so that I can create graphs?

Use above command or -g option as follows:
$ ab -k -n 50000 -c 2 -g apache2r3.txt http://10.4.85.106/index.html

Sample psql.php (php+mysql) file

$link = mysql_connect(“localhost”, “USERNAME”, “PASSWORD”);
mysql_select_db(“DATABASE”);

$query = “SELECT * FROM TABLENAME”;
$result = mysql_query($query);

while ($line = mysql_fetch_array($result))
{
foreach ($line as $value)
{
print “$value\n”;
}
}

mysql_close($link);
?>
Run ab command as follows:
$ ab -n 1000 -c 5 http://10.4.85.106/psql.php

Script For Load test Apache

Here is my bash script that use wget command to bombard your web servers:

#/usr/bin/bash
for((i=0;i<=100;i++))
do
wget http://192.168.1.7/index.html
done
rm -f index.html*

 

 

apache bench max concurrency
echo “10240” > /proc/sys/net/core/somaxconn

or set (to make permanent)

net.core.somaxconn = 10240 (or any number over what you are using as max connections)

in

/etc/sysctl.conf

then run

/sbin/sysctl -p /etc/sysctl.conf

Also set your local ulimit to

ulimit -n 65535

just to have some overhead in case you want to increase the concurrent connections in ab. Let me know if that helps. If you want my thoughts on why I think this fixes things (assuming it helps you) let me know

Also if you move to Worker MPM (you will have to redo php to be threadsafe if you use php) it might lower you CPU usage for a higher RAM usage depending on what your running off your server.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam