  We establish a connection between commuting varieties $C_g(G)$ (potentially
of higher genus), which are associated with a group scheme $G$ consisting of
upper triangular matrices, and the representation homology $HR_*(\Sigma_g,G)$
of a Riemann surface $\Sigma_g$ with coefficients in the group $G$. As an
outcome, we provide a numerical criterion for determining whether commuting
varieties $C(U_n)$ form a complete intersection for groups consisting of upper
triangular unipotent matrices.
