Archive for the ‘Wordpress’ 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

Easy WordPress Upgrade…

October 28th, 2007

0. Deactivate modules that might conflict/break with upgrade…
1. Have backups of your wordpress files and database..
2. I used ssh for the upgrade, so I untar’d the tar.gz file somewhere.
3. cp -rp wordpress/* ../../blog/ *this copies over all new files to old location, leaving old files intact.
4. somedomain.com/blogdir/wp-admin/upgrade.php – click click done…

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

Run shell_exec in WordPress and Drupal

March 5th, 2007

I found this out on accident – use nested includes to use shell_exec in WordPress and Drupal posts without any issues – I am using the Exec-PHP plugin.

* Tested with WordPress 2.1.2
* WordPress: Only works in Blog posts – not in a “page” – the PHP will not work.
* WordPress: Must use file path, not HTTP URL – see example below. URL’s will not work for the post.
* Drupal, tested as pages – works fine.

WordPress / Drupal Post text – use includes only:

<?php
include "/home/user/domain.com/ScriptDir/index.php";
?>

Contents of /home/user/domain.com/ScriptDir/index.php

<?php
include "/home/user/domain.com/ScriptDir/foo.php";
?>

Finally, the contents of /home/user/domain.com/ScriptDir/foo.php

<?php
shell_exec ( unix commands );
.. more verboten commands
?>
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Worpdress upgrade notes

December 9th, 2006

Cygwin is installed on this system, thus the command line work. You can do this with the command console perhaps, but I have never seen the value of learning the windows command line when unix is more mature and stable (since the late 1960′s).

1] Backup the database:
Format: `mysqldump -u -p -h > `

# mysqldump -u wpuser -pDBpass wordpress2 > wordpress-dec12.sql

2] Copy the entire wordpress folder in windows to another place as a backup.

3] Copy the zip file from here to somewhere and copy the files (not dirs) over by clicking away

4] The diff file works, but the ACL’s get broken.

# patch -p0 --dry-run < patchfile.diff

If the dry run looks good - no error/log messages then run w/o the `--dry-run` flag.

# patch -p0 < patchfile.diff

5] Added the andyblue theme and edited left-sidebar.php to include `optioncount=1` in the line that looks like this:

< ?php wp_list_cats('sort_column=name&optioncount=1&children=1'); ?>
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • MisterWong
  • Reddit

Default WordPress theme – 1024px wide

October 12th, 2006

Starting with the widely recognized default theme, a little work to make it 1024px wide (original is 760px wide). Its a great theme, just needed it wider. This version allows for 700px wide images in posts. Download the theme here . It will show as “WordPress Default – 1024px Wide 1.6.1024″

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

Mochabomb is Digg proof thanks to caching by WP Super Cache