Skip to content

Commit 592eb8d

Browse files
committed
fixci
1 parent 192207f commit 592eb8d

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

tests/integration/start_codis.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ rm -rf /tmp/codis || true
99
rm -rf codis_data_1 || true
1010
rm -rf codis_data_2 || true
1111

12-
# Clean up log directory in codis to free space, but preserve bin if it exists
13-
# to avoid unnecessary recompilation
12+
# Clean up temporary directories in codis to free space
13+
rm -rf ../codis/bin || true
1414
rm -rf ../codis/log || true
1515
mkdir -p ../codis/bin
1616
mkdir -p ../codis/log
@@ -39,9 +39,9 @@ mkdir codis_data_2
3939
sed -i.bak -e 's|databases : 1|databases : 2|' -e 's|port : 9221|port : 8000|' -e 's|log-path : ./log/|log-path : ./codis_data_1/log/|' -e 's|db-path : ./db/|db-path : ./codis_data_1/db/|' -e 's|dump-path : ./dump/|dump-path : ./codis_data_1/dump/|' -e 's|pidfile : ./pika.pid|pidfile : ./codis_data_1/pika.pid|' -e 's|db-sync-path : ./dbsync/|db-sync-path : ./codis_data_1/dbsync/|' -e 's|#daemonize : yes|daemonize : yes|' ./pika_8000.conf
4040
sed -i.bak -e 's|databases : 1|databases : 2|' -e 's|port : 9221|port : 8001|' -e 's|log-path : ./log/|log-path : ./codis_data_2/log/|' -e 's|db-path : ./db/|db-path : ./codis_data_2/db/|' -e 's|dump-path : ./dump/|dump-path : ./codis_data_2/dump/|' -e 's|pidfile : ./pika.pid|pidfile : ./codis_data_2/pika.pid|' -e 's|db-sync-path : ./dbsync/|db-sync-path : ./codis_data_2/dbsync/|' -e 's|#daemonize : yes|daemonize : yes|' ./pika_8001.conf
4141
# Start pika instances with reduced memory footprint
42-
# Add memory_limit parameter to reduce memory usage
43-
sed -i.bak -e 's|#max-memory : 0|max-memory : 512|' ./pika_8000.conf
44-
sed -i.bak -e 's|#max-memory : 0|max-memory : 512|' ./pika_8001.conf
42+
# Add memory_limit parameter to reduce memory usage (256MB per instance)
43+
sed -i.bak -e 's|#max-memory : 0|max-memory : 256|' ./pika_8000.conf
44+
sed -i.bak -e 's|#max-memory : 0|max-memory : 256|' ./pika_8001.conf
4545

4646
# Start instances one by one with time to initialize
4747
./pika -c ./pika_8000.conf
@@ -54,14 +54,18 @@ sleep 10
5454
free -h || true
5555

5656
cd ../codis
57-
# Check if codis is already built to avoid unnecessary compilation
58-
if [ ! -f "bin/codis-admin" ] || [ ! -f "bin/codis-proxy" ] || [ ! -f "bin/codis-dashboard" ]; then
59-
echo "Building codis..."
60-
make
61-
else
62-
echo "Codis already built, skipping compilation..."
57+
echo "Building codis..."
58+
59+
# Free up memory before building
60+
echo "Clearing caches to free up memory..."
61+
sync
62+
if [ $(id -u) -eq 0 ]; then
63+
echo 3 > /proc/sys/vm/drop_caches || true
6364
fi
6465

66+
# Limit parallel jobs during make to reduce memory usage
67+
make -j2
68+
6569
echo 'startup codis dashboard and codis proxy'
6670
./admin/codis-dashboard-admin.sh start
6771
./admin/codis-proxy-admin.sh start

0 commit comments

Comments
 (0)