motemen / isucon5

100万円ほしいでしゅ
1 stars 0 forks source link

サーバ構成ログ #4

Closed tatsuru closed 7 years ago

tatsuru commented 9 years ago

複数台の場合の構成ログなどの置き場 cheatsheet https://gist.github.com/tatsuru/5e4495edde7d78b171e9

初動

tatsuru commented 9 years ago

ログは /tmp/isucon.perl.log に出てます

tatsuru commented 9 years ago

H/W spec

tatsuru commented 9 years ago

テーブルこれ

psql -U isucon isucon5f
isucon5f=> \d endpoints;
            Table "public.endpoints"
   Column   |         Type          | Modifiers 
------------+-----------------------+-----------
 service    | character varying(32) | not null
 meth       | character varying(16) | not null
 token_type | token_types           | 
 token_key  | character varying(64) | 
 uri        | text                  | 
Indexes:
    "endpoints_pkey" PRIMARY KEY, btree (service)

isucon5f=> \d subscriptions;
 Table "public.subscriptions"
 Column  |  Type   | Modifiers 
---------+---------+-----------
 user_id | integer | not null
 arg     | text    | 
Indexes:
    "subscriptions_pkey" PRIMARY KEY, btree (user_id)
Foreign-key constraints:
    "subscriptions_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id)

isucon5f=> \d users;
                                  Table "public.users"
  Column  |          Type          |                     Modifiers                      
----------+------------------------+----------------------------------------------------
 id       | integer                | not null default nextval('users_id_seq'::regclass)
 email    | character varying(256) | not null
 salt     | character varying(32)  | not null
 passhash | bytea                  | not null
 grade    | grades                 | 
Indexes:
    "users_pkey" PRIMARY KEY, btree (id)
Referenced by:
    TABLE "subscriptions" CONSTRAINT "subscriptions_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id)
ichirin2501 commented 9 years ago
isucon5f=> select * from endpoints;
       service       | meth | token_type |        token_key         |                         uri
---------------------+------+------------+--------------------------+------------------------------------------------------
 ken                 | GET  |            |                          | http://api.five-final.isucon.net:8080/%s
 ken2                | GET  |            |                          | http://api.five-final.isucon.net:8080/
 surname             | GET  |            |                          | http://api.five-final.isucon.net:8081/surname
 givenname           | GET  |            |                          | http://api.five-final.isucon.net:8081/givenname
 tenki               | GET  | param      | zipcode                  | http://api.five-final.isucon.net:8988/
 perfectsec          | GET  | header     | X-PERFECT-SECURITY-TOKEN | https://api.five-final.isucon.net:8443/tokens
 perfectsec_attacked | GET  | header     | X-PERFECT-SECURITY-TOKEN | https://api.five-final.isucon.net:8443/attacked_list
tatsuru commented 9 years ago

psql 9.4.5

tatsuru commented 9 years ago

nginx/1.4.6

tatsuru commented 9 years ago

リクエスト先は hosts に書いてあるうける

isucon@isu09a:~$ cat /etc/hosts
127.0.0.1       localhost
203.104.208.171 isu01a.data-hotel.net   isu01a

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
203.104.208.160 api.five-final.isucon.net
203.104.208.160 api.five-final.isucon.net
203.104.208.160 api.five-final.isucon.net
tatsuru commented 9 years ago

なるほど〜〜〜 my $client = Furl->new(ssl_opts => { SSL_verify_mode => SSL_VERIFY_NONE });

tatsuru commented 9 years ago

memcached を 203.104.208.197 に立てました。ひとまず 256MB くらい

tatsuru commented 9 years ago

isu09c 203.104.208.197 に MySQL 5.5 立てました root パスワード無しでどこからでも接続できます

tatsuru commented 9 years ago

PostgreSQL 全台よそからつなげるようにした psql は isu09c 203.104.208.197 使ってください