回答編集履歴

5

バイナリログの場合のデータを更新した。

2015/12/15 12:04

投稿

eripong
eripong

スコア1546

test CHANGED
@@ -196,6 +196,8 @@
196
196
 
197
197
  ---
198
198
 
199
+ (2015/12/15 21:02 追記)
200
+
199
201
  バイナリログを出力する様になっていたりしませんか?
200
202
 
201
203
 
@@ -212,4 +214,72 @@
212
214
 
213
215
 
214
216
 
215
- ![実行結果の散布図グラフ(仮想環境 バイナリログON)](4caf0385361305f18bb53a809cefa27e.png)
217
+ ![実行結果の散布図グラフ(仮想環境 バイナリログON)](bdc33c150a2e7061687fba6267070966.png)
218
+
219
+
220
+
221
+ mysqli_get_client_statsの情報(実行前後の差分)
222
+
223
+ ```
224
+
225
+ [bytes_sent] => 47295406
226
+
227
+ [bytes_received] => 20765932
228
+
229
+ [packets_sent] => 525952
230
+
231
+ [packets_received] => 525112
232
+
233
+ [protocol_overhead_in] => 2100448
234
+
235
+ [protocol_overhead_out] => 2103808
236
+
237
+ [bytes_received_rset_header_packet] => 540
238
+
239
+ [bytes_received_rset_row_packet] => 13673680
240
+
241
+ [bytes_received_prepare_response_packet] => 7077672
242
+
243
+ [packets_sent_command] => 262856
244
+
245
+ [packets_received_rset_header] => 60
246
+
247
+ [packets_received_rset_row] => 262616
248
+
249
+ [packets_received_prepare_response] => 262136
250
+
251
+ [non_result_set_queries] => 262616
252
+
253
+ [ps_prepared_once_executed] => 4
254
+
255
+ [rows_affected_normal] => 1966080
256
+
257
+ [rows_affected_ps] => 1966080
258
+
259
+ [command_buffer_too_small] => 784
260
+
261
+ [connect_success] => 120
262
+
263
+ [connect_failure] => 5
264
+
265
+ [active_connections] => 18446744073709551491
266
+
267
+ [explicit_close] => 120
268
+
269
+ [explicit_free_result] => 60
270
+
271
+ [explicit_stmt_close] => 60
272
+
273
+ [com_quit] => 120
274
+
275
+ [com_query] => 131548
276
+
277
+ [com_stmt_prepare] => 60
278
+
279
+ [com_stmt_execute] => 131068
280
+
281
+ [com_stmt_close] => 60
282
+
283
+
284
+
285
+ ```

4

バイナリログについて追記した。

2015/12/15 12:03

投稿

eripong
eripong

スコア1546

test CHANGED
@@ -80,7 +80,7 @@
80
80
 
81
81
 
82
82
 
83
- ![実行結果のグラフ(散布図)](323990f354003b27054a00f5dc2f7798.png)
83
+ ![実行結果の散布図](323990f354003b27054a00f5dc2f7798.png)
84
84
 
85
85
 
86
86
 
@@ -100,11 +100,11 @@
100
100
 
101
101
  Memory : 16GB
102
102
 
103
- スクリプト : PHP 5.6.8
103
+ スクリプト : PHP 5.6.8
104
104
 
105
105
  DB接続ドライバ : PDO
106
106
 
107
- Oracle Virtual Box 5.0.8
107
+ Oracle Virtual Box 5.0.8
108
108
 
109
109
 
110
110
 
@@ -120,7 +120,7 @@
120
120
 
121
121
  グラフ化した結果は以下の通りです。
122
122
 
123
- ![仮想環境での実行結果のグラフ(散布図)](c9b0dc500eecd25a3c0d8b759ae72268.png)
123
+ ![実行結果の散布図(仮想環境)](c9b0dc500eecd25a3c0d8b759ae72268.png)
124
124
 
125
125
  顕著な差は出ませんでした。
126
126
 
@@ -191,3 +191,25 @@
191
191
  [com_stmt_close] => 15
192
192
 
193
193
  ```
194
+
195
+
196
+
197
+ ---
198
+
199
+ バイナリログを出力する様になっていたりしませんか?
200
+
201
+
202
+
203
+ [Bug #67676 prepared statement is very slow while binlog was enabled](https://bugs.mysql.com/bug.php?id=67676)
204
+
205
+
206
+
207
+ という不具合があるようです。
208
+
209
+ 試しに、こちらの環境でバイナリログを出力する様にしたところ、
210
+
211
+ 以下の結果となり、KiyoshiMotokiさんの結果に少し近くなりました。
212
+
213
+
214
+
215
+ ![実行結果の散布図グラフ(仮想環境 バイナリログON)](4caf0385361305f18bb53a809cefa27e.png)

3

結果の整形を行った。

2015/12/15 11:55

投稿

eripong
eripong

スコア1546

test CHANGED
@@ -102,7 +102,7 @@
102
102
 
103
103
  スクリプト : PHP 5.6.8
104
104
 
105
- DB接続ドライバ : PDO
105
+ DB接続ドライバ : PDO
106
106
 
107
107
  Oracle Virtual Box 5.0.8
108
108
 

2

mysqli_get_client_statsの情報を追記した。

2015/12/14 09:40

投稿

eripong
eripong

スコア1546

test CHANGED
@@ -120,6 +120,74 @@
120
120
 
121
121
  グラフ化した結果は以下の通りです。
122
122
 
123
- ![仮想環境での実行結果のグラフ(散布図)](82c0e8f4550440290ea98081ac5b1143.png)
123
+ ![仮想環境での実行結果のグラフ(散布図)](c9b0dc500eecd25a3c0d8b759ae72268.png)
124
124
 
125
125
  顕著な差は出ませんでした。
126
+
127
+
128
+
129
+ mysqli_get_client_statsの情報(値が0の項目は省きました)
130
+
131
+ ```
132
+
133
+
134
+
135
+ [bytes_sent] => 11823835
136
+
137
+ [bytes_received] => 5191393
138
+
139
+ [packets_sent] => 131488
140
+
141
+ [packets_received] => 131278
142
+
143
+ [protocol_overhead_in] => 525112
144
+
145
+ [protocol_overhead_out] => 525952
146
+
147
+ [bytes_received_rset_header_packet] => 135
148
+
149
+ [bytes_received_rset_row_packet] => 3418420
150
+
151
+ [bytes_received_prepare_response_packet] => 1769418
152
+
153
+ [packets_sent_command] => 65714
154
+
155
+ [packets_received_rset_header] => 15
156
+
157
+ [packets_received_rset_row] => 65654
158
+
159
+ [packets_received_prepare_response] => 65534
160
+
161
+ [non_result_set_queries] => 65654
162
+
163
+ [ps_prepared_once_executed] => 1
164
+
165
+ [rows_affected_normal] => 491520
166
+
167
+ [rows_affected_ps] => 491520
168
+
169
+ [command_buffer_too_small] => 196
170
+
171
+ [connect_success] => 30
172
+
173
+ [connect_failure] => 2
174
+
175
+ [active_connections] => 18446744073709551584
176
+
177
+ [explicit_close] => 30
178
+
179
+ [explicit_free_result] => 15
180
+
181
+ [explicit_stmt_close] => 15
182
+
183
+ [com_quit] => 30
184
+
185
+ [com_query] => 32887
186
+
187
+ [com_stmt_prepare] => 15
188
+
189
+ [com_stmt_execute] => 32767
190
+
191
+ [com_stmt_close] => 15
192
+
193
+ ```

1

グラフ化した結果を追加した。

2015/12/14 09:36

投稿

eripong
eripong

スコア1546

test CHANGED
@@ -61,3 +61,65 @@
61
61
  また、理由が分からないのであれば、
62
62
 
63
63
  [mysqli_get_client_stats](https://dev.mysql.com/doc/apis-php/en/apis-php-mysqli.get-client-stats.html)などを使って、統計を取ってみては?
64
+
65
+
66
+
67
+
68
+
69
+ ---
70
+
71
+ 参考情報です。
72
+
73
+
74
+
75
+ KiyoshiMotokiさんの結果を、こちらで散布図にしてみたところ、
76
+
77
+ 以下の様に、顕著にO(n)の傾向が見えます。
78
+
79
+ どうも、おかしいような気がします。
80
+
81
+
82
+
83
+ ![実行結果のグラフ(散布図)](323990f354003b27054a00f5dc2f7798.png)
84
+
85
+
86
+
87
+ また、性能検証には向かない環境ですが、Windows 7上のOracle Virtualboxを
88
+
89
+ DBサーバとして、Windows 7のホストから負荷をかけてみました。
90
+
91
+ 環境は以下の通りです。
92
+
93
+
94
+
95
+ APサーバ(ホスト)
96
+
97
+ OS : Windows 7
98
+
99
+ CPU : Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
100
+
101
+ Memory : 16GB
102
+
103
+ スクリプト : PHP 5.6.8
104
+
105
+ DB接続ドライバ : PDO
106
+
107
+ Oracle Virtual Box 5.0.8
108
+
109
+
110
+
111
+ DBサーバ(ゲスト)
112
+
113
+ OS : Ubuntu 14.04.3
114
+
115
+ Memory : 2GB
116
+
117
+ DB : MySQL 5.5.46
118
+
119
+
120
+
121
+ グラフ化した結果は以下の通りです。
122
+
123
+ ![仮想環境での実行結果のグラフ(散布図)](82c0e8f4550440290ea98081ac5b1143.png)
124
+
125
+ 顕著な差は出ませんでした。