Let $r_3(n) = \left|\{(a,b,c)\in {\mathbb Z}^3 :\, a^2+b^2+c^2=n \}\right|$. I am looking for the maximum asymptotic size of $r_3(n)$. That is, the maximum number of representations that a number can have as a sum of three squares.

Gauss proved that $r_3(n) = \frac{A\sqrt{n}}{\pi}\sum_{m-1}^\infty\left(\frac{-n}{m}\right) \frac{1}{m}$ (where $\left(\frac{a}{b}\right)$ is the Jacobi-Legendre symbol). Another similar-looking formula can be found, for example, in the bottom of the first page of this paper

A simple and non-constructive argument shows that there are infinitely many $n$'s for which $r_3(n) \ge c\sqrt{n}$ (for some constant $c$). Moreover, in an old paper of Erdős he mentions that $r_3(n) \ge c\sqrt{n}\log \log n$ can also be obtained. Unfortunately, Erdős does not provide any details and only states "By deep number theoretic results".

More specifically, my questions are (1) how can one obtain Erdős' bound? (2) What $n$'s achieve the above bounds? (3) Can one use the above formula for $r_3(n)$ to show this?

Many thanks, Adam