add bench docker
This commit is contained in:
parent
7172f932ca
commit
a6912e72bd
3 changed files with 61 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
echo "----------------------------"
|
echo "----------------------------"
|
||||||
echo "Benchmark on rpxy"
|
echo "Benchmark on rpxy"
|
||||||
ab -c 32 -n 10000 http://127.0.0.1:8080/
|
ab -c 32 -n 10000 http://127.0.0.1:8080/ # TODO: localhost = 127.0.0.1を解決できるように決めておかんとだめそう
|
||||||
|
|
||||||
echo "----------------------------"
|
echo "----------------------------"
|
||||||
echo "Benchmark on nginx"
|
echo "Benchmark on nginx"
|
||||||
|
|
|
||||||
4
docker-bin/entrypoint.sh
Normal file
4
docker-bin/entrypoint.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
LOG_FILE=/var/log/rpxy/rpxy.log
|
||||||
|
|
||||||
|
/run.sh 2>&1 | tee $LOG_FILE
|
||||||
56
docker-bin/run.sh
Normal file
56
docker-bin/run.sh
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
LOG_FILE=/var/log/rpxy/rpxy.log
|
||||||
|
CONFIG_FILE=/etc/rpxy.toml
|
||||||
|
LOG_SIZE=10M
|
||||||
|
LOG_NUM=10
|
||||||
|
|
||||||
|
# logrotate
|
||||||
|
if [ $LOGROTATE_NUM ]; then
|
||||||
|
LOG_NUM=${LOGROTATE_NUM}
|
||||||
|
fi
|
||||||
|
if [ $LOGROTATE_SIZE ]; then
|
||||||
|
LOG_SIZE=${LOGROTATE_SIZE}
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > /etc/logrotate.conf << EOF
|
||||||
|
# see "man logrotate" for details
|
||||||
|
# rotate log files weekly
|
||||||
|
weekly
|
||||||
|
# use the adm group by default, since this is the owning group
|
||||||
|
# of /var/log/syslog.
|
||||||
|
su root adm
|
||||||
|
# keep 4 weeks worth of backlogs
|
||||||
|
rotate 4
|
||||||
|
# create new (empty) log files after rotating old ones
|
||||||
|
create
|
||||||
|
# use date as a suffix of the rotated file
|
||||||
|
#dateext
|
||||||
|
# uncomment this if you want your log files compressed
|
||||||
|
#compress
|
||||||
|
# packages drop log rotation information into this directory
|
||||||
|
include /etc/logrotate.d
|
||||||
|
# system-specific logs may be also be configured here.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > /etc/logrotate.d/rpxy << EOF
|
||||||
|
${LOG_FILE} {
|
||||||
|
dateext
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
rotate ${LOG_NUM}
|
||||||
|
notifempty
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
dateformat -%Y-%m-%d-%s
|
||||||
|
size ${LOG_SIZE}
|
||||||
|
copytruncate
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cp -p /etc/cron.daily/logrotate /etc/cron.hourly/
|
||||||
|
service cron start
|
||||||
|
|
||||||
|
echo "Start rpxy"
|
||||||
|
|
||||||
|
RUST_LOG=info /opt/rpxy/sbin/rpxy --config ${CONFIG_FILE}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue