Understanding what is load average can be very confusing when you read man pages and other documents. So here is my understanding about load average.
Think about a bridge from where 100 cars can pass through at a time. So in load average context 100 processes can process at a time.
Now if there are only 50 cars going from that bridge that means 100:50 Now load average is .50 if there are 150 cars than 50 cars will be waiting to pass through that bridge in that context load average will 100:150 ie. load average of 1.50.
Hope it is clear in a single processor context. Now what if we have dual core processor or quad processor. In our example lets talk about quad processor.
Now there are 4 bridges which a capacity of 100 cars each bridge. In this context if have 150 cars coming than load average will be 1. This might be confusing as i think there are static calculation methods . Average will still come as 1.5 but now we still have spare capacity of 250 cars. So it would be fine to have load average of 1.5 which was not good in case of a single core processor.
In a quad core processor it is fine to have a load average anything below 4 , but can be a problem if it goes above 4 as that will means more than 400 cars for a bridge with capacity of 400 cars.
so why don't we have some standard for load average without looking at number of CPU's my machine, I don;t know about this as of now, but will post the same here.
Monday, November 15, 2010
Thursday, November 11, 2010
SVN UN-delete
If you want to recover any folder or file which was deleted accidentally you can recover the same. First you need to figure out the revision number when it was deleted. Now use this command on server to get back file/folder .
Remember even if you perform delete operation in SVN nothing gets deleted it is just omitted from future checkout's and updates.
svn cp -r 47 https://amit.example.com/svn/repos/test_repo/data/somefolder/Debug https://amit.example.com/svn/repos/test_repo/data/somefPublish Postolder/
Remember even if you perform delete operation in SVN nothing gets deleted it is just omitted from future checkout's and updates.
svn cp -r 47 https://amit.example.com/svn/repos/test_repo/data/somefolder/Debug https://amit.example.com/svn/repos/test_repo/data/somefPublish Postolder/
Sunday, November 7, 2010
Code Freeze SVN
To implement Code freeze in SVN you can write pre-commit hook script. Here is a sample script which does this job on specified paths. You please remove all echo in case implementing on production.
REPOS="$1"
TXN="$2"
echo "value of REPOS is :$REPOS" >> /svnroot/test_repo_precommit/hooks/precommit.log
echo "value of TXN is :$TXN" >> /svnroot/test_repo_precommit/hooks/precommit.log
REPO_URL_TO_MATCH=(
'/svnroot/test_repo_precommit/somepath1'
'/svnroot/test_repo_precommit/somepath2'
'/svnroot/test_repo_precommit/somepath2'
);
echo "printing REPO_URL_TO_MATCH array values : ${REPO_URL_TO_MATCH[@]}" >> /svnroot/test_repo_precommit/hooks/precommit.log
for REPO_URL_TO_MATCH in ${REPO_URL_TO_MATCH[@]}
do
echo "in for loop print REPO_URL_TO_MATCH :$REPO_URL_TO_MATCH" >> /svnroot/test_repo_precommit/hooks/precommit.log;
RESULT1=`svnlook dirs-changed "$REPOS" -t $TXN | grep -e "$REPO_URL_TO_MATCH"`;
echo " printing value of RESULT1 : $RESULT1" >> /svnroot/test_repo_precommit/hooks/precommit.log;
for pattern in $RESULT1
do
if [ ! -z "$pattern" ];
echo " Value of pattern is :$pattern " >> /svnroot/test_repo_precommit/hooks/precommit.log
then
echo "*** Your commit has been blocked because code is in freezed mode, Please contact repo administrator to remove code freeze from this path."
exit 1
fi
done
echo "Exit from Loop one " >> /svnroot/test_repo_precommit/hooks/precommit.log
done
echo `date` >> /svnroot/test_repo_precommit/hooks/precommit.log
echo "*********************This is end of script************************************" >> /svnroot/test_repo_precommit/hooks/precommit.log
REPOS="$1"
TXN="$2"
echo "value of REPOS is :$REPOS" >> /svnroot/test_repo_precommit/hooks/precommit.log
echo "value of TXN is :$TXN" >> /svnroot/test_repo_precommit/hooks/precommit.log
REPO_URL_TO_MATCH=(
'/svnroot/test_repo_precommit/somepath1'
'/svnroot/test_repo_precommit/somepath2'
'/svnroot/test_repo_precommit/somepath2'
);
echo "printing REPO_URL_TO_MATCH array values : ${REPO_URL_TO_MATCH[@]}" >> /svnroot/test_repo_precommit/hooks/precommit.log
for REPO_URL_TO_MATCH in ${REPO_URL_TO_MATCH[@]}
do
echo "in for loop print REPO_URL_TO_MATCH :$REPO_URL_TO_MATCH" >> /svnroot/test_repo_precommit/hooks/precommit.log;
RESULT1=`svnlook dirs-changed "$REPOS" -t $TXN | grep -e "$REPO_URL_TO_MATCH"`;
echo " printing value of RESULT1 : $RESULT1" >> /svnroot/test_repo_precommit/hooks/precommit.log;
for pattern in $RESULT1
do
if [ ! -z "$pattern" ];
echo " Value of pattern is :$pattern " >> /svnroot/test_repo_precommit/hooks/precommit.log
then
echo "*** Your commit has been blocked because code is in freezed mode, Please contact repo administrator to remove code freeze from this path."
exit 1
fi
done
echo "Exit from Loop one " >> /svnroot/test_repo_precommit/hooks/precommit.log
done
echo `date` >> /svnroot/test_repo_precommit/hooks/precommit.log
echo "*********************This is end of script************************************" >> /svnroot/test_repo_precommit/hooks/precommit.log
Subscribe to:
Posts (Atom)