  In this paper we determine, for all $r$ sufficiently large, the irreducible
component(s) of maximal dimension of the variety of commuting $r$-tuples of
nilpotent elements of $\mathfrak{gl}_n$. Our main result is that in
characteristic $\neq 2,3$, this nilpotent commuting variety has dimension
$(r+1)\lfloor \frac{n^2}{4}\rfloor$ for $n\geq 4$, $r\geq 7$. We use this to
find the dimension of the (ordinary) $r$-th commuting varieties of
$\mathfrak{gl}_n$ and $\mathfrak{sl}_n$ for the same range of values of $r$ and
$n$.
  Our principal motivation is the connection between nilpotent commuting
varieties and cohomological complexity of finite group schemes, which we
exploit in the last section of the paper to obtain explicit values for
complexities of a large family of modules over the $r$-th Frobenius kernel
$({\rm GL}_n)_{(r)}$. These results indicate an inequality between the
complexities of a rational $G$-module $M$ when restricted to $G_{(r)}$ or to
$G(\mathbb F_{p^r})$; we subsequently establish this inequality for every
simple algebraic group $G$ defined over an algebraically closed field of good
characteristic, significantly extending a result of Lin and Nakano.
