Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 544

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /usr/home/bugyo/public_html/b-log/wp-includes/comment-template.php on line 1739

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 199

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 3030

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php:14) in /usr/home/bugyo/public_html/b-log/wp-includes/feed-rss2.php on line 8
MovableType – B-LOG https://blog.bugyo.tk/b-log bugyoのlog。決してblogではない。 Mon, 20 Jul 2009 04:45:52 +0000 en-US hourly 1 https://wordpress.org/?v=5.7.2 [MT4.2] 再構築時にデータベースへの問い合わせにかかる時間 https://blog.bugyo.tk/b-log/archives/393 https://blog.bugyo.tk/b-log/archives/393#respond Mon, 20 Jul 2009 04:21:41 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/b-log/?p=393 Continue reading [MT4.2] 再構築時にデータベースへの問い合わせにかかる時間]]> MovableTypeではページの生成に非常に時間がかかる。

mod_perlやFastCGIを導入すればバイトコンパイルにかかる時間分を短縮できるが、再構築は分単位で時間がかかる処理のため、バイトコンパイルにかかる時間は無視できる程度になってあまり効果が出ないと思われる。

MTからデータベースへのクエリの発行回数を減らす (mt-search.cgiを例にとって)。』ではデータベースへの問い合わせ回数を減らすことでページの生成時間を減らそうとしているが、アムダールの法則で、問い合わせにかかる時間が全体のうちに占める割合で効果が限定される。

自分の環境ではどうだろうかと思ってデータベースへの問い合わせにかかる時間を計ってみることにした。

環境は

CPU Celeron 2.0GHz
chip set i865G
memory PC2700 768MB
OS FreeBSD 7.2
DBMS MySQL 5.0.77_1
MovableType 4.2.61

という感じで、ウェブサーバと同じマシンでmysqldを動かしている。

index_page.log
インデックスページのみを再構築したときのクエリログは上のようになった。

全体で449クエリ。そのうちSELECTが437クエリ、UPDATEが4クエリ、SETが8クエリ。

次にこのログを元にインデックスページ再構築時と同じクエリ列(query.txt)を作って

% time mysql -u root -ppasswd databese < query.txt > /dev/null

のようにして問い合わせ時間を計測した。

結果

0.086u 0.053s 0:02.13 6.1%      125+1371k 0+0io 0pf+0w
0.100u 0.046s 0:02.19 6.3%      87+977k 0+0io 0pf+0w
0.106u 0.034s 0:02.22 5.8%      130+1432k 0+0io 0pf+0w
0.115u 0.023s 0:02.20 5.9%      88+1001k 0+0io 0pf+0w
0.067u 0.074s 0:02.23 5.8%      109+1236k 0+0io 0pf+0w

となって5回平均で2.19秒かかっていることになる。

再構築時間が最短で13秒かかっているので、オーバーヘッドを含めずに17%程度がデータベースへの問い合わせにかかっている。

オンデマンドに問い合わせているだろうから、データベースサーバを置くマシンを別にしても大差ないだろう。

問い合わせ時間が0秒になっても10秒以上かかっていて、今のところ影響は少ないけど2割を超えてくると注意する必要があるかもしれない。

]]>
https://blog.bugyo.tk/b-log/archives/393/feed 0
MovableType 4.2でページのダイナミック生成 https://blog.bugyo.tk/b-log/archives/344 https://blog.bugyo.tk/b-log/archives/344#respond Fri, 03 Apr 2009 09:41:05 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/b-log/?p=344 静的ページ生成がデフォルトのMovableTypeでも動的にページを生成するように設定できる。

MobableType 4.2ではテンプレートごとにスタティック、ダイナミックが選べるようになっていて、テンプレートの編集ページの下にある「テンプレートの設定」項目から公開方法が選択できる。

「スタティック」ではとくにブログ記事の再構築に時間がかかるのでアクセスの少ないブログは記事を動的に生成するように設定してみた。

しかし、残念ながら非力なマシンでは実用的な選択にはならなかった。

自宅サーバの環境(Celeron 2.0GHz, SQLite3)ではページの表示に10秒もかかってしまう。

2,3件同時にアクセスがあれば他のサービスにも支障が出るし、表示待ち10秒は結構なストレスになる。

WordPressではページを動的に生成しているけれど実用的な生成速度が出ている。

処理中の様子をtopで観察してみるとCPUリソースのほとんどをユーザ時間に割いている。

どの辺りの処理に時間がかかっているんだろう。

プロファイラにかけてみたい。

]]>
https://blog.bugyo.tk/b-log/archives/344/feed 0
MovableTypeを入れてみる https://blog.bugyo.tk/b-log/archives/6 https://blog.bugyo.tk/b-log/archives/6#respond Sun, 15 Oct 2006 09:44:28 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/wordpress/archives/6 Continue reading MovableTypeを入れてみる]]> まーくんが使っているMovableTypeを入れてみた。
ある程度までは無料で使えるみたい。
でっかいシステム。しかもすごく重い。
これを玄箱で動かしていたのか。重いはず。
自分のサーバで動かしてもすごいもたもたする。
しかしこれはオーバースペック気味のkitccサーバの良い肥やしになりそうなので、こっちにも入れてみた。
さすがに速い。と思った。

]]>
https://blog.bugyo.tk/b-log/archives/6/feed 0