MRatWork Forum by Mustafa Ramadhan
Sawo Project - Kloxo-MR Discussions => Kloxo-MR Development => Topic started by: MRatWork on 2013-10-03, 15:58:03
-
Since 6.5.1.a-2013100302, trafficserver ready to test.
Different with varnish, trafficserver use hd space + ram combination for cache with 'default rule' where 1GB hd cache will be use 1MB RAM cache.
By default, Kloxo-MR set cache as '256MB' HD space.
Importance file inside '/etc/trafficserver':
1. storage.config - for setting hd space for cache
2. remap.config - for mapping proxy; Kloxo-MR implementing 'simple' regex_remap
3. records.config - basic configure like port, ip and etcetera
By default, trafficserver listen port 80 (also 443) and web server (apache or others listen port 8080).
At this moment, trafficserver still using 3.2.5 (latest version of 3). Version 4.0.1 already exist but I have a problem to compile to Centos 5 (no problem with Centos 6). Epel repo have version 3.0.4 for Centos 6. As I know, no 'major' repo have trafficserver (especially for Centos 5).
-
Read http://trafficserver.apache.org/docs/tr ... ex.en.html (http://trafficserver.apache.org/docs/trunk/admin/index.en.html) to know about it.
-
Have a problem with github. Upload latest version (6.5.1.a-2013100302) always fail.
-
Apache Traffic Server takes a lot of CPU power on completely idle test server. Why ?
18408 ats 20 0 1167m 108m 32m S 105.1 0.3 5:55.95 [ET_NET 0]
16306 mysql 20 0 2357m 128m 8340 S 0.7 0.4 0:08.13 mysqld
18591 root 20 0 15176 1384 988 R 0.7 0.0 0:00.67 top
13 root 20 0 0 0 0 S 0.3 0.0 0:02.41 ksoftirqd/1
23 root 20 0 0 0 0 S 0.3 0.0 0:01.77 ksoftirqd/3
38 root 20 0 0 0 0 S 0.3 0.0 0:02.42 ksoftirqd/6
78 root 20 0 0 0 0 S 0.3 0.0 0:02.22 ksoftirqd/14
98 root 20 0 0 0 0 S 0.3 0.0 0:00.25 kworker/13:1
1664 root 20 0 97.7m 4320 3364 S 0.3 0.0 0:03.01 sshd
16679 root 20 0 401m 28m 8432 S 0.3 0.1 0:00.42 php
18383 nginx 20 0 95688 5568 612 S 0.3 0.0 0:00.21 nginx
18398 ats 20 0 454m 17m 2920 S 0.3 0.1 0:03.36 traffic_manager
It caches too long :/ Example I've copied file via FTP and it isn't showing inside web listing. Even pressing CTRL+F5 doesn't refresh page.
-
Possible traffic_manager always work to 'monitor' something. I think it's still normal.
We don't need restart trafficserver everytime we add/update/delete domain(s).
In 4.0.1, trafficserver have new 'multithreading' model.
-
Kloxo-MR 6.5.1.a-2013100403 already use Trafficserver 4.0.1
-
Possible traffic_manager always work to 'monitor' something. I think it's still normal.
We don't need restart trafficserver everytime we add/update/delete domain(s).
In 4.0.1, trafficserver have new 'multithreading' model.
Seems to be some Virtualbox issue. Installed on my backup server using Intel Atom D425 and it takes just 1,9%-3,6% of the CPU so not that much.
How to hide php and ATS version ?
curl -s --head http://mydomain.com/test.php (http://mydomain.com/test.php)
HTTP/1.1 200 OK
Server: ATS/3.2.5
Date: Fri, 04 Oct 2013 15:43:11 GMT
Content-Type: text/html
X-Powered-By: PHP/5.4.20
Cache-Control: public
Age: 0
Connection: keep-alive
-
I see the TrafficServer in default configuration does not cache anything ;) I would like to set cache for 2 seconds just like my own Varnish config so in case of very big traffic about 50% hits will be going through the cache.
-
Add something like 'CONFIG proxy.config.http.response_server_str STRING ATS-Hiawatha' in '/etc/trafficserver/records.config'.
You can use 'custom rule' where copy '/home/trafficserver/etc/conf/records.config' to 'custom.records.config'.
-
Thanks :)
-
How to optimize trafficserver (also varnish) is not my own job. I hope user(s) find out about it and share their idea/suggest.
-
Please see my old thread about Varnish ;)
http://forum.lxcenter.org/index.php?t=msg&goto=104513& (http://forum.lxcenter.org/index.php?t=msg&goto=104513&)
Traffic Server seems to be less complicated, but I need a few days to test it.
Mustafa did you make any benchmarks comparing all these servers, proxies and caches :) ?
It's hard to decide which config is the best now. I think Apache Traffic Server + nginxproxy + Apache + php_fpm_event + PHP 5.4 is the best ;D
-
It seems Apache Traffic Server in default config is slower than nginxproxy with default config too ;):
ab -n 50000 -c 1000 http://nowosci.org:8080/
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 nowosci.org (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: nginx
Server Hostname: nowosci.org
Server Port: 8080
Document Path: /
Document Length: 383 bytes
Concurrency Level: 1000
Time taken for tests: 6.814 seconds
Complete requests: 50000
Failed requests: 450
(Connect: 0, Receive: 0, Length: 450, Exceptions: 0)
Write errors: 0
Non-2xx responses: 49804
Total transferred: 58477704 bytes
HTML transferred: 49086456 bytes
Requests per second: 7338.02 [#/sec] (mean)
Time per request: 136.276 [ms] (mean)
Time per request: 0.136 [ms] (mean, across all concurrent requests)
Transfer rate: 8381.07 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 30 59 12.6 58 103
Processing: 34 76 32.6 71 444
Waiting: 21 55 17.3 52 160
Total: 77 134 33.8 131 499
Percentage of the requests served within a certain time (ms)
50% 131
66% 139
75% 144
80% 147
90% 154
95% 164
98% 221
99% 228
100% 499 (longest request)
vs
ab -n 50000 -c 1000 http://nowosci.org/
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 nowosci.org (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests
Completed 45000 requests
Completed 50000 requests
Finished 50000 requests
Server Software: ATS/4.0.1
Server Hostname: nowosci.org
Server Port: 80
Document Path: /
Document Length: 383 bytes
Concurrency Level: 1000
Time taken for tests: 9.305 seconds
Complete requests: 50000
Failed requests: 10551
(Connect: 0, Receive: 0, Length: 10551, Exceptions: 0)
Write errors: 0
Non-2xx responses: 39459
Total transferred: 700797554 bytes
HTML transferred: 692038427 bytes
Requests per second: 5373.66 [#/sec] (mean)
Time per request: 186.093 [ms] (mean)
Time per request: 0.186 [ms] (mean, across all concurrent requests)
Transfer rate: 73551.76 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 14 48.9 6 1028
Processing: 2 170 112.6 151 1333
Waiting: 2 156 110.9 134 1188
Total: 2 184 122.5 163 1419
Percentage of the requests served within a certain time (ms)
50% 163
66% 203
75% 233
80% 252
90% 306
95% 366
98% 440
99% 525
100% 1419 (longest request)
-
I have no time to benchmarking. It's user(s) duty :D
Now, I try to make nginx, lighttpd and hiawatha use 'microcache' trick (taken from nginx idea) for better performance. Beside, implementing 'generic' permalink for nginx, lighttpd and hiawatha (latest upload of 6.5.1.a already use it).
For share-hosting business, combination between ATS and nginx-proxy (nginx + apache) is the best. ATS better then Varnish because more features, better performance and less complicated.
-
Don't use '-c' more then 25 because nginx will be 'ban' connection from the same ip more then 25 connections. Except connection from '127.0.0.1'
-
You can see 'limit_conn addr 25;' inside php-fpm.conf and proxy.conf in /home/nginx/conf/globals
You can disable it with '#limit_conn addr 25;' before benchmarking nginx/nginx-proxy.
-
Don't use '-c' more then 25 because nginx will be 'ban' connection from the same ip more then 25 connections. Except connection from '127.0.0.1'
I don't use it ;)
-
Don't use '-c' more then 25 because nginx will be 'ban' connection from the same ip more then 25 connections. Except connection from '127.0.0.1'
I don't use it ;)
Benchmarking with 'ab -n 50000 -c 1000 http://nowosci.org/' (http://nowosci.org/') that mean make connection to 1000 (in '-c 1000') and it's make no accurate information for nginx.
-
All tests were made on 2x Intel Xeon X5570 (16 cores assigned for VirtualBox) + 32 GB RAM assigned for Virtualbox + 3x SSD HW SATA II RAID0 (about 750 MB/s performance), CentOS 6.4, kernel 3.11.1, nginx,hiawatha,apache server limits removed:
Apache 2.2.25
Requests per second: 354.86 [#/sec] (mean)
lighttpd/1.4.32
Requests per second: 7567.74 [#/sec] (mean)
nginx/1.5.6
Requests per second: 7204.38 [#/sec] (mean)
Hiawatha
Requests per second: 521.57 [#/sec] (mean)
lighttpdproxy
Requests per second: 9573.32 [#/sec] (mean)
nginxproxy
Requests per second: 4654.86 [#/sec] (mean)
hiawathaproxy
Requests per second: 453.64 [#/sec] (mean)
-
Cancel lighttpdproxy results - it was showing 403 Forbidden instead of my phpinfo page ;)
-
Try to use wordpress home page. It's better for benchmarking rather then plain phpinfo.