k5342 / isucon8-qualify

0 stars 0 forks source link

情報をまとめる #1

Open euglena1215 opened 6 years ago

euglena1215 commented 6 years ago

esaに色々載せてたけどとっ散らかっているのでここにまとめていきたい

euglena1215 commented 6 years ago

やること

euglena1215 commented 6 years ago
いろいろ確認する.sh ```sh #!/bin/bash echo '' echo 'COMMAND: grep processor /proc/cpuinfo | wc -l' echo '' echo "CPU Core: $(grep processor /proc/cpuinfo | wc -l)"; echo '' echo '==================================================' echo '' echo 'COMMAND: free -hm' echo '' free -m echo '' user=$1 database=$2 password=$3 table_names=$(mysql -u $user $database -s -e 'show tables;'); echo '============================================' echo '============================================' echo ' Table Schema' echo '============================================' echo '============================================' echo '' for table_name in $table_names; do echo $table_name mysql -u $user $database -e "desc $table_name"; echo '' done echo '============================================' echo '============================================' echo ' Sample Data' echo '============================================' echo '============================================' echo '' for table_name in $table_names; do echo $table_name echo "SELECT * FROM $table_name LIMIT 5;" mysql -u $user $database -e "SELECT * FROM $table_name LIMIT 5"; echo '' done ```
gem install specific_install
gem specific_install https://github.com/kainosnoema/rack-lineprof.git
touch /var/log/lineprof.log
sudo chmod 666 /var/log/lineprof.log
# app.rb
require 'rack-lineprof'
require 'logger' # このrequire要らないかも

logger = Logger.new('/var/log/lineprof.log')
use Rack::Lineprof, profile: 'app.rb', logger: logger # 基本的にはコメントアウトしておく
timestamp=`date +'%m%d_%T'`; sudo cp /var/log/nginx/access.log "/var/log/nginx/access${timestamp}.log"; sudo cp /dev/null /var/log/nginx/access.log