Skip to content

Commit

Permalink
perf: use ld_preload on other 9 processes
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderYe committed Jan 23, 2022
1 parent e8120fd commit d42e8e2
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 22 deletions.
62 changes: 51 additions & 11 deletions build/Centos6-DNF/root/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ find /home/neople/ -name '*.log' -type f -print -exec rm -f {} \;
find /home/neople/ -name '*.pid' -type f -print -exec rm -f {} \;
find /home/neople/ -name 'core.*' -type f -print -exec rm -f {} \;

if $PRELOAD_LD;then
echo "start game use LD_PRELOAD mode"
else
echo "start game use normal mode"
fi

cd /root
./GateRestart

Expand All @@ -15,13 +21,21 @@ cd /home/neople/monitor
chmod 777 *
rm -f /home/neople/monitor/pid/*.pid
rm -rf /home/neople/monitor/log/*.*
./df_monitor_r mnt_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_monitor_r mnt_siroco start &
else
./df_monitor_r mnt_siroco start &
fi

cd /home/neople/manager
chmod 777 *
rm -f /home/neople/manager/pid/*.pid
rm -rf /home/neople/manager/log/*.*
./df_manager_r manager start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_manager_r manager start &
else
./df_manager_r manager start &
fi

cd /home/neople/relay
chmod 777 *
Expand All @@ -33,31 +47,51 @@ cd /home/neople/bridge
chmod 777 *
rm -f /home/neople/bridge/pid/*.pid
rm -rf /home/neople/bridge/log/*.*
./df_bridge_r bridge start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_bridge_r bridge start &
else
./df_bridge_r bridge start &
fi

cd /home/neople/channel
chmod 777 *
rm -f /home/neople/channel/pid/*.pid
rm -rf /home/neople/channel/log/*.*
./df_channel_r channel start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_channel_r channel start &
else
./df_channel_r channel start &
fi

cd /home/neople/dbmw_guild
chmod 777 *
rm -f /home/neople/dbmw_guild/pid/*.pid
rm -rf /home/neople/dbmw_guild/log/*.*
./df_dbmw_r dbmw_gld_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_gld_siroco start &
else
./df_dbmw_r dbmw_gld_siroco start &
fi

cd /home/neople/dbmw_mnt
chmod 777 *
rm -f /home/neople/dbmw_mnt/pid/*.pid
rm -rf /home/neople/dbmw_mnt/log/*.*
./df_dbmw_r dbmw_mnt_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_mnt_siroco start &
else
./df_dbmw_r dbmw_mnt_siroco start &
fi

cd /home/neople/dbmw_stat
chmod 777 *
rm -f /home/neople/dbmw_stat/pid/*.pid
rm -rf /home/neople/dbmw_stat/log/*.*
./df_dbmw_r dbmw_stat_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_stat_siroco start &
else
./df_dbmw_r dbmw_stat_siroco start &
fi

cd /home/neople/auction
chmod 777 *
Expand All @@ -75,13 +109,21 @@ cd /home/neople/guild
chmod 777 *
rm -f /home/neople/guild/pid/*.pid
rm -rf /home/neople/guild/log/*.*
./df_guild_r gld_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_guild_r gld_siroco start &
else
./df_guild_r gld_siroco start &
fi

cd /home/neople/statics
chmod 777 *
rm -f /home/neople/statics/pid/*.pid
rm -rf /home/neople/statics/log/*.*
./df_statics_r stat_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_statics_r stat_siroco start &
else
./df_statics_r stat_siroco start &
fi

cd /home/neople/coserver
chmod 777 *
Expand Down Expand Up @@ -121,12 +163,10 @@ sleep 2

if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
echo "start game use LD_PRELOAD mode"
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &
else
./df_game_r siroco11 start &
echo "start game use normal mode"
sleep 2
./df_game_r siroco52 start &
fi
Expand Down
62 changes: 51 additions & 11 deletions build/Centos7-DNF/root/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ find /home/neople/ -name '*.log' -type f -print -exec rm -f {} \;
find /home/neople/ -name '*.pid' -type f -print -exec rm -f {} \;
find /home/neople/ -name 'core.*' -type f -print -exec rm -f {} \;

if $PRELOAD_LD;then
echo "start game use LD_PRELOAD mode"
else
echo "start game use normal mode"
fi

cd /root
./GateRestart

Expand All @@ -15,13 +21,21 @@ cd /home/neople/monitor
chmod 777 *
rm -f /home/neople/monitor/pid/*.pid
rm -rf /home/neople/monitor/log/*.*
./df_monitor_r mnt_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_monitor_r mnt_siroco start &
else
./df_monitor_r mnt_siroco start &
fi

cd /home/neople/manager
chmod 777 *
rm -f /home/neople/manager/pid/*.pid
rm -rf /home/neople/manager/log/*.*
./df_manager_r manager start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_manager_r manager start &
else
./df_manager_r manager start &
fi

cd /home/neople/relay
chmod 777 *
Expand All @@ -33,31 +47,51 @@ cd /home/neople/bridge
chmod 777 *
rm -f /home/neople/bridge/pid/*.pid
rm -rf /home/neople/bridge/log/*.*
./df_bridge_r bridge start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_bridge_r bridge start &
else
./df_bridge_r bridge start &
fi

cd /home/neople/channel
chmod 777 *
rm -f /home/neople/channel/pid/*.pid
rm -rf /home/neople/channel/log/*.*
./df_channel_r channel start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_channel_r channel start &
else
./df_channel_r channel start &
fi

cd /home/neople/dbmw_guild
chmod 777 *
rm -f /home/neople/dbmw_guild/pid/*.pid
rm -rf /home/neople/dbmw_guild/log/*.*
./df_dbmw_r dbmw_gld_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_gld_siroco start &
else
./df_dbmw_r dbmw_gld_siroco start &
fi

cd /home/neople/dbmw_mnt
chmod 777 *
rm -f /home/neople/dbmw_mnt/pid/*.pid
rm -rf /home/neople/dbmw_mnt/log/*.*
./df_dbmw_r dbmw_mnt_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_mnt_siroco start &
else
./df_dbmw_r dbmw_mnt_siroco start &
fi

cd /home/neople/dbmw_stat
chmod 777 *
rm -f /home/neople/dbmw_stat/pid/*.pid
rm -rf /home/neople/dbmw_stat/log/*.*
./df_dbmw_r dbmw_stat_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_dbmw_r dbmw_stat_siroco start &
else
./df_dbmw_r dbmw_stat_siroco start &
fi

cd /home/neople/auction
chmod 777 *
Expand All @@ -75,13 +109,21 @@ cd /home/neople/guild
chmod 777 *
rm -f /home/neople/guild/pid/*.pid
rm -rf /home/neople/guild/log/*.*
./df_guild_r gld_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_guild_r gld_siroco start &
else
./df_guild_r gld_siroco start &
fi

cd /home/neople/statics
chmod 777 *
rm -f /home/neople/statics/pid/*.pid
rm -rf /home/neople/statics/log/*.*
./df_statics_r stat_siroco start &
if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_statics_r stat_siroco start &
else
./df_statics_r stat_siroco start &
fi

cd /home/neople/coserver
chmod 777 *
Expand Down Expand Up @@ -121,12 +163,10 @@ sleep 2

if $PRELOAD_LD;then
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco11 start &
echo "start game use LD_PRELOAD mode"
sleep 2
LD_PRELOAD=/lib/libhook.so ./df_game_r siroco52 start &
else
./df_game_r siroco11 start &
echo "start game use normal mode"
sleep 2
./df_game_r siroco52 start &
fi
Expand Down

0 comments on commit d42e8e2

Please sign in to comment.