Archive for the ‘Apache’ Category

WP SuperCache Rocks

April 16th, 2010

I installed about a year ago and was curious to see how welll it really works…

Baseline – hammer with 1000 hits, concurrency = 10. Uptime (load1) remained around 0.6 over the duration of the test:

$ ab -n 1000 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30815 bytes

Concurrency Level:      10
Time taken for tests:   102.070 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      31256335 bytes
HTML transferred:       30840920 bytes
Requests per second:    9.80 [#/sec] (mean)
Time per request:       1020.695 [ms] (mean)
Time per request:       102.070 [ms] (mean, across all concurrent requests)
Transfer rate:          299.05 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       82  190 411.0    132    3193
Processing:   427  827 214.1    776    2113
Waiting:       90  149  48.9    144     823
Total:        521 1017 468.5    914    4555

Percentage of the requests served within a certain time (ms)
  50%    914
  66%    958
  75%   1008
  80%   1061
  90%   1265
  95%   1504
  98%   2307
  99%   3921
 100%   4555 (longest request)

Disabled wp-supercache, emptied cache and retested – used only 200 to start with – uptime (load1) was around 9.0!

$ ab -n 200 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30616 bytes

Concurrency Level:      10
Time taken for tests:   133.357 seconds
Complete requests:      200
Failed requests:        197
   (Connect: 0, Receive: 0, Length: 197, Exceptions: 0)
Write errors:           0
Total transferred:      6172753 bytes
HTML transferred:       6116953 bytes
Requests per second:    1.50 [#/sec] (mean)
Time per request:       6667.857 [ms] (mean)
Time per request:       666.786 [ms] (mean, across all concurrent requests)
Transfer rate:          45.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       81   85   3.6     83     104
Processing:  3004 6464 1752.2   6397   11600
Waiting:     1709 4047 1194.1   3895    7517
Total:       3086 6549 1752.5   6480   11682

Percentage of the requests served within a certain time (ms)
  50%   6480
  66%   7234
  75%   7845
  80%   8099
  90%   8978
  95%   9656
  98%  10404
  99%  10592
 100%  11682 (longest request)

enabled cache, test one more time. Inititally php processes were high – then after about 10 seconds tapered off and http was the dominant one, though at 0.6 again for load1

$ ab -n 200 -c 10 http://mochabomb.com/blog/drop-bogon-ips-daily/
This is ApacheBench, Version 2.3 < $Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking mochabomb.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests

Server Software:        Apache/2.2.14
Server Hostname:        mochabomb.com
Server Port:            80

Document Path:          /blog/drop-bogon-ips-daily/
Document Length:        30772 bytes

Concurrency Level:      10
Time taken for tests:   26.576 seconds
Complete requests:      200
Failed requests:        199
   (Connect: 0, Receive: 0, Length: 199, Exceptions: 0)
Write errors:           0
Total transferred:      6289923 bytes
HTML transferred:       6207305 bytes
Requests per second:    7.53 [#/sec] (mean)
Time per request:       1328.780 [ms] (mean)
Time per request:       132.878 [ms] (mean, across all concurrent requests)
Transfer rate:          231.13 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       82  179 370.2    132    3182
Processing:   438 1106 1327.1    755    7769
Waiting:       92  465 1361.8    156    7341
Total:        522 1285 1359.2    902    7866

Percentage of the requests served within a certain time (ms)
  50%    902
  66%    993
  75%   1127
  80%   1293
  90%   1635
  95%   5460
  98%   7563
  99%   7810
 100%   7866 (longest request)
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

PHP memory limit results in blank pages

November 5th, 2007

From a Drupal install, got a blank page when logging in….

[Mon Nov 05 13:20:36 2007] [error] [client 71.139.36.123] PHP Fatal error:
Allowed memory size of 16777216 bytes exhausted (tried to allocate 92160 bytes) in
/home/someuser/public_html/modules/event/event_timezones.inc on line 331, referer: http://example.com/

Up the memory in php.ini a few MB, restart httpd and all was working..

  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Invalid method in request \x16\x03\x01

September 15th, 2007

I was tinkering with Apache SSL – and got the following error:
[Sat Sep 15 05:05:33 2007] [error] [client 61.219.39.67] Invalid method in request \x16\x03\x01

Turned out to be a wrong IP address for that host – I had changed the IP for the host in some places, but not another – fixed and working now in SSL mode…

  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Virtual hosts: Apache 2.0 + Windows XP

January 4th, 2007

Virtual hosting is simple to set up in XP – but picky..

* I have a software folder where I keep all my downloaded SW – it got pretty big and I wanted to move it to another partition. To have it seen correctly in apache, I created a virtual host for it – this tutorial is a write-up of the solution that works on my home XP SP2 box with Apache 2.0.59.

1. Edit the hosts file ( windows XP: C:\Windows\system32\drivers\etc\hosts ) – every virtual host has the IP 127.0.0.1
2. Add vhost entries to httpd.conf + set the correct NamedVirtualhost directive (see below)
3. Create a virtual host for the primary server – the first vhost entry is used as the server default.
4. reboot -or-
* stop Apache
* Disable your network connection
* Clear Mozilla/IE/Opera cache and close
* Enable network connection
* start Apache

`hosts` file entries:

#
# IP of the box on the home network - 192.168.0.20, and I use DynDNS for dyamic hosting
# separate entries are easier to read...
192.168.0.20  hostname1.tld
127.0.0.1       localhost
127.0.0.1       hostname1.tld
127.0.0.1       software.hostname1.tld
127.0.0.1       hostname2.tld
#

`httpd.conf` (or other file that is included by httpd.conf, such as vhosts.conf) virtual hosts entries:

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
# The original server
<VirtualHost *:80>
    DocumentRoot C:/WWW/htdocs
    ServerName hostname1.tld
</VirtualHost>
#
# Ran out of space ran C drive, relocated /software to D drive.
<VirtualHost *:80>
    DocumentRoot D:/WWW/htdocs/software
    ServerName software.hostname1.tld
</VirtualHost>
#
<VirtualHost *:80>
    DocumentRoot D://WWW/hostname2.tld/htdocs
    ServerName hostname2.tld
    ServerAlias *.hostname2.tld
</VirtualHost>
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Apache dies after a while

December 29th, 2006

Apache was crashing and in the error log was:

[warn] (OS 995)The I/O operation has been aborted because of either a thread exit or an application request.  : winnt_accept: Asynchronous AcceptEx failed 

The solution from here was increasing the max requests per child from 30 (I set this) to 10000.

Here is the section in `httpd.conf` that was edited.

# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxRequestsPerChild: maximum  number of requests a server process serves

ThreadsPerChild 250
MaxRequestsPerChild  10000
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Mochabomb is Digg proof thanks to caching by WP Super Cache