Pillai's arithmetical function is simply $$P(n)=\sum_{i=1}^{n}\gcd{\left(n,i\right)}=\sum_{d|n}d\phi{\left(\frac{n}{d}\right)},$$ where $\phi\left(n\right)$ is Euler's totient function.
On the second page of this document, https://dmle.icmat.es/pdf/COLLECTANEAMATHEMATICA_1989_40_01_03.pdf, the author states that "$P(n)/n$ behaves like $6\log n/\pi^{2}$" (where $\log$ is the natural log).
If I understand correctly, this implies that $P(n)\approx 6n\ln n/\pi^{2}$. Of course, this is an approximation and not an upper bound. I did find, however, that the similar function $2n\ln n$ is a good upper bound and works for at least the first sixty positive integer values of $n$, except $1\le n\le3$. Unfortunately, I was unable to prove this for all positive integer values of $n$ (except $1$, $2$, and $3$). Is there any way of proving this bound? Or is there an even better upper bound that I am not aware of?
EDIT:
As Mindlack pointed out, values such as $n=\left(p_1\cdots p_k\right)^{2}$ go above this proposed upper bound. After some trial-and-error, I did find another possible upper bound ($\frac{5}{4}n\sqrt{n}$) that does work for $n=\left(3\times5\times7\times11\right)^{2}$, while $2n\ln{n}$ did not.
I think I may have found an upper bound, namely $2n\sqrt{n}$. I may provide the solution if requested, but I'll leave two hints that should be enough to solve this problem: (1) $\tau\left(n\right)\le2\sqrt{n}$ (2) if the set of divisors of $n$ is $\{a_{1}, a_{2}, a_{3}, ..., a_{\tau\left(n\right)}\}$, what is an approximate value of $P\left(n\right)$?