Concept:
Two vectors are perpendicular if and only if their dot product is zero:
\[
\vec u\cdot\vec v=0
\]
We use this property to form equations involving vector magnitudes.
Step 1: Use the first perpendicular condition.
Given:
\[
(\vec a+\vec b)\perp\vec b
\]
Therefore,
\[
(\vec a+\vec b)\cdot\vec b=0
\]
Expanding:
\[
\vec a\cdot\vec b+\vec b\cdot\vec b=0
\]
\[
\vec a\cdot\vec b+|\vec b|^2=0
\]
Hence,
\[
\vec a\cdot\vec b=-|\vec b|^2
\]
Step 2: Use the second perpendicular condition.
Given:
\[
(\vec a+2\vec b)\perp\vec a
\]
Thus,
\[
(\vec a+2\vec b)\cdot\vec a=0
\]
Expanding:
\[
\vec a\cdot\vec a+2\vec b\cdot\vec a=0
\]
\[
|\vec a|^2+2(\vec a\cdot\vec b)=0
\]
Substitute:
\[
\vec a\cdot\vec b=-|\vec b|^2
\]
Hence,
\[
|\vec a|^2+2(-|\vec b|^2)=0
\]
\[
|\vec a|^2=2|\vec b|^2
\]
Taking square roots:
\[
|\vec a|=\sqrt2|\vec b|
\]
Hence,
\[
\boxed{|\vec a|=\sqrt2|\vec b|}
\]