-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
46 lines (37 loc) · 884 Bytes
/
run.sh
File metadata and controls
46 lines (37 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
mkdir /run/php
# Start PHP FPM
/etc/init.d/php5.6-fpm restart
# Start nginx
/etc/init.d/nginx restart
# Start memcache
/etc/init.d/memcached restart
# Start tarantool
mkdir -p /var/lib/tarantool/
chown tarantool:tarantool /var/lib/tarantool
/etc/init.d/tarantool restart
# Wait for file - unpack it and insert data into system
echo "Wait for file"
while [ ! -f /tmp/data/data.zip ]
do
sleep 1
done
unzip /tmp/data/data.zip -d /var/data/
# Loop
date && php /var/www/app/insert.php && date
# Warm up app
for i in 1 2 3
do
echo "Welcome $i times"
curl "http://127.0.0.1/users/$i" -H "Host: travel.com"
curl "http://127.0.0.1/visits/$i" -H "Host: travel.com"
curl "http://127.0.0.1/locations/$i" -H "Host: travel.com"
done
trap 'echo "Caught SIGUSR1"' SIGUSR1
echo "Waiting for SIGUSR signal"
while :
do
sleep 60 &
wait
echo -n "."
done