Skip to content

Instantly share code, notes, and snippets.

@wataru420
Last active August 10, 2016 03:30
Show Gist options
  • Save wataru420/25e8a61f9cd760f8a50d72fd1e012447 to your computer and use it in GitHub Desktop.
Save wataru420/25e8a61f9cd760f8a50d72fd1e012447 to your computer and use it in GitHub Desktop.
[mysqld]
slow_query_log
slow_query_log-file = /var/log/mysql/mysql-slow.sql
long_query_time = 5
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
max_allowed_packet=300M
innodb_buffer_pool_size = 1G # 8割説
innodb_flush_log_at_trx_commit = 0
innodb_flush_method=O_DIRECT
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
worker_processes auto;
events {
worker_connections 10240;
# accept_mutex_delay 100ms;
accept_mutex off;
}
http {
upstream app {
server 127.0.0.1:8080;
keepalive 128;
}
include /etc/nginx/mime.types;
server {
log_format with_time '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time';
access_log /var/log/nginx/access.log with_time;
root /home/isucon/webapp/public/;
location /stylesheets {
# max: キャッシュの最大数
# inactive: アクセスがないキャッシュの有効期限
open_file_cache max=100 inactive=20s;
expires 1d;
}
location /images {
# max: キャッシュの最大数
# inactive: アクセスがないキャッシュの有効期限
open_file_cache max=100 inactive=20s;
expires 1d;
}
location / {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://app;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment