EC-CUBE2.11.0リリース記念、パフォーマンス60%向上は本当か試してみた

ECCUBE

eccube

久々のEC-CUBEネタになります。
自分もコミッターとして参加したEC-CUBE2.11.0がリリースされました
EC-CUBE2.11.0について

この中にパフォーマンスが60%向上、と気になる一文がありましたので比較してみますヽ(´ー`)ノ

比較する状況

MySQL 5.1.56
Apache/2.2.3 (CentOS)
PHP5.3.6
商品数5000点(規格1、規格2それぞれ一つずつ)
カテゴリーは大カテゴリー1、中カテゴリー1,小カテゴリー1

商品追加にはデータ生成スクリプトを使います

EC-CUBE2.4.4

■TOPページ
ab -n 5 http://hogehoge/eccube-2.4.4/html/
~~~
The timeout specified has expired (70007)
~~~

■商品一覧ページ
ab -n 5 http://hogehoge/eccube-2.4.4/html/products/list.php?category_id=6
~~~
The timeout specified has expired (70007)
~~~

■商品詳細ページ
ab -n 5 http://hogehoge/eccube-2.4.4/html/products/detail.php?product_id=5002
~~~
The timeout specified has expired (70007)
~~~

EC-CUBE2.11.0

2.11.0TOP
■TOPページ
ab -n 5 http://hogehoge/eccube/html/
~~~
Server Software: Apache/2.2.3
Server Hostname: hogehoge
Server Port: 80

Document Path: /eccube/html/
Document Length: 34280 bytes

Concurrency Level: 1
Time taken for tests: 3.154075 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Total transferred: 173315 bytes
HTML transferred: 171400 bytes
Requests per second: 1.59 [#/sec] (mean)
Time per request: 630.815 [ms] (mean)
Time per request: 630.815 [ms] (mean, across all concurrent requests)
Transfer rate: 53.58 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 1 0.5 1 2
Processing: 384 629 244.1 667 980
Waiting: 322 484 154.1 481 733
Total: 385 630 244.2 669 981

Percentage of the requests served within a certain time (ms)
50% 572
66% 766
75% 766
80% 981
90% 981
95% 981
98% 981
99% 981
100% 981 (longest request)
~~~

■商品一覧ページ
ab -n 5 http://hogehoge/eccube/html/products/list.php?category_id=7
~~~
The timeout specified has expired (70007)
Total of 1 requests completed
~~~

あれ、タイムアウトしました(´Д`;)ヾ

slow-query-logを一応とってみました。
とにかくこいつが重いみたい。。1クエリで34秒って・・・
~~~
$ mysqldumpslow /var/log/mysql/mysql-slow.log
Reading mysql slow query log from /var/log/mysql/mysql-slow.log
Count: 1 Time=34.43s (34s) Lock=0.00s (0s) Rows=15.0 (15), root[root]@localhost
SELECT
alldtl.product_id
FROM
dtb_products AS alldtl JOIN dtb_products_class AS T1
ON
alldtl.product_id = T1.product_id JOIN dtb_product_categories AS T2
ON
alldtl.product_id = T2.product_id JOIN dtb_category
ON
T2.category_id = dtb_category.category_id
WHERE
alldtl.del_flg = N
AND alldtl.status = N
AND T2.category_id IN (N,’S’,’S’)
GROUP BY
alldtl.product_id
ORDER BY
(
SELECT
T3.rank
FROM
(
SELECT
*
FROM
dtb_product_categories
WHERE
category_id IN (N,’S’,’S’)
) T2 JOIN dtb_category T3 USING (category_id)
WHERE
T2.product_id = alldtl.product_id
ORDER BY
T3.rank DESC,
T2.rank DESC LIMIT N
) DESC ,
(
SELECT
T2.rank
FROM
(
SELECT
*
FROM
dtb_product_categories
WHERE
category_id IN (N,’S’,’S’)
) T2 JOIN dtb_category T3 USING (category_id)
WHERE
T2.product_id = alldtl.product_id
ORDER BY
T3.rank DESC,
T2.rank DESC LIMIT N
) DESC ,
product_id LIMIT N OFFSET N
~~~

■商品詳細ページ
ab -n 5 http://hogehoge/eccube/html/products/products/detail.php?product_id=5003
~~~
Server Software: Apache/2.2.3
Server Hostname: hogehoge
Server Port: 80

Document Path: /eccube/html/products/products/detail.php?product_id=5003
Document Length: 314 bytes

Concurrency Level: 1
Time taken for tests: 0.25572 seconds
Complete requests: 5
Failed requests: 0
Write errors: 0
Non-2xx responses: 5
Total transferred: 2465 bytes
HTML transferred: 1570 bytes
Requests per second: 195.53 [#/sec] (mean)
Time per request: 5.114 [ms] (mean)
Time per request: 5.114 [ms] (mean, across all concurrent requests)
Transfer rate: 78.21 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.6 1 6
Processing: 2 3 0.7 3 4
Waiting: 1 2 0.7 2 3
Total: 3 4 3.1 3 10

Percentage of the requests served within a certain time (ms)
50% 3
66% 4
75% 4
80% 10
90% 10
95% 10
98% 10
99% 10
100% 10 (longest request)
~~~

TOPより詳細が圧倒的に早いですね

結果

5000商品じゃ多すぎて比較にならなかった!
けど、60%かどうかはともかくmysqlでも確実にパフォーマンスは向上してるよヽ(´ー`)ノ

コメント

タイトルとURLをコピーしました