@@ -36,12 +36,34 @@ mkdir codis_data_1
3636mkdir codis_data_2
3737
3838# Example Change the location for storing data on primary and secondary nodes in the configuration file
39- 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
40- 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
41- # Start pika instances with reduced memory footprint
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
39+ # Reduce memory usage for CI environment
40+ sed -i.bak \
41+ -e ' s|databases : 1|databases : 2|' \
42+ -e ' s|port : 9221|port : 8000|' \
43+ -e ' s|log-path : ./log/|log-path : ./codis_data_1/log/|' \
44+ -e ' s|db-path : ./db/|db-path : ./codis_data_1/db/|' \
45+ -e ' s|dump-path : ./dump/|dump-path : ./codis_data_1/dump/|' \
46+ -e ' s|pidfile : ./pika.pid|pidfile : ./codis_data_1/pika.pid|' \
47+ -e ' s|db-sync-path : ./dbsync/|db-sync-path : ./codis_data_1/dbsync/|' \
48+ -e ' s|#daemonize : yes|daemonize : yes|' \
49+ -e ' s|cache-maxmemory : 10737418240|cache-maxmemory : 268435456|' \
50+ -e ' s|max-write-buffer-size : 10737418240|max-write-buffer-size : 268435456|' \
51+ -e ' s|write-buffer-size : 256M|write-buffer-size : 64M|' \
52+ ./pika_8000.conf
53+
54+ sed -i.bak \
55+ -e ' s|databases : 1|databases : 2|' \
56+ -e ' s|port : 9221|port : 8001|' \
57+ -e ' s|log-path : ./log/|log-path : ./codis_data_2/log/|' \
58+ -e ' s|db-path : ./db/|db-path : ./codis_data_2/db/|' \
59+ -e ' s|dump-path : ./dump/|dump-path : ./codis_data_2/dump/|' \
60+ -e ' s|pidfile : ./pika.pid|pidfile : ./codis_data_2/pika.pid|' \
61+ -e ' s|db-sync-path : ./dbsync/|db-sync-path : ./codis_data_2/dbsync/|' \
62+ -e ' s|#daemonize : yes|daemonize : yes|' \
63+ -e ' s|cache-maxmemory : 10737418240|cache-maxmemory : 268435456|' \
64+ -e ' s|max-write-buffer-size : 10737418240|max-write-buffer-size : 268435456|' \
65+ -e ' s|write-buffer-size : 256M|write-buffer-size : 64M|' \
66+ ./pika_8001.conf
4567
4668# Start instances one by one with time to initialize
4769./pika -c ./pika_8000.conf
0 commit comments