Asymptotic on $\max\{d(n): 1\leq n\leq N\}$. 
Question: Let $d(n)=\sum_{d|n}1$, be the divisor function. Estimate the asymptotic behaver $$D(N):=\max\{d(n):1\leq n\leq N\}$$ when $N$ is large.

I know $$\sum_{n=1}^N d(n)=\sum_{n=1}^N [\frac{N}{n}]=N\sum_{n=1}^N\frac{1}{n} + O(N)\approx N{\rm log} N.$$ So $D(N)\geq \frac{1}{N}\sum_{n=1}^N d(n)\approx {\rm log}N$. But I can't determine if this is optimal, i.e. $D(N)=O({\rm log}N)$.
 A: Wigert showed the bound
$$ d(n) \leq e^{(\log 2 + o(1))(\log n / \log \log n)}.$$
There are other ways of approaching this bound, but I think it's not too hard to show bounds of this shape. We'll do this in two ways.
Naive primorials
Let $P_m = \prod_{j \leq m} p_j$ denote the $m$th primorial, the product of the first $m$ primes. One way to get numbers with lots of divisors would be to consider the primorials. These aren't necessarily the best, but the number of divisors of $P_m$ is $2^m$, a very easy number to understand.
The prime number theorem implies that $P_m \sim e^{O(1) m / \log m}$. Thus $P_m \lesssim n$ if $m \lesssim \frac{\log n}{\log \log n}$. Such a $P_m$ will have at least
$$ 2^m \sim 2^{O(1) \log n / \log \log n}$$
divisors, which is of the claimed size.
Direct bounds
Instead of using primorials as approximations for numbers with maximal numbers of divisors (which they aren't, actually), we can be more precise with a bit of extra work. I repeat this analysis from Terry Tao, though it appears in various places in the literature.
Suppose
$$ n = \prod p_j^{\alpha_j}.$$
Then
$$ d(n) = \prod (1 + \alpha_j). $$
Consider the ratio
$$ \frac{d(n)}{n^\epsilon} = \prod \frac{1 + \alpha_j}{p_j^{\alpha_j \epsilon}} $$
for an $\epsilon > 0$ that we will optimize later. For each prime $p_j$, the factor $\frac{1 + \alpha_j}{p_j^{\alpha_j \epsilon}}$ will be small when $p_j$ is large (in comparison to $\epsilon$). When $p_j > O(1 / \epsilon)$, for example, we find that
$$ p_j^{\alpha_j \epsilon} > e^{\alpha_j} \geq 1 + \alpha_j, $$
and thus for such primes
$$ \frac{1 + \alpha_j}{p_j^{\alpha_j \epsilon}} \leq 1. $$
For small primes, when $p_j < O(1 / \epsilon)$, Taylor expansion show that
$$ p_j^{\alpha_j \epsilon} = \exp(\epsilon \alpha_j \log p_j) \geq 1 + \epsilon \alpha_j \log p_j. $$
Thus for such primes,
$$ \frac{1 + \alpha_j}{p_j^{\alpha_j \epsilon}}
\leq \frac{1 + \alpha_j}{1 + \alpha_j \epsilon \log p_j}
\leq
O\left( \frac{1}{\epsilon \log p_j}\right),$$
where the implicit constant does not depend on $\alpha_j$.
Thus in total, we find that
$$ \frac{d(n)}{n^\epsilon} \ll \prod_{p < O(1/\epsilon)} O\left(\frac{1}{\epsilon \log p_j}\right) \ll O\left( \frac{1}{\epsilon} \right)^{\exp(1/\epsilon)} = \exp(\exp(O(1/\epsilon))). $$
(We bound $\log p_j$ by a constant $\log 2$ trivially, and the number of primes trivially).
Therefore we find that
$$ d(n) \ll n^{\epsilon} \exp (\exp (O(1/\epsilon))). $$
Choosing $\epsilon = C / \log \log n$ for sufficiently large $C$ causes $n^{\epsilon}$ to dominate, giving the claimed bound.
This shows an upper bound.
A: This answer is intended to prove the result that
$$
\limsup_{n\to\infty}{\log d(n)\log\log n\over\log n}=\log2.\tag1
$$
Let $n_k$ be the product of first $k$ primes, so that $d(n_k)=2^k$. By Chebyshev's inequality (i.e. the weak prime number theorem), we know there exists $c>0$ such that for large $k$,
$$
\log n_k=\vartheta(p_k)=\sum_{p\le p_k}\log p>cp_k.
$$
This indicates that
$$
\log\log n_k>(1+o(1))\log p_k.
$$
Moreover, since $\vartheta(p_k)\le\pi(p_k)\log p_k=k\log p_k$, we have
$$
{\log d(n_k)\over\log2}=k={k\log p_k\over\log p_k}>(1+o(1)){\log n_k\over\log\log n_k}.
$$
This inequality indicates that
$$
\limsup_{n\to\infty}{\log d(n)\log\log n\over\log n}\ge\log2.
$$
To turn this one-sided result into an equality, we need to obtain a general upper bound for $d(n)$:
Suppose $n=\prod_{p|n}p^{\alpha_p}$. Then by definition, we can choose $2\le t\le n$ so that
\begin{align}
d(n)
&=\prod_{p|n}(1+\alpha_p)=\prod_{\substack{p|n\\p\le t}}(1+\alpha_p)\prod_{\substack{p|n\\p>t}}(1+\alpha_p)
\end{align}
For all $p|n$, we know for certain that $\alpha_p\le\log n/\log2$ with equality iff $p=2$. As a result, we have
$$
\prod_{\substack{p|n\\p\le t}}(1+\alpha_p)\le\left(1+{\log n\over\log2}\right)^t
$$
When product over $p|n\wedge p>t$, we have
\begin{aligned}
\prod_{\substack{p|n\\p>t}}(1+\alpha_p)
&\le\prod_{\substack{p|n\\p>t}}2^{\alpha_p}=\prod_{\substack{p|n\\p>t}}p^{\alpha_p\log2/\log p} \\
&<\left(\prod_{p|n}p^{\alpha_p}\right)^{\log2/\log t}=\exp\left(\log2{\log n\over\log t}\right)
\end{aligned}
Putting them all together gives
$$
\log d(n)<t\log\left(1+{\log n\over\log2}\right)+\log2{\log n\over\log t}<\log2{\log n\over\log t}+O(t\log\log n)
$$
To continue, set $t=e^{-u}\log n$ so that
$$
\log d(n)<\log2{\log n\over\log\log n-u}+O(e^{-u}\log n\log\log n)
$$
To continue, set $u=3\log\log\log n$, so we conclude that
$$
{\log d(n)\over\log2}<{\log n\over\log\log n}\left\{1+O\left(\log\log\log n\over\log\log n\right)\right\}
$$
Combining this with the aforementioned inequality, we finish the proof for (1).
