I could confirm this thread:
http://forums.freebsd.org/showthread.php?t=5511
That using FreeBSD + Apache/2.2.16 + MySQL 5.2 is deadly slow.
At the beginning I've done the test between different machines (which had similar hardware) with the same website/db. Difference: 1,5sec on Linux (Ubuntu), more than 5sec on FreeBSD.
I've tried to copy the same configs php.ini, my.cfg as I could, the same.
Then I've run VM (Linux Ubuntu) within VirtualBox on FreeBSD 8.1-STABLE on the same machine with the same repository files and database.
(doc - FreeBSD 8.1-"STABLE", doc.local.vm - VM (Linux Ubuntu) run on the same machine)
Here are the results:
1st attempt:
2nd attempt:
On VM:
Difference between 10sec and 1,7sec, how it's possible???
Usually it's between 5-10sec, on VM usually less than 2sec.
Some environment details:
No much difference between my.cnf
The only difference are Apache versions:
Apache/2.2.16 and Apache/2.2.9 (faster?!)
Any suggestion how to diagnose that problem and find the source of this issue?
P.S. I can't spend more hours for compiling or re-installing, changing. I already spend few days looking what's going on, why web performance on FreeBSD is so slow.
http://forums.freebsd.org/showthread.php?t=5511
That using FreeBSD + Apache/2.2.16 + MySQL 5.2 is deadly slow.
At the beginning I've done the test between different machines (which had similar hardware) with the same website/db. Difference: 1,5sec on Linux (Ubuntu), more than 5sec on FreeBSD.
I've tried to copy the same configs php.ini, my.cfg as I could, the same.
Then I've run VM (Linux Ubuntu) within VirtualBox on FreeBSD 8.1-STABLE on the same machine with the same repository files and database.
(doc - FreeBSD 8.1-"STABLE", doc.local.vm - VM (Linux Ubuntu) run on the same machine)
Here are the results:
1st attempt:
Code:
> ab -v2 http://doc/
Benchmarking doc (be patient)...INFO: POST header ==
---
GET / HTTP/1.0
Host: doc
User-Agent: ApacheBench/2.3
Accept: */*
---
apr_poll: The timeout specified has expired (70007)
2nd attempt:
Code:
> ab -v2 http://doc/
Benchmarking doc (be patient)...INFO: POST header ==
---
GET / HTTP/1.0
Host: doc
User-Agent: ApacheBench/2.3
Accept: */*
---
LOG: header received:
HTTP/1.1 200 OK
Date: Mon, 01 Nov 2010 17:35:14 GMT
Server: Apache/2.2.16 (FreeBSD) mod_ssl/2.2.16 OpenSSL/0.9.8n DAV/2 PHP/5.2.14 with Suhosin-Patch
X-Powered-By: PHP/5.2.14
X-Drupal-Cache: MISS
Last-Modified: Mon, 01 Nov 2010 17:35:14 +0000
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
ETag: "1288632914"
Connection: close
Content-Type: text/html; charset=utf-8
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr">
(...here is the source...)
..done
Server Software: Apache/2.2.16
Server Hostname: doc
Server Port: 80
Document Path: /
Document Length: 27201 bytes
Concurrency Level: 1
Time taken for tests: 10.097 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Total transferred: 27600 bytes
HTML transferred: 27201 bytes
Requests per second: 0.10 [#/sec] (mean)
Time per request: 10096.841 [ms] (mean)
Time per request: 10096.841 [ms] (mean, across all concurrent requests)
Transfer rate: 2.67 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 10097 10097 0.0 10097 10097
Waiting: 9577 9577 0.0 9577 9577
Total: 10097 10097 0.0 10097 10097
On VM:
Code:
> ab -v2 http://doc.local.vm/
Benchmarking doc.local.vm (be patient)...INFO: POST header ==
---
GET / HTTP/1.0
Host: doc.local.vm
User-Agent: ApacheBench/2.3
Accept: */*
---
LOG: header received:
HTTP/1.1 200 OK
Date: Mon, 01 Nov 2010 17:44:43 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch
X-Powered-By: PHP/5.2.6-1+lenny9
X-Drupal-Cache: MISS
Last-Modified: Mon, 01 Nov 2010 17:44:43 +0000
Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
ETag: "1288633483"
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=utf-8
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" dir="ltr">
<head>
...
..done
Server Software: Apache/2.2.9
Server Hostname: doc.local.vm
Server Port: 80
Document Path: /
Document Length: 27215 bytes
Concurrency Level: 1
Time taken for tests: 1.792 seconds
Complete requests: 1
Failed requests: 0
Write errors: 0
Total transferred: 27615 bytes
HTML transferred: 27215 bytes
Requests per second: 0.56 [#/sec] (mean)
Time per request: 1792.438 [ms] (mean)
Time per request: 1792.438 [ms] (mean, across all concurrent requests)
Transfer rate: 15.05 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.0 1 1
Processing: 1791 1791 0.0 1791 1791
Waiting: 1662 1662 0.0 1662 1662
Total: 1792 1792 0.0 1792 1792
Difference between 10sec and 1,7sec, how it's possible???
Usually it's between 5-10sec, on VM usually less than 2sec.
Some environment details:
Code:
> uname -a && ./vm_run.sh uname -a
FreeBSD kenorb 8.1-STABLE FreeBSD 8.1-STABLE #0: Tue Oct 19 15:28:55 BST 2010 root@kenorb:/usr/obj/usr/src/sys/BRO amd64
Linux dev32-407350 2.6.26-2-686 #1 SMP Mon Jun 21 05:58:44 UTC 2010 i686 GNU/Linux
> ./vm_run.sh cat /etc/php5/apache2/php.ini | diff -suw /dev/stdin /etc/php.ini
Files /dev/stdin and /etc/php.ini are identical
The only difference are Apache versions:
Apache/2.2.16 and Apache/2.2.9 (faster?!)
Any suggestion how to diagnose that problem and find the source of this issue?
P.S. I can't spend more hours for compiling or re-installing, changing. I already spend few days looking what's going on, why web performance on FreeBSD is so slow.