Let p be a prime integer, k be a p-closed field of characteristic = p, T be a torus defined over k, F be a finite p-group, and 1 → T → G → F → 1 be an exact sequence of algebraic groups. In this paper we study the essential dimension ed(G; p) of G at p. R. Lötscher, M. MacDonald, A. Meyer, and the first author showed thatwhere V and W range over the p-faithful and p-generically free k-representations of G, respectively. This generalizes the formulas for the essential dimension at p of a finite p-group due to N. Karpenko and A. Merkurjev (here T = {1}) and of a torus, due to Lötscher et al. (here F = {1}). In both of these cases every p-generically free representation of G is p-faithful, so the upper and lower bounds on ed(G; p) given above coincide. In general there is a gap between these bounds. Lötscher et al. conjectured that the upper bound is, in fact, sharp; that is, ed(G; p) = min dim(W ) − dim(G), where W ranges over the p-generically free representations, as above. We prove this conjecture in the case, where F is diagonalizable. Moreover, we give an explicit way to compute min dim(W ) in this case. As an application of our main theorem we compute ed(G; p), where G is the normalizer of a split maximal torus in a split simple algebraic group, in all previously inaccessible cases.